Skip to content

Commit 1a7c3ce

Browse files
committed
qml: add EMPTY state to ValueInput
The EMPTY state indicates that this setting hasn't been touched. Clicking on the Setting that contains the ValueInput is enough to put it in the FILLED state.
1 parent 80392a5 commit 1a7c3ce

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/qml/components/DeveloperOptions.qml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ ColumnLayout {
3535
dbcacheSetting.forceActiveFocus()
3636
}
3737
}
38-
onClicked: loadedItem.forceActiveFocus()
38+
onClicked: {
39+
loadedItem.filled = true
40+
loadedItem.forceActiveFocus()
41+
}
3942
}
4043
Separator { Layout.fillWidth: true }
4144
Setting {
@@ -50,7 +53,10 @@ ColumnLayout {
5053
parSetting.forceActiveFocus()
5154
}
5255
}
53-
onClicked: loadedItem.forceActiveFocus()
56+
onClicked: {
57+
loadedItem.filled = true
58+
loadedItem.forceActiveFocus()
59+
}
5460
}
5561
Separator { Layout.fillWidth: true }
5662
Setting {

src/qml/components/StorageSettings.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ ColumnLayout {
4141
pruneTargetSetting.forceActiveFocus()
4242
}
4343
}
44-
onClicked: loadedItem.forceActiveFocus()
44+
onClicked: {
45+
loadedItem.filled = true
46+
loadedItem.forceActiveFocus()
47+
}
4548
}
4649
}

src/qml/controls/ValueInput.qml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ TextInput {
99
id: root
1010
required property string parentState
1111
property string description: ""
12+
property bool filled: false
1213
property int descriptionSize: 18
13-
property color textColor: Theme.color.neutral9
14+
property color textColor: root.filled ? Theme.color.neutral9 : Theme.color.neutral5
1415
enabled: true
1516
state: root.parentState
1617

@@ -21,7 +22,10 @@ TextInput {
2122
},
2223
State {
2324
name: "HOVER"
24-
PropertyChanges { target: root; textColor: Theme.color.orangeLight1 }
25+
PropertyChanges {
26+
target: root
27+
textColor: root.filled ? Theme.color.orangeLight1 : Theme.color.neutral5
28+
}
2529
},
2630
State {
2731
name: "DISABLED"

0 commit comments

Comments
 (0)