summaryrefslogtreecommitdiff
path: root/ui/clickablelabel.h
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2022-03-26 15:36:10 -0400
committerBrian Potchik <brian@vector35.com>2022-03-26 15:36:10 -0400
commitd1c014519f25521b583f9098a521d8058898aba2 (patch)
tree5a7fe80e685c469a944ff36e32bc76a4a0cda715 /ui/clickablelabel.h
parent6a7313e8baea90d7603a51c6defea14f78a558d9 (diff)
Fix context menu in SettingsView.
Diffstat (limited to 'ui/clickablelabel.h')
-rw-r--r--ui/clickablelabel.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/clickablelabel.h b/ui/clickablelabel.h
index a1116f0b..6b7d8744 100644
--- a/ui/clickablelabel.h
+++ b/ui/clickablelabel.h
@@ -22,14 +22,20 @@ class BINARYNINJAUIAPI ClickableLabel : public QLabel
{
Q_OBJECT
+ bool m_passThroughMousePressEvent = false;
+
public:
ClickableLabel(QWidget* parent = nullptr, const QString& name = "") : QLabel(parent) { setText(name); }
+ // FIXME: The new UI header in the pane system has some keyboard focus issues; so consuming mousePressEvent seems to resolve them
+ // Since I can't repro the exact issues this allows the mouse event to pass through when needed.
+ void passThroughMousePressEvent(bool enable) { m_passThroughMousePressEvent = enable; }
+
Q_SIGNALS:
void clicked();
protected:
- void mousePressEvent(QMouseEvent*) override {}
+ void mousePressEvent(QMouseEvent* event) override { if (m_passThroughMousePressEvent) { QLabel::mousePressEvent(event); } }
void mouseReleaseEvent(QMouseEvent* event) override
{
if (event->button() == Qt::LeftButton)