Changed SideTab check in AutoHideDockContainer::eventFilter to improve performance a little bit

This commit is contained in:
Uwe Kindler 2022-11-23 08:43:45 +01:00
parent 47e4a6065a
commit 60d915a99f

View File

@ -549,6 +549,15 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
return Super::eventFilter(watched, event); return Super::eventFilter(watched, event);
} }
// Now check, if the user clicked into the side tab and ignore this event,
// because the side tab click handler will call collapseView(). If we
// do not ignore this here, then we will collapse the container and the side tab
// click handler will uncollapse it
if (widget == d->SideTab.data())
{
return Super::eventFilter(watched, event);
}
// Now we check, if the user clicked inside of this auto hide container. // Now we check, if the user clicked inside of this auto hide container.
// If the click is inside of this auto hide container, then we can // If the click is inside of this auto hide container, then we can
// ignore the event, because the auto hide overlay should not get collapsed if // ignore the event, because the auto hide overlay should not get collapsed if
@ -558,15 +567,6 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
return Super::eventFilter(watched, event); return Super::eventFilter(watched, event);
} }
// Now check, if the user clicked into the side tab and ignore this event,
// because the side tab click handler will call collapseView(). If we
// do not ignore this here, then we will collapse the container and the side tab
// click handler will uncollapse it
if (isObjectOrAncestor(widget, d->SideTab.data()))
{
return Super::eventFilter(watched, event);
}
// Ignore the mouse click if it is not inside of this container // Ignore the mouse click if it is not inside of this container
if (!isObjectOrAncestor(widget, dockContainer())) if (!isObjectOrAncestor(widget, dockContainer()))
{ {