diff options
author | Henning Gruendl <henning.gruendl@qt.io> | 2022-01-24 17:04:06 +0100 |
---|---|---|
committer | Henning Gründl <henning.gruendl@qt.io> | 2022-01-24 16:36:27 +0000 |
commit | 94bf7a656f95e94d65cf26b32f6c76631268cc64 (patch) | |
tree | 97676085317d8c036d359ecd4b8f8c88b5444da2 | |
parent | 7c38ee31e3cedb42e2e6fc555ba901d13f021dfb (diff) | |
download | qt-creator-94bf7a656f95e94d65cf26b32f6c76631268cc64.tar.gz |
QmlDesigner: Fix SpinBoxIndicator hover/edit state
* Make global hover work on disabled SpinBoxIndicator
* Fix disabled state not showing in edit mode
* Hide/blend indicator on drag operation
* Some color changes
Task-number: QDS-5970
Task-number: QDS-5975
Change-Id: I4965b4c6ad906fe05f8a43cabb1914e15a23ba7d
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml index 26373f4db1..9e715fd873 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml @@ -32,7 +32,7 @@ Rectangle { property T.Control myControl - property bool hover: spinBoxIndicatorMouseArea.containsMouse && spinBoxIndicator.enabled + property bool hover: spinBoxIndicatorMouseArea.containsMouse property bool pressed: spinBoxIndicatorMouseArea.containsPress property bool released: false property bool realEnabled: true @@ -112,7 +112,6 @@ Rectangle { id: spinBoxIndicatorIcon text: StudioTheme.Constants.upDownSquare2 color: StudioTheme.Values.themeTextColor - renderType: Text.NativeRendering horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: StudioTheme.Values.spinControlIconSizeMulti @@ -127,6 +126,15 @@ Rectangle { states: [ State { + name: "default" + when: myControl.enabled && spinBoxIndicator.enabled && !myControl.edit + && !spinBoxIndicator.hover && !myControl.hover && !myControl.drag + PropertyChanges { + target: spinBoxIndicatorIcon + color: StudioTheme.Values.themeTextColor + } + }, + State { name: "globalHover" when: myControl.enabled && spinBoxIndicator.enabled && !myControl.drag && !spinBoxIndicator.hover && myControl.hover && !myControl.edit @@ -150,12 +158,12 @@ Rectangle { && spinBoxIndicator.pressed PropertyChanges { target: spinBoxIndicatorIcon - color: "#323232" // TODO + color: StudioTheme.Values.themeIconColor } }, State { name: "edit" - when: myControl.edit + when: myControl.edit && spinBoxIndicator.enabled PropertyChanges { target: spinBoxIndicatorIcon color: StudioTheme.Values.themeTextColor @@ -201,7 +209,7 @@ Rectangle { }, State { name: "hover" - when: myControl.enabled && !myControl.drag + when: myControl.enabled && !myControl.drag && spinBoxIndicator.enabled && spinBoxIndicator.hover && myControl.hover && !spinBoxIndicator.pressed PropertyChanges { target: spinBoxIndicatorIcon @@ -227,7 +235,7 @@ Rectangle { }, State { name: "edit" - when: myControl.edit + when: myControl.edit && myControl.enabled && spinBoxIndicator.enabled PropertyChanges { target: spinBoxIndicatorIcon visible: true @@ -239,7 +247,7 @@ Rectangle { }, State { name: "drag" - when: myControl.drag + when: myControl.drag && myControl.enabled PropertyChanges { target: spinBoxIndicatorIcon visible: false |