left-bar working, bottom bar semi-broken

This commit is contained in:
2026-08-14 16:31:52 +02:00
parent 1d150292d3
commit 4517e5ecd0
28 changed files with 404 additions and 168 deletions
+10 -15
View File
@@ -22,7 +22,8 @@ Item {
required property PersistentProperties visibilities
function inBottomPanel(panel: Item, x: real, y: real): bool {
return y > root.height - panel.height - geometry.insetBottom(borderThickness) && withinPanelWidth(panel, x, y);
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
return y > root.height - (panelHeight + geometry.insetBottom(borderThickness)) && withinPanelWidth(panel, x, y);
}
function inLeftPanel(panel: Item, x: real, y: real): bool {
@@ -37,17 +38,12 @@ Item {
}
function inRightPanel(panel: Item, x: real, y: real): bool {
return x > panel.x - geometry.insetLeft(borderThickness) && withinPanelHeight(panel, x, y);
return x > panel.x + geometry.insetLeft(borderThickness) && withinPanelHeight(panel, x, y);
}
function inTopPanel(panel: Item, x: real, y: real): bool {
return y < geometry.insetTop(borderThickness) + panel.height && withinPanelWidth(panel, x, y);
}
function onWheel(event: WheelEvent): void {
if (event.x < bar.implicitWidth) {
bar.handleWheel(event.y, event.angleDelta);
}
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
return y < geometry.insetTop(borderThickness) + panelHeight && withinPanelWidth(panel, x, y);
}
function withinPanelHeight(panel: Item, x: real, y: real): bool {
@@ -89,12 +85,11 @@ Item {
if (root.singleGestureTriggered)
return;
if (root.geometry.barContains(centroid.pressPosition.x, centroid.pressPosition.y, true)) {
const barDrag = root.geometry.inwardDrag(dragX, dragY);
if (barDrag > 20) {
if (root.geometry.insetTop(root.borderThickness) > centroid.pressPosition.y) {
if (dragY > 20) {
root.visibilities.settings = true;
root.singleGestureTriggered = true;
} else if (barDrag < -20) {
} else if (dragY < -20) {
root.visibilities.settings = false;
root.singleGestureTriggered = true;
}
@@ -228,8 +223,8 @@ Item {
if (Config.dock.enable && Config.dock.hoverToReveal && !root.visibilities.dock && !root.visibilities.launcher && root.inBottomPanel(root.panels.dock, x, y))
root.visibilities.dock = true;
if (y < root.bar.implicitHeight)
root.bar.checkPopout(x);
if (root.geometry.barContains(x, y))
root.bar.checkPopout(root.geometry.axisPos(x, y));
}
}