diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2022-05-08 00:48:30 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2022-05-08 00:48:30 -0700 |
| commit | 1e033a4f73e8d413cf88dc576db81e357978e32a (patch) | |
| tree | 958e7a8fccec685e27291fd3600ef55c33af960a /Source | |
| parent | 5f04ad5c3c4ae12c38a3d571cc39ceb80c09e74c (diff) | |
Qt: hide balloon tooltip when parent gets hidden
fixes balloon remaining onscreen when parent gets
hidden via escape key for example.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h index 127a708aa6..bd4b0fb6a2 100644 --- a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h +++ b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h @@ -33,15 +33,8 @@ private: m_timer_id = this->startTimer(TOOLTIP_DELAY); } - void leaveEvent(QEvent* event) override - { - if (m_timer_id) - { - this->killTimer(*m_timer_id); - m_timer_id.reset(); - } - BalloonTip::HideBalloon(); - } + void leaveEvent(QEvent* event) override { KillAndHide(); } + void hideEvent(QHideEvent* event) override { KillAndHide(); } void timerEvent(QTimerEvent* event) override { @@ -54,6 +47,16 @@ private: virtual QPoint GetToolTipPosition() const = 0; + void KillAndHide() + { + if (m_timer_id) + { + this->killTimer(*m_timer_id); + m_timer_id.reset(); + } + BalloonTip::HideBalloon(); + } + std::optional<int> m_timer_id; QString m_title; QString m_description; |
