X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdialogs%2Fsettings.cpp;h=37b591b6d786dba5fdbf6b869ae1469db19a4e36;hp=deeb71f1b87b9296705e1358721df434e8fb6d27;hb=2b0aa8fd5a90220a5965a57fa3df793940df4955;hpb=4e4d72b22a81d1f2d8daee1093ac45264a0a1e2d diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index deeb71f1..37b591b6 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -88,7 +88,7 @@ void Settings::create_pages() pages->addWidget(get_view_settings_form(pages)); QListWidgetItem *viewButton = new QListWidgetItem(page_list); - viewButton->setIcon(QIcon(":/icons/sigrok-logo-notext.svg")); + viewButton->setIcon(QIcon(":/icons/settings-views.svg")); viewButton->setText(tr("Views")); viewButton->setTextAlignment(Qt::AlignHCenter); viewButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); @@ -120,12 +120,17 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const QCheckBox *coloured_bg_cb = new QCheckBox(); coloured_bg_cb->setChecked(settings.value(GlobalSettings::Key_View_ColouredBG).toBool()); connect(coloured_bg_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_colouredBG_changed(int))); - trace_view_layout->addRow(tr("Use &coloured trace background"), coloured_bg_cb); + trace_view_layout->addRow(tr("Use coloured trace &background"), coloured_bg_cb); QCheckBox *always_zoom_to_fit_cb = new QCheckBox(); always_zoom_to_fit_cb->setChecked(settings.value(GlobalSettings::Key_View_AlwaysZoomToFit).toBool()); connect(always_zoom_to_fit_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_alwaysZoomToFit_changed(int))); - trace_view_layout->addRow(tr("Always zoom-to-&fit during capture"), always_zoom_to_fit_cb); + trace_view_layout->addRow(tr("Constantly perform &zoom-to-fit during capture"), always_zoom_to_fit_cb); + + QCheckBox *sticky_scrolling_cb = new QCheckBox(); + sticky_scrolling_cb->setChecked(settings.value(GlobalSettings::Key_View_StickyScrolling).toBool()); + connect(sticky_scrolling_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_stickyScrolling_changed(int))); + trace_view_layout->addRow(tr("Always keep &newest samples at the right edge during capture"), sticky_scrolling_cb); return form; } @@ -248,5 +253,12 @@ void Settings::on_view_colouredBG_changed(int state) settings.setValue(GlobalSettings::Key_View_ColouredBG, state ? true : false); } +void Settings::on_view_stickyScrolling_changed(int state) +{ + GlobalSettings settings; + settings.setValue(GlobalSettings::Key_View_StickyScrolling, state ? true : false); +} + + } // namespace dialogs } // namespace pv