Clear highlighted bytes on ESC press, in snpashot diff window
This commit is contained in:
@@ -138,6 +138,17 @@ namespace Widgets
|
|||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SnapshotDiff::keyPressEvent(QKeyEvent* keyEvent) {
|
||||||
|
const auto key = keyEvent->key();
|
||||||
|
|
||||||
|
if (key == Qt::Key_Escape) {
|
||||||
|
this->hexViewerWidgetA->clearHighlighting();
|
||||||
|
this->hexViewerWidgetB->clearHighlighting();
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget::keyPressEvent(keyEvent);
|
||||||
|
}
|
||||||
|
|
||||||
void SnapshotDiff::init() {
|
void SnapshotDiff::init() {
|
||||||
this->setWindowFlag(Qt::Window);
|
this->setWindowFlag(Qt::Window);
|
||||||
this->setObjectName("snapshot-diff");
|
this->setObjectName("snapshot-diff");
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QShowEvent>
|
#include <QShowEvent>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@@ -55,6 +56,7 @@ namespace Widgets
|
|||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent* event) override;
|
void showEvent(QShowEvent* event) override;
|
||||||
void resizeEvent(QResizeEvent* event) override;
|
void resizeEvent(QResizeEvent* event) override;
|
||||||
|
void keyPressEvent(QKeyEvent* keyEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SnapshotDiffSettings settings;
|
SnapshotDiffSettings settings;
|
||||||
|
|||||||
Reference in New Issue
Block a user