1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[TabPreviews] Only hide preview on LeaveEvent when cursor is outside tabbar.

For some reason, tabbar receives first leave event (after first preview
is shown) even when cursor is inside tabbar rect, which leads to this
first tab preview being shown -> hidden and then again shown.
This commit is contained in:
nowrep 2013-12-28 17:25:41 +01:00
parent 1b3c9e38ea
commit e78e0fe498

View File

@ -494,7 +494,7 @@ void TabBar::showTabPreview(bool delayed)
{ {
if (delayed) { if (delayed) {
int index = tabAt(mapFromGlobal(QCursor::pos())); int index = tabAt(mapFromGlobal(QCursor::pos()));
if (index == -1 || QApplication::mouseButtons()) { if (index == -1 || QApplication::mouseButtons() != Qt::NoButton) {
return; return;
} }
@ -653,7 +653,9 @@ bool TabBar::event(QEvent* event)
{ {
switch (event->type()) { switch (event->type()) {
case QEvent::Leave: case QEvent::Leave:
hideTabPreview(); if (!rect().contains(mapFromGlobal(QCursor::pos()))) {
hideTabPreview();
}
break; break;
case QEvent::Wheel: case QEvent::Wheel: