From a7357e3840cca1b41ba9800c646dac8616c0bced Mon Sep 17 00:00:00 2001 From: felixzsh Date: Wed, 26 Aug 2026 17:06:57 -0500 Subject: [PATCH] fix(ui): declare debugFont and debugFontMetrics before use debugFont was referenced by debugText and debugFontMetrics before its declaration, causing "ReferenceError: debugFont is not defined" on panel load. Move both the debugFont property and the debugFontMetrics FontMetrics block above the debug overlay so all references resolve in declaration order; qualify the last use as root.debugFont. --- KeyVisualizer.qml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/KeyVisualizer.qml b/KeyVisualizer.qml index b971a31..e69cab3 100644 --- a/KeyVisualizer.qml +++ b/KeyVisualizer.qml @@ -995,6 +995,17 @@ Item { // Debug overlay: live readout of the card's position/dimensions and the // movement state, shown next to the card while moving and after release. // Toggle with: omarchy-shell key-visualizer debug + readonly property var debugFont: Qt.font({ + family: Style.font.family, + pixelSize: Style.font.bodySmall, + bold: false + }) + + FontMetrics { + id: debugFontMetrics + font: debugFont + } + BorderSurface { id: debugOverlay visible: root.debugOverlay @@ -1012,7 +1023,7 @@ Item { anchors.fill: parent anchors.margins: root.cardPad verticalAlignment: Text.AlignVCenter - font: debugFont + font: root.debugFont color: Color.popups.text text: { var lb = "\n" @@ -1026,16 +1037,6 @@ Item { } readonly property bool debugDragging: dragArea.dragging - FontMetrics { - id: debugFontMetrics - font: debugFont - } - readonly property var debugFont: Qt.font({ - family: Style.font.family, - pixelSize: Style.font.bodySmall, - bold: false - }) - // Combo mode banner — a separate visual stacked against the history // card (below it for bottom positions, above it for top positions). // Shows the combo counter, multiplier and running score; hue and