disable interactible elements when drawing
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
interactive: !Visibilities.getForActive().isDrawing
|
||||||
maximumFlickVelocity: 3000
|
maximumFlickVelocity: 3000
|
||||||
|
|
||||||
rebound: Transition {
|
rebound: Transition {
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool doneFakeFlick
|
property bool doneFakeFlick
|
||||||
|
|
||||||
|
interactive: !Visibilities.getForActive().isDrawing
|
||||||
maximumFlickVelocity: 3000
|
maximumFlickVelocity: 3000
|
||||||
|
|
||||||
rebound: Transition {
|
rebound: Transition {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Templates
|
import QtQuick.Templates
|
||||||
|
import qs.Helpers
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
|
||||||
ScrollBar {
|
ScrollBar {
|
||||||
@@ -15,6 +16,7 @@ ScrollBar {
|
|||||||
property bool shouldBeActive
|
property bool shouldBeActive
|
||||||
readonly property real travelScale: root.rawTravel > 0 ? root.effectiveTravel / root.rawTravel : 0
|
readonly property real travelScale: root.rawTravel > 0 ? root.effectiveTravel / root.rawTravel : 0
|
||||||
|
|
||||||
|
enabled: !Visibilities.getForActive().isDrawing
|
||||||
implicitWidth: Appearance.padding.extraSmall * 2
|
implicitWidth: Appearance.padding.extraSmall * 2
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
@@ -59,11 +61,13 @@ ScrollBar {
|
|||||||
implicitHeight: root.height * root.effectiveSize
|
implicitHeight: root.height * root.effectiveSize
|
||||||
implicitWidth: fullMouse.pressed || fullMouse.containsMouse ? Appearance.padding.extraSmall * 2 : Appearance.padding.extraSmall
|
implicitWidth: fullMouse.pressed || fullMouse.containsMouse ? Appearance.padding.extraSmall * 2 : Appearance.padding.extraSmall
|
||||||
opacity: {
|
opacity: {
|
||||||
|
if (!root.enabled)
|
||||||
|
return 0;
|
||||||
if (root.size === 1)
|
if (root.size === 1)
|
||||||
return 0;
|
return 0;
|
||||||
if (fullMouse.pressed)
|
if (fullMouse.pressed)
|
||||||
return 1;
|
return 1;
|
||||||
if (mouse.containsMouse)
|
if (fullMouse.containsMouse)
|
||||||
return 0.8;
|
return 0.8;
|
||||||
if (root.policy === ScrollBar.AlwaysOn || root.shouldBeActive)
|
if (root.policy === ScrollBar.AlwaysOn || root.shouldBeActive)
|
||||||
return 0.6;
|
return 0.6;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ MouseArea {
|
|||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: !enabled ? undefined : Qt.PointingHandCursor
|
cursorShape: !enabled ? undefined : Qt.PointingHandCursor
|
||||||
enabled: parent.enabled
|
enabled: parent.enabled && !Visibilities.getForActive().isDrawing
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
Behavior on stateOpacity {
|
Behavior on stateOpacity {
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ Item {
|
|||||||
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
enabled: root.visibilities.isDrawing
|
enabled: root.visibilities.isDrawing
|
||||||
|
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.TakeOverForbidden
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
if (!active) {
|
if (!active) {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ Item {
|
|||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
|
|
||||||
Flickable {
|
CustomFlickable {
|
||||||
id: clayout
|
id: clayout
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
Reference in New Issue
Block a user