Updated DisasWidget zoom shortcuts

Now the shortcuts are consistent with the GraphView widget.
This commit is contained in:
xarkes 2019-07-16 18:39:51 +02:00
parent 7974b18ff9
commit f830fc17fb
3 changed files with 17 additions and 5 deletions

View File

@ -51,6 +51,12 @@ Disassembly view shortcuts
+------------+----------------------------------+ +------------+----------------------------------+
| X | Show Xrefs | | X | Show Xrefs |
+------------+----------------------------------+ +------------+----------------------------------+
| \+ | Zoom in |
+------------+----------------------------------+
| \- | Zoom out |
+------------+----------------------------------+
| = | Reset zoom |
+------------+----------------------------------+
Graph view shortcuts Graph view shortcuts
-------------------- --------------------

View File

@ -218,11 +218,10 @@ DisassemblyWidget::DisassemblyWidget(MainWindow *main, QAction *action)
moveCursorRelative(true, true); moveCursorRelative(true, true);
}) })
// Plus sign in num-bar considered "Qt::Key_Equal" // Zoom shortcuts
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Equal), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomIn) ADD_ACTION(QKeySequence(Qt::Key_Plus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomIn)
// Plus sign in numpad ADD_ACTION(QKeySequence(Qt::Key_Minus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomOut)
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Plus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomIn) ADD_ACTION(QKeySequence(Qt::Key_Equal), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomReset)
ADD_ACTION(QKeySequence(Qt::CTRL + Qt::Key_Minus), Qt::WidgetWithChildrenShortcut, &DisassemblyWidget::zoomOut)
#undef ADD_ACTION #undef ADD_ACTION
} }
@ -397,6 +396,12 @@ void DisassemblyWidget::zoomOut()
updateMaxLines(); updateMaxLines();
} }
void DisassemblyWidget::zoomReset()
{
setupFonts();
updateMaxLines();
}
void DisassemblyWidget::highlightCurrentLine() void DisassemblyWidget::highlightCurrentLine()
{ {
QList<QTextEdit::ExtraSelection> extraSelections; QList<QTextEdit::ExtraSelection> extraSelections;

View File

@ -48,6 +48,7 @@ protected slots:
void zoomIn(); void zoomIn();
void zoomOut(); void zoomOut();
void zoomReset();
protected: protected:
DisassemblyContextMenu *mCtxMenu; DisassemblyContextMenu *mCtxMenu;