Fixed zoom shortcuts to something more generic (#1781)

This commit is contained in:
xarkes 2019-09-27 18:16:05 +02:00 committed by Itay Cohen
parent 23561f4337
commit a15d104b45
3 changed files with 43 additions and 43 deletions

View File

@ -35,43 +35,43 @@ Disassembly view shortcuts
--------------------------
*Most of these shortcuts are also applied to Disassembly Graph view*
+------------+----------------------------------+
| Shortcut | Function |
+============+==================================+
| Esc | Seek to previous position |
+------------+----------------------------------+
| Space | Switch to disassembly graph view |
+------------+----------------------------------+
| Ctrl/Cmd+C | Copy |
+------------+----------------------------------+
| ; | Add comment |
+------------+----------------------------------+
| P | Define a new function |
+------------+----------------------------------+
| Shift+P | Edit function |
+------------+----------------------------------+
| U | Undefine a function |
+------------+----------------------------------+
| N | Rename current function/flag |
+------------+----------------------------------+
| Shift+N | Rename flag/function used here |
+------------+----------------------------------+
| Y | Edit\rename local variables |
+------------+----------------------------------+
| L | Link a type\struct to address |
+------------+----------------------------------+
| A | Set current address to String |
+------------+----------------------------------+
| C | Set current address to Code |
+------------+----------------------------------+
| X | Show Xrefs |
+------------+----------------------------------+
| \+ | Zoom in |
+------------+----------------------------------+
| \- | Zoom out |
+------------+----------------------------------+
| = | Reset zoom |
+------------+----------------------------------+
+-------------+----------------------------------+
| Shortcut | Function |
+=============+==================================+
| Esc | Seek to previous position |
+-------------+----------------------------------+
| Space | Switch to disassembly graph view |
+-------------+----------------------------------+
| Ctrl/Cmd+C | Copy |
+-------------+----------------------------------+
| ; | Add comment |
+-------------+----------------------------------+
| P | Define a new function |
+-------------+----------------------------------+
| Shift+P | Edit function |
+-------------+----------------------------------+
| U | Undefine a function |
+-------------+----------------------------------+
| N | Rename current function/flag |
+-------------+----------------------------------+
| Shift+N | Rename flag/function used here |
+-------------+----------------------------------+
| Y | Edit\rename local variables |
+-------------+----------------------------------+
| L | Link a type\struct to address |
+-------------+----------------------------------+
| A | Set current address to String |
+-------------+----------------------------------+
| C | Set current address to Code |
+-------------+----------------------------------+
| X | Show Xrefs |
+-------------+----------------------------------+
| Ctrl/Cmd+\+ | Zoom in |
+-------------+----------------------------------+
| Ctrl/Cmd+\- | Zoom out |
+-------------+----------------------------------+
| Ctrl/Cmd+= | Reset zoom |
+-------------+----------------------------------+
Graph view shortcuts
--------------------

View File

@ -63,15 +63,15 @@ DisassemblerGraphView::DisassemblerGraphView(QWidget *parent, CutterSeekable *se
connect(shortcut_escape, SIGNAL(activated()), seekable, SLOT(seekPrev()));
// Zoom shortcuts
QShortcut *shortcut_zoom_in = new QShortcut(QKeySequence(Qt::Key_Plus), this);
QShortcut *shortcut_zoom_in = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Plus), this);
shortcut_zoom_in->setContext(Qt::WidgetShortcut);
connect(shortcut_zoom_in, &QShortcut::activated, this, std::bind(&DisassemblerGraphView::zoom, this,
QPointF(0.5, 0.5), 1));
QShortcut *shortcut_zoom_out = new QShortcut(QKeySequence(Qt::Key_Minus), this);
QShortcut *shortcut_zoom_out = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Minus), this);
shortcut_zoom_out->setContext(Qt::WidgetShortcut);
connect(shortcut_zoom_out, &QShortcut::activated, this, std::bind(&DisassemblerGraphView::zoom,
this, QPointF(0.5, 0.5), -1));
QShortcut *shortcut_zoom_reset = new QShortcut(QKeySequence(Qt::Key_Equal), this);
QShortcut *shortcut_zoom_reset = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Equal), this);
shortcut_zoom_reset->setContext(Qt::WidgetShortcut);
connect(shortcut_zoom_reset, SIGNAL(activated()), this, SLOT(zoomReset()));

View File

@ -210,9 +210,9 @@ DisassemblyWidget::DisassemblyWidget(MainWindow *main, QAction *action)
})
// Zoom shortcuts
ADD_ACTION(QKeySequence(Qt::Key_Plus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomIn)
ADD_ACTION(QKeySequence(Qt::Key_Minus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomOut)
ADD_ACTION(QKeySequence(Qt::Key_Equal), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomReset)
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Plus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomIn)
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Minus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomOut)
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Equal), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomReset)
#undef ADD_ACTION
}