From: ulflulfl Date: Sat, 1 Feb 2014 18:04:47 +0000 (+0000) Subject: Fix bug #235. Add shortcut keys for View/Zoom In (Ctrl++) and View/Zoom Out (Ctrl+-) X-Git-Tag: pulseview-0.2.0~94 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d2899ad580eea569f3b167e8c9ebcb913194c6b6;p=pulseview.git Fix bug #235. Add shortcut keys for View/Zoom In (Ctrl++) and View/Zoom Out (Ctrl+-) 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. --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 4de010af..e0ef3aa2 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -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);