From ca1243f9c739b966c92956f9a25fed23ec694f6b Mon Sep 17 00:00:00 2001 From: zach Date: Fri, 19 Jun 2026 23:21:01 +0200 Subject: [PATCH] disable interactible elements when drawing --- Components/CustomFlickable.qml | 2 ++ Components/CustomListView.qml | 2 ++ Components/CustomScrollBar.qml | 6 +++++- Components/StateLayer.qml | 2 +- Drawers/Interactions.qml | 1 + Modules/Settings/Categories.qml | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Components/CustomFlickable.qml b/Components/CustomFlickable.qml index 01a9652..41b7ba8 100644 --- a/Components/CustomFlickable.qml +++ b/Components/CustomFlickable.qml @@ -1,8 +1,10 @@ import QtQuick +import qs.Helpers Flickable { id: root + interactive: !Visibilities.getForActive().isDrawing maximumFlickVelocity: 3000 rebound: Transition { diff --git a/Components/CustomListView.qml b/Components/CustomListView.qml index fa70f6d..ec9b9c6 100644 --- a/Components/CustomListView.qml +++ b/Components/CustomListView.qml @@ -1,10 +1,12 @@ import QtQuick +import qs.Helpers ListView { id: root property bool doneFakeFlick + interactive: !Visibilities.getForActive().isDrawing maximumFlickVelocity: 3000 rebound: Transition { diff --git a/Components/CustomScrollBar.qml b/Components/CustomScrollBar.qml index e68894e..e938599 100644 --- a/Components/CustomScrollBar.qml +++ b/Components/CustomScrollBar.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Templates +import qs.Helpers import qs.Config ScrollBar { @@ -15,6 +16,7 @@ ScrollBar { property bool shouldBeActive readonly property real travelScale: root.rawTravel > 0 ? root.effectiveTravel / root.rawTravel : 0 + enabled: !Visibilities.getForActive().isDrawing implicitWidth: Appearance.padding.extraSmall * 2 contentItem: Item { @@ -59,11 +61,13 @@ ScrollBar { implicitHeight: root.height * root.effectiveSize implicitWidth: fullMouse.pressed || fullMouse.containsMouse ? Appearance.padding.extraSmall * 2 : Appearance.padding.extraSmall opacity: { + if (!root.enabled) + return 0; if (root.size === 1) return 0; if (fullMouse.pressed) return 1; - if (mouse.containsMouse) + if (fullMouse.containsMouse) return 0.8; if (root.policy === ScrollBar.AlwaysOn || root.shouldBeActive) return 0.6; diff --git a/Components/StateLayer.qml b/Components/StateLayer.qml index efc985b..613e810 100644 --- a/Components/StateLayer.qml +++ b/Components/StateLayer.qml @@ -51,7 +51,7 @@ MouseArea { anchors.fill: parent cursorShape: !enabled ? undefined : Qt.PointingHandCursor - enabled: parent.enabled + enabled: parent.enabled && !Visibilities.getForActive().isDrawing hoverEnabled: true Behavior on stateOpacity { diff --git a/Drawers/Interactions.qml b/Drawers/Interactions.qml index 3d0fcc4..9415ace 100644 --- a/Drawers/Interactions.qml +++ b/Drawers/Interactions.qml @@ -124,6 +124,7 @@ Item { acceptedButtons: Qt.LeftButton | Qt.RightButton enabled: root.visibilities.isDrawing + grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden onActiveChanged: { if (!active) { diff --git a/Modules/Settings/Categories.qml b/Modules/Settings/Categories.qml index 5c54b95..87454c5 100644 --- a/Modules/Settings/Categories.qml +++ b/Modules/Settings/Categories.qml @@ -162,7 +162,7 @@ Item { color: DynamicColors.tPalette.m3surfaceContainer radius: Appearance.rounding.normal - Flickable { + CustomFlickable { id: clayout anchors.fill: parent