]> sigrok.org Git - pulseview.git/commitdiff
Fix #1198 by removing the 1:1 zoom button
authorSoeren Apel <redacted>
Sat, 2 Jun 2018 21:30:57 +0000 (23:30 +0200)
committerUwe Hermann <redacted>
Sun, 3 Jun 2018 17:02:28 +0000 (19:02 +0200)
icons/zoom-original.png [deleted file]
pulseview.qrc
pv/views/trace/standardbar.cpp
pv/views/trace/standardbar.hpp
pv/views/trace/view.cpp
pv/views/trace/view.hpp

diff --git a/icons/zoom-original.png b/icons/zoom-original.png
deleted file mode 100644 (file)
index 8ae3043..0000000
Binary files a/icons/zoom-original.png and /dev/null differ
index 3ef52852611d50b1aec560b1ce184a022a1a6882..f055f0bd53e9c04706b2bfae8d25e6e50fcb8fff 100644 (file)
@@ -36,7 +36,6 @@
        <file>icons/window-new.png</file>
        <file>icons/zoom-fit-best.png</file>
        <file>icons/zoom-in.png</file>
-       <file>icons/zoom-original.png</file>
        <file>icons/zoom-out.png</file>
     </qresource>
 </RCC>
index 35b87be51b904869c7720276675477805e53a6eb..2269750600a984b2aba799cc9ca42f03015cb285 100644 (file)
@@ -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();
index 6e822229e3aebc8ab43e4d27f99444ab5318315b..9c27f43ee171a4e8b9bfde6a3393672c758876c6 100644 (file)
@@ -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);
 
index f634b4ae532966be2c08ae793bdb88df0aa3bb88..3cb26ec400be3028d005b4c3b8d3b61d1c7a2a50 100644 (file)
@@ -700,23 +700,6 @@ void View::zoom_fit(bool gui_state)
        set_scale_offset(scale.convert_to<double>(), extents.first);
 }
 
-void View::zoom_one_to_one()
-{
-       using pv::data::SignalData;
-
-       // Make a set of all the visible data objects
-       set< shared_ptr<SignalData> > 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
index 1551bc0b13a09ce8e3f5e95c412fa997bc20d228..4f364404ce01acf2c9f9b4ee18d8cfb2dc517843 100644 (file)
@@ -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.