From 0e9adf5a6c144d17ed35752fc95dbd94ed3169b2 Mon Sep 17 00:00:00 2001 From: felixzsh Date: Tue, 11 Aug 2026 16:52:37 -0500 Subject: [PATCH] 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. --- Panel.qml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/Panel.qml b/Panel.qml index 88b9212..38725cc 100644 --- a/Panel.qml +++ b/Panel.qml @@ -221,16 +221,36 @@ Panel { } // Linger -------------------------------------------------------- - NumberField { - id: lingerField + Item { width: parent.width - 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 }) } + height: Math.max(lingerField.implicitHeight, lingerHint.implicitHeight) + + NumberField { + id: lingerField + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + 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 + } } } }