mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
parent
2ccef94ea5
commit
f75b630f0c
@ -786,6 +786,33 @@ void HexdumpWidget::resizeEvent(QResizeEvent *event)
|
|||||||
QDockWidget::resizeEvent(event);
|
QDockWidget::resizeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HexdumpWidget::wheelEvent(QWheelEvent* event)
|
||||||
|
{
|
||||||
|
if( Qt::ControlModifier == event->modifiers() )
|
||||||
|
{
|
||||||
|
const QPoint numDegrees = event->angleDelta() / 8;
|
||||||
|
if(!numDegrees.isNull())
|
||||||
|
{
|
||||||
|
const QPoint numSteps = numDegrees / 15;
|
||||||
|
if( 0 != numSteps.y() )
|
||||||
|
{
|
||||||
|
if(numSteps.y() > 0)
|
||||||
|
{
|
||||||
|
zoomIn(1);
|
||||||
|
}
|
||||||
|
else if( numSteps.y() < 0 )
|
||||||
|
{
|
||||||
|
zoomOut(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
event->accept();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event->ignore();
|
||||||
|
}
|
||||||
|
|
||||||
void HexdumpWidget::on_copyMD5_clicked()
|
void HexdumpWidget::on_copyMD5_clicked()
|
||||||
{
|
{
|
||||||
QString md5 = ui->bytesMD5->text();
|
QString md5 = ui->bytesMD5->text();
|
||||||
@ -836,3 +863,19 @@ void HexdumpWidget::showOffsets(bool show)
|
|||||||
core->setConfig("asm.offset", 0);
|
core->setConfig("asm.offset", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HexdumpWidget::zoomIn(int range)
|
||||||
|
{
|
||||||
|
hexOffsetText->zoomIn(range);
|
||||||
|
hexASCIIText->zoomIn(range);
|
||||||
|
hexHexText->zoomIn(range);
|
||||||
|
resizeHexdump();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HexdumpWidget::zoomOut(int range)
|
||||||
|
{
|
||||||
|
hexOffsetText->zoomOut(range);
|
||||||
|
hexASCIIText->zoomOut(range);
|
||||||
|
hexHexText->zoomOut(range);
|
||||||
|
resizeHexdump();
|
||||||
|
}
|
||||||
|
@ -55,8 +55,12 @@ public slots:
|
|||||||
|
|
||||||
void showOffsets(bool show);
|
void showOffsets(bool show);
|
||||||
|
|
||||||
|
void zoomIn(int range = 1);
|
||||||
|
void zoomOut(int range = 1);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
virtual void resizeEvent(QResizeEvent *event) override;
|
||||||
|
virtual void wheelEvent(QWheelEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::HexdumpWidget> ui;
|
std::unique_ptr<Ui::HexdumpWidget> ui;
|
||||||
|
Loading…
Reference in New Issue
Block a user