X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=4e6ab75d9502b190e85e3823d839261fa36134f5;hb=e9c8e87cf09ad9761bea1193b25d01a87f8e0dd6;hp=d8247825d47c9c01ae818760b63b75679644112d;hpb=4e4d72b22a81d1f2d8daee1093ac45264a0a1e2d;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index d8247825..4e6ab75d 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -202,7 +202,6 @@ shared_ptr MainWindow::add_view(const QString &title, views::TraceView::View *tv = qobject_cast(v.get()); - tv->enable_sticky_scrolling(true); tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool()); if (!main_bar) { @@ -717,15 +716,6 @@ void MainWindow::on_tab_close_requested(int index) remove_session(session); } -void MainWindow::on_view_sticky_scrolling_shortcut() -{ - shared_ptr viewbase = get_active_view(); - views::TraceView::View* view = - qobject_cast(viewbase.get()); - if (view) - view->toggle_sticky_scrolling(); -} - void MainWindow::on_view_coloured_bg_shortcut() { GlobalSettings settings; @@ -734,6 +724,14 @@ void MainWindow::on_view_coloured_bg_shortcut() settings.setValue(GlobalSettings::Key_View_ColouredBG, !state); } +void MainWindow::on_view_sticky_scrolling_shortcut() +{ + GlobalSettings settings; + + bool state = settings.value(GlobalSettings::Key_View_StickyScrolling).toBool(); + settings.setValue(GlobalSettings::Key_View_StickyScrolling, !state); +} + void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value) { bool state = new_value.toBool();