drawing clear on right click

This commit is contained in:
Zacharias-Brohn
2026-03-15 18:50:26 +01:00
parent f7b7260780
commit 9c955581fa
3 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -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)
+1
View File
@@ -153,6 +153,7 @@ Variants {
bar: bar
panels: panels
visibilities: visibilities
z: 1
}
}
+1 -1
View File
@@ -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