mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Fixed zoom shortcuts to something more generic (#1781)
This commit is contained in:
parent
23561f4337
commit
a15d104b45
@ -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
|
||||
--------------------
|
||||
|
@ -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()));
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user