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.
This commit is contained in:
+12
-11
@@ -995,6 +995,17 @@ Item {
|
|||||||
// Debug overlay: live readout of the card's position/dimensions and the
|
// Debug overlay: live readout of the card's position/dimensions and the
|
||||||
// movement state, shown next to the card while moving and after release.
|
// movement state, shown next to the card while moving and after release.
|
||||||
// Toggle with: omarchy-shell key-visualizer debug
|
// 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 {
|
BorderSurface {
|
||||||
id: debugOverlay
|
id: debugOverlay
|
||||||
visible: root.debugOverlay
|
visible: root.debugOverlay
|
||||||
@@ -1012,7 +1023,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: root.cardPad
|
anchors.margins: root.cardPad
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font: debugFont
|
font: root.debugFont
|
||||||
color: Color.popups.text
|
color: Color.popups.text
|
||||||
text: {
|
text: {
|
||||||
var lb = "\n"
|
var lb = "\n"
|
||||||
@@ -1026,16 +1037,6 @@ Item {
|
|||||||
}
|
}
|
||||||
readonly property bool debugDragging: dragArea.dragging
|
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
|
// Combo mode banner — a separate visual stacked against the history
|
||||||
// card (below it for bottom positions, above it for top positions).
|
// card (below it for bottom positions, above it for top positions).
|
||||||
// Shows the combo counter, multiplier and running score; hue and
|
// Shows the combo counter, multiplier and running score; hue and
|
||||||
|
|||||||
Reference in New Issue
Block a user