fix(SlippageSelector): remember previous custom value
do not overwrite it and display the Custom button when we click one of the predefined buttons
This commit is contained in:
parent
9eba61e18c
commit
3a4764b217
|
@ -26,13 +26,14 @@ Control {
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
buttons.model.append(d.values.map(i => ({ text: "%L1 %".arg(i), value: i })))
|
buttons.model.append(d.values.map(i => ({ text: "%L1 %2".arg(i).arg(d.customSymbol), value: i })))
|
||||||
valueChanged()
|
valueChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
|
|
||||||
|
readonly property string customSymbol: "%"
|
||||||
readonly property var values: [0.1, 0.5, 1]
|
readonly property var values: [0.1, 0.5, 1]
|
||||||
property bool internalUpdate: false
|
property bool internalUpdate: false
|
||||||
|
|
||||||
|
@ -60,7 +61,6 @@ Control {
|
||||||
return
|
return
|
||||||
|
|
||||||
d.update(value)
|
d.update(value)
|
||||||
customButton.visible = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,9 @@ Control {
|
||||||
visible: !customButton.visible
|
visible: !customButton.visible
|
||||||
minValue: 0.01
|
minValue: 0.01
|
||||||
maxValue: 100.0
|
maxValue: 100.0
|
||||||
currencySymbol: "%"
|
currencySymbol: d.customSymbol
|
||||||
onValueChanged: d.update(value)
|
onValueChanged: d.update(value)
|
||||||
|
onFocusChanged: if (focus) d.update(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue