]> sigrok.org Git - pulseview.git/commitdiff
Fix bug #235. Add shortcut keys for View/Zoom In (Ctrl++) and View/Zoom Out (Ctrl+-)
authorulflulfl <redacted>
Sat, 1 Feb 2014 18:04:47 +0000 (18:04 +0000)
committerJoel Holdsworth <redacted>
Sat, 1 Feb 2014 18:07:32 +0000 (18:07 +0000)
These are the shortcut keys for zoom in and out as suggested by
QT. Works with the normal keyboard and numpad keys.

Seems that the preferred simple + and - keys have an issue.
While the - key is working and displayed in the menu as expected,
the + key is zooming but not displayed at View/Zoom In
in the menu. I've tried several attempts.

pv/mainwindow.cpp

index 4de010af7a97282a37eeba8c18d177e7317ad838..e0ef3aa297e4f71e7f3678cc0bbd151ce27696ff 100644 (file)
@@ -159,6 +159,8 @@ void MainWindow::setup_ui()
                "MainWindow", "Zoom &In", 0, QApplication::UnicodeUTF8));
        action_view_zoom_in->setIcon(QIcon::fromTheme("zoom-in",
                QIcon(":/icons/zoom-in.png")));
+       // simply using Qt::Key_Plus shows no + in the menu
+       action_view_zoom_in->setShortcut(QKeySequence::ZoomIn);
        action_view_zoom_in->setObjectName(
                QString::fromUtf8("actionViewZoomIn"));
        menu_view->addAction(action_view_zoom_in);
@@ -168,6 +170,7 @@ void MainWindow::setup_ui()
                "MainWindow", "Zoom &Out", 0, QApplication::UnicodeUTF8));
        action_view_zoom_out->setIcon(QIcon::fromTheme("zoom-out",
                QIcon(":/icons/zoom-out.png")));
+       action_view_zoom_out->setShortcut(QKeySequence::ZoomOut);
        action_view_zoom_out->setObjectName(
                QString::fromUtf8("actionViewZoomOut"));
        menu_view->addAction(action_view_zoom_out);