From 765b84a19ce376fcd7edb7184041212bd11599b6 Mon Sep 17 00:00:00 2001 From: zach Date: Thu, 1 Oct 2026 17:11:20 +0200 Subject: [PATCH] fix: settings drag gesture and dashboard popout regions --- Drawers/Interactions2.qml | 75 +++++++++++++-------------- Modules/Bar/Popouts/UpdatesPopout.qml | 6 ++- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/Drawers/Interactions2.qml b/Drawers/Interactions2.qml index 001db80..e11bf02 100644 --- a/Drawers/Interactions2.qml +++ b/Drawers/Interactions2.qml @@ -11,19 +11,18 @@ CustomMouseArea { required property Item bar required property real borderThickness - required property ScreenState screenState + property bool dashboardShortcutActive + property point dragStart required property Drawing drawing required property EdgeGeometry geometry + property bool osdShortcutActive required property Panels panels required property Wrapper popouts required property ShellScreen screen - - property bool dashboardShortcutActive - property bool osdShortcutActive + required property ScreenState screenState + property bool setInitialPoint: false property bool singleGestureTriggered: false property bool utilitiesShortcutActive - property bool setInitialPoint: false - property point dragStart function inBottomPanel(panel: Item, x: real, y: real): bool { const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0)); @@ -60,39 +59,10 @@ CustomMouseArea { return x >= panelX && x <= panelX + panel.width; } - anchors.fill: parent acceptedButtons: bar.fullscreen ? Qt.NoButton : Qt.AllButtons + anchors.fill: parent hoverEnabled: true - onPressed: event => { - dragStart = Qt.point(event.x, event.y); - - if (screenState.isDrawing) { - if (event.button & Qt.RightButton) { - drawing.content.clear(); - return; - } - - if (!inLeftPanel(panels.drawing, mouseX, mouseY)) - drawing.content.beginStroke(event.x, event.y); - } - } - - onPressedChanged: { - if (!pressed) { - if (screenState.isDrawing) { - setInitialPoint = false; - drawing.content.endStroke(); - if (!inLeftPanel(panels.drawing, mouseX, mouseY)) - drawing.content.showHover(mouseX, mouseY); - } - } else { - if (screenState.isDrawing) { - panels.drawing.collapse(); - } - } - } - onContainsMouseChanged: { if (!containsMouse) { if (!osdShortcutActive) { @@ -111,7 +81,6 @@ CustomMouseArea { screenState.dashboard = false; } } - onPositionChanged: event => { const x = event.x; const y = event.y; @@ -144,7 +113,8 @@ CustomMouseArea { if (pressed && dragStart.y >= screen.height - Config.bar.border && dragStart.x > screen.width / 5 && dragY < -Config.launcher.dragThreshold) screenState.launcher = true; - const showDashboard = Config.dashboard.showOnHover && inTopPanel(panels.dashboardWrapper, x, y); + const entryAt = bar.entryAt(geometry.axisPos(x, y)); + const showDashboard = Config.dashboard.showOnHover && inTopPanel(panels.dashboardWrapper, x, y) && (!entryAt || entryAt === "activeWindow"); if (!dashboardShortcutActive) { screenState.dashboard = showDashboard; @@ -159,7 +129,7 @@ CustomMouseArea { screenState.dashboard = false; } - if (pressed && geometry.insetTop(borderThickness) > dragStart.y && (Config.dashboard.showOnHover || !inTopPanel(panels.dashboardWrapper, dragStart.x, dragStart.y))) { + if (pressed && geometry.insetTop(borderThickness) > dragStart.y && !inTopPanel(panels.dashboardWrapper, dragStart.x, dragStart.y)) { if (dragY > 20) { screenState.settings = true; } else if (dragY < -20) { @@ -212,6 +182,33 @@ CustomMouseArea { if (geometry.barContains(x, y)) bar.checkPopout(geometry.axisPos(x, y)); } + onPressed: event => { + dragStart = Qt.point(event.x, event.y); + + if (screenState.isDrawing) { + if (event.button & Qt.RightButton) { + drawing.content.clear(); + return; + } + + if (!inLeftPanel(panels.drawing, mouseX, mouseY)) + drawing.content.beginStroke(event.x, event.y); + } + } + onPressedChanged: { + if (!pressed) { + if (screenState.isDrawing) { + setInitialPoint = false; + drawing.content.endStroke(); + if (!inLeftPanel(panels.drawing, mouseX, mouseY)) + drawing.content.showHover(mouseX, mouseY); + } + } else { + if (screenState.isDrawing) { + panels.drawing.collapse(); + } + } + } Timer { id: unhideTimer diff --git a/Modules/Bar/Popouts/UpdatesPopout.qml b/Modules/Bar/Popouts/UpdatesPopout.qml index 6de1f39..a5b380d 100644 --- a/Modules/Bar/Popouts/UpdatesPopout.qml +++ b/Modules/Bar/Popouts/UpdatesPopout.qml @@ -36,8 +36,8 @@ CustomClippingRect { MaterialIcon { id: noUpdatesIcon - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top + anchors.centerIn: parent + anchors.verticalCenterOffset: -noUpdatesText.implicitHeight color: Colors.tPalette.m3onSurfaceVariant fontStyle: Tokens.font.icon.builders.large.size(48).weight(Font.DemiBold).build() horizontalAlignment: Text.AlignHCenter @@ -45,6 +45,8 @@ CustomClippingRect { } CustomText { + id: noUpdatesText + anchors.horizontalCenter: parent.horizontalCenter anchors.top: noUpdatesIcon.bottom color: Colors.tPalette.m3onSurfaceVariant