Properly consider pinnable flag of dock widget when painting the drop overlays - no auto hide overlay for non pinnable dock widgets

This commit is contained in:
Uwe Kindler
2023-07-11 10:28:17 +02:00
parent 364ee33f9c
commit 39bc7f1780
3 changed files with 49 additions and 17 deletions

View File

@@ -472,19 +472,23 @@ DockWidgetArea CDockOverlay::dropAreaUnderCursor() const
{
auto Rect = rect();
const QPoint pos = mapFromGlobal(QCursor::pos());
if (pos.x() < d->sideBarMouseZone(SideBarLeft))
if ((pos.x() < d->sideBarMouseZone(SideBarLeft))
&& d->AllowedAreas.testFlag(LeftAutoHideArea))
{
return LeftAutoHideArea;
}
else if (pos.x() > (Rect.width() - d->sideBarMouseZone(SideBarRight)))
else if (pos.x() > (Rect.width() - d->sideBarMouseZone(SideBarRight))
&& d->AllowedAreas.testFlag(RightAutoHideArea))
{
return RightAutoHideArea;
}
else if (pos.y() < d->sideBarMouseZone(SideBarTop))
else if (pos.y() < d->sideBarMouseZone(SideBarTop)
&& d->AllowedAreas.testFlag(TopAutoHideArea))
{
return TopAutoHideArea;
}
else if (pos.y() > (Rect.height() - d->sideBarMouseZone(SideBarBottom)))
else if (pos.y() > (Rect.height() - d->sideBarMouseZone(SideBarBottom))
&& d->AllowedAreas.testFlag(BottomAutoHideArea))
{
return BottomAutoHideArea;
}