mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-21 04:16:12 +00:00
Added graph zoom reset
This commit is contained in:
parent
86d467daf9
commit
dcf0996293
@ -42,14 +42,18 @@ DisassemblerGraphView::DisassemblerGraphView(QWidget *parent)
|
||||
shortcut_escape->setContext(Qt::WidgetShortcut);
|
||||
connect(shortcut_escape, SIGNAL(activated()), this, SLOT(seekPrev()));
|
||||
|
||||
// Zoom shortcuts
|
||||
QShortcut *shortcut_zoom_in = new QShortcut(QKeySequence(Qt::Key_Plus), this);
|
||||
shortcut_zoom_in->setContext(Qt::WidgetShortcut);
|
||||
connect(shortcut_zoom_in, SIGNAL(activated()), this, SLOT(zoomIn()));
|
||||
|
||||
QShortcut *shortcut_zoom_out = new QShortcut(QKeySequence(Qt::Key_Minus), this);
|
||||
shortcut_zoom_in->setContext(Qt::WidgetShortcut);
|
||||
shortcut_zoom_out->setContext(Qt::WidgetShortcut);
|
||||
connect(shortcut_zoom_out, SIGNAL(activated()), this, SLOT(zoomOut()));
|
||||
QShortcut *shortcut_zoom_reset = new QShortcut(QKeySequence(Qt::Key_Equal), this);
|
||||
shortcut_zoom_reset->setContext(Qt::WidgetShortcut);
|
||||
connect(shortcut_zoom_reset, SIGNAL(activated()), this, SLOT(zoomReset()));
|
||||
|
||||
// Branch shortcuts
|
||||
QShortcut *shortcut_take_true = new QShortcut(QKeySequence(Qt::Key_T), this);
|
||||
shortcut_take_true->setContext(Qt::WidgetShortcut);
|
||||
connect(shortcut_take_true, SIGNAL(activated()), this, SLOT(takeTrue()));
|
||||
@ -450,6 +454,14 @@ void DisassemblerGraphView::zoomOut()
|
||||
this->viewport()->update();
|
||||
}
|
||||
|
||||
void DisassemblerGraphView::zoomReset()
|
||||
{
|
||||
current_scale = 1.0;
|
||||
auto areaSize = this->viewport()->size();
|
||||
this->adjustSize(areaSize.width(), areaSize.height());
|
||||
this->viewport()->update();
|
||||
}
|
||||
|
||||
void DisassemblerGraphView::takeTrue()
|
||||
{
|
||||
DisassemblyBlock *db = blockForAddress(Core()->getOffset());
|
||||
|
@ -153,6 +153,7 @@ public slots:
|
||||
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
void zoomReset();
|
||||
|
||||
void takeTrue();
|
||||
void takeFalse();
|
||||
|
Loading…
Reference in New Issue
Block a user