drawing reworked into c++ plugin, moved input handler to Interactions.qml as a PointHandler
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 11s
Python / lint-format (pull_request) Successful in 16s
Python / test (pull_request) Successful in 31s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m17s

This commit is contained in:
2026-06-18 13:48:58 +02:00
parent fbadcbb717
commit c102d0e38f
15 changed files with 281 additions and 118 deletions
+39 -4
View File
@@ -12,7 +12,6 @@ Item {
required property real borderThickness
property bool dashboardShortcutActive
required property Drawing drawing
required property DrawingInput input
property bool osdShortcutActive
required property Panels panels
required property BarPopouts.Wrapper popouts
@@ -60,6 +59,7 @@ Item {
cursorShape: (active && centroid.pressPosition.y < root.bar.implicitHeight) ? Qt.ClosedHandCursor : undefined
dragThreshold: 0
enabled: !root.visibilities.isDrawing
grabPermissions: PointerHandler.CanTakeOverFromHandlersOfSameType | PointerHandler.ApprovesTakeOverByAnything
maximumPointCount: 1
minimumPointCount: 1
@@ -117,6 +117,40 @@ Item {
}
}
PointHandler {
id: drawingHandler
property bool setInitialPoint: false
enabled: root.visibilities.isDrawing
onActiveChanged: {
console.log(active);
if (!active) {
setInitialPoint = false;
root.drawing.endStroke();
} else {
root.panels.drawing.expanded = false;
}
}
onPointChanged: {
const x = point.position.x;
const y = point.position.y;
const origX = point.pressPosition.x;
const origY = point.pressPosition.y;
if (x === 0 && y === 0 && origX === 0 && origY === 0)
return;
if (!setInitialPoint) {
setInitialPoint = true;
root.drawing.beginStroke(origX, origY);
return;
}
root.drawing.appendPoint(x, y);
}
}
HoverHandler {
id: hoverHandler
@@ -139,9 +173,10 @@ Item {
const x = point.position.x;
const y = point.position.y;
if (root.visibilities.isDrawing && !root.inLeftPanel(root.panels.drawing, x, y)) {
root.input.z = 2;
root.panels.drawing.expanded = false;
if (root.visibilities.isDrawing) {
if (root.inLeftPanel(root.panels.drawing, x, y))
root.panels.drawing.expanded = true;
return;
}
if (!root.visibilities.bar && Config.barConfig.autoHide && y < root.bar.implicitHeight)