X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=d7b1aa4411597145fb2c0cb794bb37a5d151297b;hb=0518e9c9d1c59080eb167e7b13bd498a90ac1b0f;hp=6d28194bb87cbed491e00a3aa2bc21436e8976b3;hpb=c7b03d9daa9574bd633fbac2d5976716f58027f5;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 6d28194b..d7b1aa44 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -401,6 +401,7 @@ void MainWindow::setup_ui() QString::fromUtf8("actionViewZoomOut")); menu_view->addAction(action_view_zoom_out_); + action_view_zoom_fit_->setCheckable(true); action_view_zoom_fit_->setText(tr("Zoom to &Fit")); action_view_zoom_fit_->setIcon(QIcon::fromTheme("zoom-fit", QIcon(":/icons/zoom-fit.png"))); @@ -421,10 +422,10 @@ void MainWindow::setup_ui() action_view_sticky_scrolling_->setCheckable(true); action_view_sticky_scrolling_->setChecked(true); - action_view_sticky_scrolling_->setShortcut(QKeySequence(Qt::Key_R)); + action_view_sticky_scrolling_->setShortcut(QKeySequence(Qt::Key_S)); action_view_sticky_scrolling_->setObjectName( QString::fromUtf8("actionViewStickyScrolling")); - action_view_sticky_scrolling_->setText(tr("Sticky Sc&rolling")); + action_view_sticky_scrolling_->setText(tr("&Sticky Scrolling")); menu_view->addAction(action_view_sticky_scrolling_); view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked()); @@ -495,7 +496,8 @@ void MainWindow::setup_ui() // Setup view_ events connect(view_, SIGNAL(sticky_scrolling_changed(bool)), this, SLOT(sticky_scrolling_changed(bool))); - + connect(view_, SIGNAL(always_zoom_to_fit_changed(bool)), this, + SLOT(always_zoom_to_fit_changed(bool))); } void MainWindow::select_init_device() { @@ -730,7 +732,7 @@ void MainWindow::on_actionViewZoomOut_triggered() void MainWindow::on_actionViewZoomFit_triggered() { - view_->zoom_fit(); + view_->zoom_fit(action_view_zoom_fit_->isChecked()); } void MainWindow::on_actionViewZoomOneToOne_triggered() @@ -748,7 +750,7 @@ void MainWindow::on_actionViewShowCursors_triggered() assert(view_); const bool show = !view_->cursors_shown(); - if(show) + if (show) view_->centre_cursors(); view_->show_cursors(show); @@ -765,6 +767,11 @@ void MainWindow::sticky_scrolling_changed(bool state) action_view_sticky_scrolling_->setChecked(state); } +void MainWindow::always_zoom_to_fit_changed(bool state) +{ + action_view_zoom_fit_->setChecked(state); +} + void MainWindow::add_decoder(srd_decoder *decoder) { #ifdef ENABLE_DECODE