Add menu option for coloured/alternating trace background colors
authorSoeren Apel <soeren@apelpie.net>
Mon, 28 Dec 2015 15:15:29 +0000 (16:15 +0100)
committerSoeren Apel <soeren@apelpie.net>
Mon, 28 Dec 2015 15:15:29 +0000 (16:15 +0100)
pv/mainwindow.cpp
pv/mainwindow.hpp

index 4088c26d1c86b430f3f811df8269c07b6be65616..272dac234374c9f4e69e825100520e81010644d4 100644 (file)
@@ -110,6 +110,7 @@ MainWindow::MainWindow(DeviceManager &device_manager,
        action_view_zoom_fit_(new QAction(this)),
        action_view_zoom_one_to_one_(new QAction(this)),
        action_view_sticky_scrolling_(new QAction(this)),
+       action_view_coloured_bg_(new QAction(this)),
        action_view_show_cursors_(new QAction(this)),
        action_about_(new QAction(this))
 #ifdef ENABLE_DECODE
@@ -473,6 +474,16 @@ void MainWindow::setup_ui()
 
        menu_view->addSeparator();
 
+       action_view_coloured_bg_->setCheckable(true);
+       action_view_coloured_bg_->setChecked(true);
+       action_view_coloured_bg_->setShortcut(QKeySequence(Qt::Key_S));
+       action_view_coloured_bg_->setObjectName(
+               QString::fromUtf8("actionViewColouredBg"));
+       action_view_coloured_bg_->setText(tr("Use &coloured backgrounds"));
+       menu_view->addAction(action_view_coloured_bg_);
+
+       menu_view->addSeparator();
+
        action_view_show_cursors_->setCheckable(true);
        action_view_show_cursors_->setChecked(view_->cursors_shown());
        action_view_show_cursors_->setIcon(QIcon::fromTheme("show-cursors",
@@ -794,6 +805,10 @@ void MainWindow::on_actionViewStickyScrolling_triggered()
        view_->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
 }
 
+void MainWindow::on_actionViewColouredBg_triggered()
+{
+}
+
 void MainWindow::on_actionViewShowCursors_triggered()
 {
        assert(view_);
index bf0aa125b090ebe43ebd5951ad4f03b334cce884..208cbe4367e163062b59fb8fc05e6e3695da219a 100644 (file)
@@ -92,6 +92,7 @@ public:
        QAction* action_view_zoom_fit() const;
        QAction* action_view_zoom_one_to_one() const;
        QAction* action_view_sticky_scrolling() const;
+       QAction* action_view_coloured_bg() const;
        QAction* action_view_show_cursors() const;
        QAction* action_about() const;
 
@@ -160,6 +161,8 @@ private Q_SLOTS:
 
        void on_actionViewStickyScrolling_triggered();
 
+       void on_actionViewColouredBg_triggered();
+
        void on_actionViewShowCursors_triggered();
 
        void on_actionAbout_triggered();
@@ -195,6 +198,7 @@ private:
        QAction *const action_view_zoom_fit_;
        QAction *const action_view_zoom_one_to_one_;
        QAction *const action_view_sticky_scrolling_;
+       QAction *const action_view_coloured_bg_;
        QAction *const action_view_show_cursors_;
        QAction *const action_about_;