fix: hide tooltip on window leave event (#5309)
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Unversioned
|
## Unversioned
|
||||||
|
|
||||||
|
- Bugfix: Fixed split tooltip getting stuck in some cases. (#5309)
|
||||||
|
|
||||||
## 2.5.0-beta.1
|
## 2.5.0-beta.1
|
||||||
|
|
||||||
- Major: Twitch follower emotes can now be correctly tabbed in other channels when you are subscribed to the channel the emote is from. (#4922)
|
- Major: Twitch follower emotes can now be correctly tabbed in other channels when you are subscribed to the channel the emote is from. (#4922)
|
||||||
|
|||||||
@@ -527,6 +527,7 @@ void BaseWindow::changeEvent(QEvent *)
|
|||||||
|
|
||||||
void BaseWindow::leaveEvent(QEvent *)
|
void BaseWindow::leaveEvent(QEvent *)
|
||||||
{
|
{
|
||||||
|
this->leaving.invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseWindow::moveTo(QPoint point, widgets::BoundsChecking mode)
|
void BaseWindow::moveTo(QPoint point, widgets::BoundsChecking mode)
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public:
|
|||||||
void setTopMost(bool topMost);
|
void setTopMost(bool topMost);
|
||||||
|
|
||||||
pajlada::Signals::NoArgSignal closing;
|
pajlada::Signals::NoArgSignal closing;
|
||||||
|
pajlada::Signals::NoArgSignal leaving;
|
||||||
|
|
||||||
static bool supportsCustomWindowFrame();
|
static bool supportsCustomWindowFrame();
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,20 @@ SplitHeader::SplitHeader(Split *split)
|
|||||||
getSettings()->headerStreamTitle.connect(_, this->managedConnections_);
|
getSettings()->headerStreamTitle.connect(_, this->managedConnections_);
|
||||||
getSettings()->headerGame.connect(_, this->managedConnections_);
|
getSettings()->headerGame.connect(_, this->managedConnections_);
|
||||||
getSettings()->headerUptime.connect(_, this->managedConnections_);
|
getSettings()->headerUptime.connect(_, this->managedConnections_);
|
||||||
|
|
||||||
|
auto *window = dynamic_cast<BaseWindow *>(this->window());
|
||||||
|
if (window)
|
||||||
|
{
|
||||||
|
// Hack: In some cases Qt doesn't send the leaveEvent the "actual" last mouse receiver.
|
||||||
|
// This can happen when quickly moving the mouse out of the window and right clicking.
|
||||||
|
// To prevent the tooltip from getting stuck, we use the window's leaveEvent.
|
||||||
|
this->managedConnections_.managedConnect(window->leaving, [this] {
|
||||||
|
if (this->tooltipWidget_->isVisible())
|
||||||
|
{
|
||||||
|
this->tooltipWidget_->hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SplitHeader::initializeLayout()
|
void SplitHeader::initializeLayout()
|
||||||
|
|||||||
Reference in New Issue
Block a user