diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 9cc3f858..4098f339 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -169,6 +169,8 @@ DisassemblyWidget::DisassemblyWidget(MainWindow *main, QAction *action) ADD_SHORTCUT(QKeySequence::MoveToPreviousPage, [this]() { moveCursorRelative(true, true); }) + ADD_SHORTCUT(QKeySequence(Qt::CTRL + Qt::Key_Plus), &DisassemblyWidget::zoomIn) + ADD_SHORTCUT(QKeySequence(Qt::CTRL + Qt::Key_Minus), &DisassemblyWidget::zoomOut) #undef ADD_SHORTCUT } @@ -293,6 +295,16 @@ bool DisassemblyWidget::updateMaxLines() return false; } +void DisassemblyWidget::zoomIn() { + mDisasTextEdit->zoomIn(); + updateMaxLines(); +} + +void DisassemblyWidget::zoomOut() { + mDisasTextEdit->zoomOut(); + updateMaxLines(); +} + void DisassemblyWidget::highlightCurrentLine() { QList extraSelections; diff --git a/src/widgets/DisassemblyWidget.h b/src/widgets/DisassemblyWidget.h index 9b7a45a2..d574dc67 100644 --- a/src/widgets/DisassemblyWidget.h +++ b/src/widgets/DisassemblyWidget.h @@ -39,6 +39,9 @@ private slots: void cursorPositionChanged(); + void zoomIn(); + void zoomOut(); + private: DisassemblyContextMenu *mCtxMenu; DisassemblyScrollArea *mDisasScrollArea;