From: Soeren Apel Date: Sat, 2 Jun 2018 21:30:57 +0000 (+0200) Subject: Fix #1198 by removing the 1:1 zoom button X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ff046cb6c42a2382ee281e83955b7ae44030b42e;p=pulseview.git Fix #1198 by removing the 1:1 zoom button --- diff --git a/icons/zoom-original.png b/icons/zoom-original.png deleted file mode 100644 index 8ae30433..00000000 Binary files a/icons/zoom-original.png and /dev/null differ diff --git a/pulseview.qrc b/pulseview.qrc index 3ef52852..f055f0bd 100644 --- a/pulseview.qrc +++ b/pulseview.qrc @@ -36,7 +36,6 @@ icons/window-new.png icons/zoom-fit-best.png icons/zoom-in.png - icons/zoom-original.png icons/zoom-out.png diff --git a/pv/views/trace/standardbar.cpp b/pv/views/trace/standardbar.cpp index 35b87be5..22697506 100644 --- a/pv/views/trace/standardbar.cpp +++ b/pv/views/trace/standardbar.cpp @@ -41,7 +41,6 @@ StandardBar::StandardBar(Session &session, QWidget *parent, action_view_zoom_in_(new QAction(this)), action_view_zoom_out_(new QAction(this)), action_view_zoom_fit_(new QAction(this)), - action_view_zoom_one_to_one_(new QAction(this)), action_view_show_cursors_(new QAction(this)), segment_display_mode_selector_(new QToolButton(this)), action_sdm_last_(new QAction(this)), @@ -75,13 +74,6 @@ StandardBar::StandardBar(Session &session, QWidget *parent, connect(action_view_zoom_fit_, SIGNAL(triggered(bool)), this, SLOT(on_actionViewZoomFit_triggered(bool))); - action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One")); - action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original", - QIcon(":/icons/zoom-original.png"))); - action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O)); - connect(action_view_zoom_one_to_one_, SIGNAL(triggered(bool)), - this, SLOT(on_actionViewZoomOneToOne_triggered())); - action_view_show_cursors_->setCheckable(true); action_view_show_cursors_->setIcon(QIcon(":/icons/show-cursors.svg")); action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C)); @@ -151,7 +143,6 @@ void StandardBar::add_toolbar_widgets() addAction(action_view_zoom_in_); addAction(action_view_zoom_out_); addAction(action_view_zoom_fit_); - addAction(action_view_zoom_one_to_one_); addSeparator(); addAction(action_view_show_cursors_); multi_segment_actions_.push_back(addSeparator()); @@ -187,11 +178,6 @@ QAction* StandardBar::action_view_zoom_fit() const return action_view_zoom_fit_; } -QAction* StandardBar::action_view_zoom_one_to_one() const -{ - return action_view_zoom_one_to_one_; -} - QAction* StandardBar::action_view_show_cursors() const { return action_view_show_cursors_; @@ -212,11 +198,6 @@ void StandardBar::on_actionViewZoomFit_triggered(bool checked) view_->zoom_fit(checked); } -void StandardBar::on_actionViewZoomOneToOne_triggered() -{ - view_->zoom_one_to_one(); -} - void StandardBar::on_actionViewShowCursors_triggered() { const bool show = action_view_show_cursors_->isChecked(); diff --git a/pv/views/trace/standardbar.hpp b/pv/views/trace/standardbar.hpp index 6e822229..9c27f43e 100644 --- a/pv/views/trace/standardbar.hpp +++ b/pv/views/trace/standardbar.hpp @@ -59,7 +59,6 @@ public: QAction* action_view_zoom_in() const; QAction* action_view_zoom_out() const; QAction* action_view_zoom_fit() const; - QAction* action_view_zoom_one_to_one() const; QAction* action_view_show_cursors() const; protected: @@ -73,7 +72,6 @@ protected: QAction *const action_view_zoom_in_; QAction *const action_view_zoom_out_; QAction *const action_view_zoom_fit_; - QAction *const action_view_zoom_one_to_one_; QAction *const action_view_show_cursors_; QToolButton *segment_display_mode_selector_; @@ -93,8 +91,6 @@ protected Q_SLOTS: void on_actionViewZoomFit_triggered(bool checked); - void on_actionViewZoomOneToOne_triggered(); - void on_actionViewShowCursors_triggered(); void on_cursor_state_changed(bool show); diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index f634b4ae..3cb26ec4 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -700,23 +700,6 @@ void View::zoom_fit(bool gui_state) set_scale_offset(scale.convert_to(), extents.first); } -void View::zoom_one_to_one() -{ - using pv::data::SignalData; - - // Make a set of all the visible data objects - set< shared_ptr > visible_data = get_visible_data(); - if (visible_data.empty()) - return; - - assert(viewport_); - const int w = viewport_->width(); - if (w <= 0) - return; - - set_zoom(1.0 / session_.get_samplerate(), w / 2); -} - void View::set_scale_offset(double scale, const Timestamp& offset) { // Disable sticky scrolling / always zoom to fit when acquisition runs diff --git a/pv/views/trace/view.hpp b/pv/views/trace/view.hpp index 1551bc0b..4f364404 100644 --- a/pv/views/trace/view.hpp +++ b/pv/views/trace/view.hpp @@ -234,8 +234,6 @@ public: void zoom_fit(bool gui_state); - void zoom_one_to_one(); - /** * Sets the scale and offset. * @param scale The new view scale in seconds per pixel.