mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-30 23:17:51 -04:00
displayconfig: fix custom scale option
This commit is contained in:
1 parent
a7db0354ae
commit
097de493bb
1 file changed
+19
-4
@@ -244,14 +244,13 @@ StyledRect {
|
||||
width: parent.width
|
||||
dropdownWidth: parent.width
|
||||
visible: !scaleContainer.customMode
|
||||
currentValue: scaleContainer.currentScale
|
||||
options: scaleContainer.scaleOptionsData.labels
|
||||
onValueChanged: value => {
|
||||
if (value === I18n.tr("Custom...")) {
|
||||
scaleContainer.customMode = true;
|
||||
currentValue = scaleContainer.currentScale;
|
||||
scaleInput.text = scaleContainer.currentScale;
|
||||
scaleInput.forceActiveFocus();
|
||||
scaleInput.selectAll();
|
||||
scaleContainer.customMode = true;
|
||||
customFocusTimer.restart();
|
||||
return;
|
||||
}
|
||||
const mapped = scaleContainer.scaleOptionsData.valueByLabel[value];
|
||||
@@ -259,6 +258,22 @@ StyledRect {
|
||||
}
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: scaleDropdown
|
||||
property: "currentValue"
|
||||
value: scaleContainer.currentScale
|
||||
}
|
||||
|
||||
// the dropdown takes focus back when its menu finishes closing
|
||||
Timer {
|
||||
id: customFocusTimer
|
||||
interval: Theme.shortDuration + 100
|
||||
onTriggered: {
|
||||
scaleInput.forceActiveFocus();
|
||||
scaleInput.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
DankTextField {
|
||||
id: scaleInput
|
||||
width: parent.width
|
||||
|
||||
Reference in new issue
Block a user