displayconfig: fix custom scale option

This commit is contained in:
bbedward committed 2026-09-17 10:33:09 -04:00
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