diff --git a/quickshell/Modules/Settings/DisplayConfig/OutputCard.qml b/quickshell/Modules/Settings/DisplayConfig/OutputCard.qml index 0c779e041..2e786a157 100644 --- a/quickshell/Modules/Settings/DisplayConfig/OutputCard.qml +++ b/quickshell/Modules/Settings/DisplayConfig/OutputCard.qml @@ -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