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