drawing clear on right click
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Components
|
import qs.Components
|
||||||
|
import qs.Config
|
||||||
|
|
||||||
CustomMouseArea {
|
CustomMouseArea {
|
||||||
id: root
|
id: root
|
||||||
@@ -12,7 +13,7 @@ CustomMouseArea {
|
|||||||
required property PersistentProperties visibilities
|
required property PersistentProperties visibilities
|
||||||
|
|
||||||
function inLeftPanel(panel: Item, x: real, y: real): bool {
|
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 {
|
function withinPanelHeight(panel: Item, x: real, y: real): bool {
|
||||||
@@ -20,6 +21,7 @@ CustomMouseArea {
|
|||||||
return y >= panelY && y <= panelY + panel.height;
|
return y >= panelY && y <= panelY + panel.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
anchors.fill: root.visibilities.isDrawing ? parent : undefined
|
anchors.fill: root.visibilities.isDrawing ? parent : undefined
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
visible: root.visibilities.isDrawing
|
visible: root.visibilities.isDrawing
|
||||||
@@ -45,6 +47,9 @@ CustomMouseArea {
|
|||||||
root.drawing.beginStroke(x, y);
|
root.drawing.beginStroke(x, y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.buttons & Qt.RightButton)
|
||||||
|
root.drawing.clear();
|
||||||
}
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
if (root.visibilities.isDrawing)
|
if (root.visibilities.isDrawing)
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ Variants {
|
|||||||
bar: bar
|
bar: bar
|
||||||
panels: panels
|
panels: panels
|
||||||
visibilities: visibilities
|
visibilities: visibilities
|
||||||
|
z: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Item {
|
|||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
name: "hidden"
|
name: "hidden"
|
||||||
when: root.visibilities.sidebar
|
when: root.visibilities.sidebar || root.visibilities.dashboard || (root.panels.popouts.hasCurrent && root.panels.popouts.currentName.startsWith("traymenu"))
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
root.implicitHeight: 0
|
root.implicitHeight: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user