mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Qt: hide balloon tooltip when parent gets hidden
fixes balloon remaining onscreen when parent gets hidden via escape key for example.
This commit is contained in:
parent
5f04ad5c3c
commit
1e033a4f73
@ -33,15 +33,8 @@ private:
|
|||||||
m_timer_id = this->startTimer(TOOLTIP_DELAY);
|
m_timer_id = this->startTimer(TOOLTIP_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void leaveEvent(QEvent* event) override
|
void leaveEvent(QEvent* event) override { KillAndHide(); }
|
||||||
{
|
void hideEvent(QHideEvent* event) override { KillAndHide(); }
|
||||||
if (m_timer_id)
|
|
||||||
{
|
|
||||||
this->killTimer(*m_timer_id);
|
|
||||||
m_timer_id.reset();
|
|
||||||
}
|
|
||||||
BalloonTip::HideBalloon();
|
|
||||||
}
|
|
||||||
|
|
||||||
void timerEvent(QTimerEvent* event) override
|
void timerEvent(QTimerEvent* event) override
|
||||||
{
|
{
|
||||||
@ -54,6 +47,16 @@ private:
|
|||||||
|
|
||||||
virtual QPoint GetToolTipPosition() const = 0;
|
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;
|
std::optional<int> m_timer_id;
|
||||||
QString m_title;
|
QString m_title;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user