From 9c955581faa9c967003a2d8efe2bac39889adefd Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Sun, 15 Mar 2026 18:50:26 +0100 Subject: [PATCH] drawing clear on right click --- Drawers/DrawingInput.qml | 7 ++++++- Drawers/Windows.qml | 1 + Modules/Notifications/Wrapper.qml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Drawers/DrawingInput.qml b/Drawers/DrawingInput.qml index 51a785f..c8f2c18 100644 --- a/Drawers/DrawingInput.qml +++ b/Drawers/DrawingInput.qml @@ -1,6 +1,7 @@ import Quickshell import QtQuick import qs.Components +import qs.Config CustomMouseArea { id: root @@ -12,7 +13,7 @@ CustomMouseArea { required property PersistentProperties visibilities function inLeftPanel(panel: Item, x: real, y: real): bool { - return x < panel.x + panel.width && withinPanelHeight(panel, x, y); + return x < panel.x + panel.width + Config.barConfig.border && withinPanelHeight(panel, x, y); } function withinPanelHeight(panel: Item, x: real, y: real): bool { @@ -20,6 +21,7 @@ CustomMouseArea { return y >= panelY && y <= panelY + panel.height; } + acceptedButtons: Qt.LeftButton | Qt.RightButton anchors.fill: root.visibilities.isDrawing ? parent : undefined hoverEnabled: true visible: root.visibilities.isDrawing @@ -45,6 +47,9 @@ CustomMouseArea { root.drawing.beginStroke(x, y); return; } + + if (event.buttons & Qt.RightButton) + root.drawing.clear(); } onReleased: { if (root.visibilities.isDrawing) diff --git a/Drawers/Windows.qml b/Drawers/Windows.qml index e38a84a..a7ec012 100644 --- a/Drawers/Windows.qml +++ b/Drawers/Windows.qml @@ -153,6 +153,7 @@ Variants { bar: bar panels: panels visibilities: visibilities + z: 1 } } diff --git a/Modules/Notifications/Wrapper.qml b/Modules/Notifications/Wrapper.qml index fda5789..1e7038f 100644 --- a/Modules/Notifications/Wrapper.qml +++ b/Modules/Notifications/Wrapper.qml @@ -14,7 +14,7 @@ Item { states: State { name: "hidden" - when: root.visibilities.sidebar + when: root.visibilities.sidebar || root.visibilities.dashboard || (root.panels.popouts.hasCurrent && root.panels.popouts.currentName.startsWith("traymenu")) PropertyChanges { root.implicitHeight: 0