GlobalSettings::register_change_handler(GlobalSettings::Key_View_ColouredBG,
bind(&MainWindow::on_settingViewColouredBg_changed, this, _1));
- GlobalSettings::register_change_handler(GlobalSettings::Key_View_StickyScrolling,
- bind(&MainWindow::on_settingViewStickyScrolling_changed, this, _1));
setup_ui();
restore_ui_settings();
views::TraceView::View *tv =
qobject_cast<views::TraceView::View*>(v.get());
- tv->enable_sticky_scrolling(true);
tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool());
if (!main_bar) {
}
}
-void MainWindow::on_settingViewStickyScrolling_changed(const QVariant new_value)
-{
- bool state = new_value.toBool();
-
- for (auto entry : view_docks_) {
- shared_ptr<views::ViewBase> viewbase = entry.second;
-
- // Only trace views have this setting
- views::TraceView::View* view =
- qobject_cast<views::TraceView::View*>(viewbase.get());
- if (view)
- view->enable_sticky_scrolling(state);
- }
-}
-
void MainWindow::on_close_current_tab()
{
int tab = session_selector_.currentIndex();
void on_view_sticky_scrolling_shortcut();
void on_settingViewColouredBg_changed(const QVariant new_value);
- void on_settingViewStickyScrolling_changed(const QVariant new_value);
void on_close_current_tab();
return make_pair(*left_time, *right_time);
}
-void View::enable_sticky_scrolling(bool state)
-{
- sticky_scrolling_ = state;
-}
-
void View::enable_coloured_bg(bool state)
{
const vector<shared_ptr<TraceTreeItem>> items(
always_zoom_to_fit_ = true;
always_zoom_to_fit_changed(always_zoom_to_fit_);
}
+
+ // Enable sticky scrolling if the setting is enabled
+ sticky_scrolling_ = settings.value(GlobalSettings::Key_View_StickyScrolling).toBool();
}
if (state == Session::Stopped) {
std::pair<pv::util::Timestamp, pv::util::Timestamp> get_time_extents() const;
- /**
- * Enables or disables sticky scrolling, i.e. the view always shows
- * the most recent samples when capturing data.
- */
- void enable_sticky_scrolling(bool state);
-
/**
* Enables or disables coloured trace backgrounds. If they're not
* coloured then they will use alternating colors.