From 94bf7a656f95e94d65cf26b32f6c76631268cc64 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 24 Jan 2022 17:04:06 +0100 Subject: 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 Reviewed-by: Thomas Hartmann --- .../StudioControls/RealSpinBoxIndicator.qml | 22 +++++++++++++++------- 1 file 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 @@ -126,6 +125,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 @@ -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 -- cgit v1.2.3