From 8fbe59f6eb55b7a20e85beea95a47d1e4652a180 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 21 Aug 2020 04:58:03 -0400 Subject: [PATCH] Fix cursorShape over fields inside a HFlickable Bug introduced in 6b907, made the cursor stay as a normal arrow when hovering text fields/areas inside a HFlickable due to the HKineticScrollingDisabler's width/height being incorrectly set. --- TODO.md | 1 - src/gui/Base/HFlickable.qml | 15 ++++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index f59f2389..706e4c89 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ - refresh server list button - server list sorting method / explain what the % number is (stability) - spam alt+shift+a/going to room when starting app on server browser → segfault -- cursor shape in HBox/HTabbedBox pages over fields - login with account already added → infinite spinner in room list - verify onKeyboardAccept/Cancel things respect button enabled state diff --git a/src/gui/Base/HFlickable.qml b/src/gui/Base/HFlickable.qml index 53d8e8e8..986b39ff 100644 --- a/src/gui/Base/HFlickable.qml +++ b/src/gui/Base/HFlickable.qml @@ -17,12 +17,17 @@ Flickable { Component.onCompleted: { kineticScrollingDisabler = Qt.createComponent( "HKineticScrollingDisabler.qml" - ).createObject(flickable, { - flickable: flickable, - width: enabled ? flickable.width : 0, - height: enabled ? flickable.height : 0, - }) + ).createObject(flickable, {flickable}) + + kineticScrollingDisabler.width = Qt.binding(() => + kineticScrollingDisabler.enabled ? flickable.width : 0 + ) + kineticScrollingDisabler.height = Qt.binding(() => + kineticScrollingDisabler.enabled ? flickable.height : 0 + ) } property var kineticScrollingDisabler + property var pr: kineticScrollingDisabler.enabled + onPrChanged: print("pr changed:", pr) }