1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

dock: limit input mask to body, disable hover headroom unless enabled

fixes #2923
This commit is contained in:
bbedward
2026-07-24 10:31:51 -04:00
parent 42060366cb
commit 0815e48465
+45 -10
View File
@@ -410,20 +410,55 @@ Item {
id: maskItem id: maskItem
visible: false visible: false
readonly property bool expanded: dock.reveal readonly property bool expanded: dock.reveal
readonly property bool chrome: dock.usesConnectedFrameChrome
readonly property bool atEndEdge: SettingsData.dockPosition === SettingsData.Position.Bottom || SettingsData.dockPosition === SettingsData.Position.Right
readonly property real innerReach: borderThickness + (SettingsData.appsDockEnlargeOnHover ? animationHeadroom : 0)
readonly property real bodyX: dockBackground.x + dockContainer.x + dockMouseArea.x + dockCore.x + dockSlide.x
readonly property real bodyY: dockBackground.y + dockContainer.y + dockMouseArea.y + dockCore.y + dockSlide.y
x: { x: {
const baseX = dockCore.x + dockMouseArea.x; if (chrome) {
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) const baseX = dockCore.x + dockMouseArea.x;
return baseX - (expanded ? animationHeadroom + borderThickness + dock.horizontalConnectorExtent : 0); if (isVertical && atEndEdge)
return baseX - (expanded ? borderThickness + dock.horizontalConnectorExtent : 0); return baseX - (expanded ? animationHeadroom + borderThickness + dock.horizontalConnectorExtent : 0);
return baseX - (expanded ? borderThickness + dock.horizontalConnectorExtent : 0);
}
if (!isVertical)
return dockCore.x + dockMouseArea.x - (expanded ? borderThickness : 0);
if (!atEndEdge)
return 0;
return expanded ? Math.min(bodyX - innerReach, dock.width - 1) : dock.width - 1;
} }
y: { y: {
const baseY = dockCore.y + dockMouseArea.y; if (chrome) {
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) const baseY = dockCore.y + dockMouseArea.y;
return baseY - (expanded ? animationHeadroom + borderThickness + dock.verticalConnectorExtent : 0); if (!isVertical && atEndEdge)
return baseY - (expanded ? borderThickness + dock.verticalConnectorExtent : 0); return baseY - (expanded ? animationHeadroom + borderThickness + dock.verticalConnectorExtent : 0);
return baseY - (expanded ? borderThickness + dock.verticalConnectorExtent : 0);
}
if (isVertical)
return dockCore.y + dockMouseArea.y - (expanded ? borderThickness : 0);
if (!atEndEdge)
return 0;
return expanded ? Math.min(bodyY - innerReach, dock.height - 1) : dock.height - 1;
}
width: {
if (chrome)
return dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.horizontalConnectorExtent * 2 : 0);
if (!isVertical)
return dockMouseArea.width + (expanded ? borderThickness * 2 : 0);
if (!expanded)
return 1;
return atEndEdge ? dock.width - x : Math.max(bodyX + dockBackground.width + innerReach, 1);
}
height: {
if (chrome)
return dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.verticalConnectorExtent * 2 : 0);
if (isVertical)
return dockMouseArea.height + (expanded ? borderThickness * 2 : 0);
if (!expanded)
return 1;
return atEndEdge ? dock.height - y : Math.max(bodyY + dockBackground.height + innerReach, 1);
} }
width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.horizontalConnectorExtent * 2 : 0)
height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.verticalConnectorExtent * 2 : 0)
} }
readonly property alias inputMaskItem: maskItem readonly property alias inputMaskItem: maskItem