forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Henning Gründl
parent
7c38ee31e3
commit
94bf7a656f
@@ -32,7 +32,7 @@ Rectangle {
|
|||||||
|
|
||||||
property T.Control myControl
|
property T.Control myControl
|
||||||
|
|
||||||
property bool hover: spinBoxIndicatorMouseArea.containsMouse && spinBoxIndicator.enabled
|
property bool hover: spinBoxIndicatorMouseArea.containsMouse
|
||||||
property bool pressed: spinBoxIndicatorMouseArea.containsPress
|
property bool pressed: spinBoxIndicatorMouseArea.containsPress
|
||||||
property bool released: false
|
property bool released: false
|
||||||
property bool realEnabled: true
|
property bool realEnabled: true
|
||||||
@@ -112,7 +112,6 @@ Rectangle {
|
|||||||
id: spinBoxIndicatorIcon
|
id: spinBoxIndicatorIcon
|
||||||
text: StudioTheme.Constants.upDownSquare2
|
text: StudioTheme.Constants.upDownSquare2
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
renderType: Text.NativeRendering
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.pixelSize: StudioTheme.Values.spinControlIconSizeMulti
|
font.pixelSize: StudioTheme.Values.spinControlIconSizeMulti
|
||||||
@@ -126,6 +125,15 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
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 {
|
State {
|
||||||
name: "globalHover"
|
name: "globalHover"
|
||||||
when: myControl.enabled && spinBoxIndicator.enabled && !myControl.drag
|
when: myControl.enabled && spinBoxIndicator.enabled && !myControl.drag
|
||||||
@@ -150,12 +158,12 @@ Rectangle {
|
|||||||
&& spinBoxIndicator.pressed
|
&& spinBoxIndicator.pressed
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: spinBoxIndicatorIcon
|
target: spinBoxIndicatorIcon
|
||||||
color: "#323232" // TODO
|
color: StudioTheme.Values.themeIconColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "edit"
|
name: "edit"
|
||||||
when: myControl.edit
|
when: myControl.edit && spinBoxIndicator.enabled
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: spinBoxIndicatorIcon
|
target: spinBoxIndicatorIcon
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
@@ -201,7 +209,7 @@ Rectangle {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "hover"
|
name: "hover"
|
||||||
when: myControl.enabled && !myControl.drag
|
when: myControl.enabled && !myControl.drag && spinBoxIndicator.enabled
|
||||||
&& spinBoxIndicator.hover && myControl.hover && !spinBoxIndicator.pressed
|
&& spinBoxIndicator.hover && myControl.hover && !spinBoxIndicator.pressed
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: spinBoxIndicatorIcon
|
target: spinBoxIndicatorIcon
|
||||||
@@ -227,7 +235,7 @@ Rectangle {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "edit"
|
name: "edit"
|
||||||
when: myControl.edit
|
when: myControl.edit && myControl.enabled && spinBoxIndicator.enabled
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: spinBoxIndicatorIcon
|
target: spinBoxIndicatorIcon
|
||||||
visible: true
|
visible: true
|
||||||
@@ -239,7 +247,7 @@ Rectangle {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "drag"
|
name: "drag"
|
||||||
when: myControl.drag
|
when: myControl.drag && myControl.enabled
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: spinBoxIndicatorIcon
|
target: spinBoxIndicatorIcon
|
||||||
visible: false
|
visible: false
|
||||||
|
Reference in New Issue
Block a user