Show a 'never hide' hint next to Linger when it is 0

When lingerMs is 0 (always show), a muted caption appears on the right of
the field so the opt-in is visible at a glance; the field shrinks to make
room. Config unchanged.
This commit is contained in:
felixzsh
2026-08-11 16:52:37 -05:00
parent e7232840cb
commit 0e9adf5a6c
+29 -9
View File
@@ -221,16 +221,36 @@ Panel {
} }
// Linger -------------------------------------------------------- // Linger --------------------------------------------------------
NumberField { Item {
id: lingerField
width: parent.width width: parent.width
label: "Linger" height: Math.max(lingerField.implicitHeight, lingerHint.implicitHeight)
value: root.lingerMs
from: 0 NumberField {
to: 10000 id: lingerField
stepSize: 500 anchors.left: parent.left
// 0 = always show (keep the last combo until the next key). anchors.verticalCenter: parent.verticalCenter
onModified: function(v) { root.writeConfig({ lingerMs: v }) } width: parent.width - (root.lingerMs === 0 ? lingerHint.implicitWidth + Style.spacing.md : 0)
// With the "never hide" hint out, the field shrinks so both fit.
fieldWidth: root.lingerMs === 0 ? Style.space(72) : Style.spacing.numberFieldWidth
label: "Linger"
value: root.lingerMs
from: 0
to: 10000
stepSize: 500
// 0 = always show (keep the last combo until the next key).
onModified: function(v) { root.writeConfig({ lingerMs: v }) }
}
Text {
id: lingerHint
visible: root.lingerMs === 0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: "never hide"
color: Qt.darker(Color.popups.text, 1.35)
font.family: Style.font.family
font.pixelSize: Style.font.caption
}
} }
} }
} }