From f0f58fea2f3967ce8675d20869f4d828b3c5e651 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Wed, 20 May 2026 11:49:25 -0400 Subject: [PATCH] Fix display not showing current scale --- shell/plugins/panels/Monitor.qml | 47 ++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/shell/plugins/panels/Monitor.qml b/shell/plugins/panels/Monitor.qml index d59d9b44..26790a76 100644 --- a/shell/plugins/panels/Monitor.qml +++ b/shell/plugins/panels/Monitor.qml @@ -286,7 +286,7 @@ Panel { Process { id: stateProc - command: ["bash", "-lc", "omarchy-brightness-display 2>/dev/null || true; monitors_json=$(hyprctl monitors all -j); printf '%s\\n' \"$monitors_json\" | jq -r 'def internal: test(\"^(eDP|LVDS|DSI)-\"); ([.[] | select(.name | internal)][0].name // \"\"), ([.[] | select((.name | internal) | not)][0].name // \"\"), ([.[] | select((.name | internal) and .disabled != true)][0].name // \"\"), ([.[] | select((.name | internal) and .mirrorOf != \"none\")][0].mirrorOf // \"\")'; omarchy-hyprland-monitor-focused 2>/dev/null || echo; omarchy-hyprland-monitor-scaling 2>/dev/null || echo; printf '%s\\n' \"$monitors_json\" | jq -c '[.[] | {name, enabled:(.disabled != true), focused:(.focused == true)}]'"] + command: ["bash", "-lc", "{ omarchy-brightness-display 2>/dev/null; echo; } | head -n 1; monitors_json=$(hyprctl monitors all -j); printf '%s\\n' \"$monitors_json\" | jq -r 'def internal: test(\"^(eDP|LVDS|DSI)-\"); ([.[] | select(.name | internal)][0].name // \"\"), ([.[] | select((.name | internal) | not)][0].name // \"\"), ([.[] | select((.name | internal) and .disabled != true)][0].name // \"\"), ([.[] | select((.name | internal) and .mirrorOf != \"none\")][0].mirrorOf // \"\")'; omarchy-hyprland-monitor-focused 2>/dev/null || echo; omarchy-hyprland-monitor-scaling 2>/dev/null || echo; printf '%s\\n' \"$monitors_json\" | jq -c '[.[] | {name, enabled:(.disabled != true), focused:(.focused == true)}]'"] stdout: StdioCollector { waitForEnd: true onStreamFinished: { @@ -489,28 +489,12 @@ Panel { Repeater { model: root.scaleValues - Button { + ScalePill { required property string modelData required property int index - width: (panelColumn.width - Style.space(30)) / 6 - text: modelData + "x" - foreground: root.bar.foreground - background: "transparent" - fontFamily: root.bar.fontFamily - fontSize: Style.font.bodySmall - horizontalPadding: 0 - verticalPadding: Style.spacing.controlPaddingY - active: root.normalizeScale(root.monitorScale) === root.normalizeScale(modelData) - hasCursor: root.cursorActive && root.focusSection === "scale" && root.selectedIndex === index - onClicked: root.setScale(modelData) - onHovered: function(h) { - if (h) { - root.cursorActive = true - root.focusSection = "scale" - root.selectedIndex = index - } - } + scaleValue: modelData + scaleIndex: index } } } @@ -547,6 +531,29 @@ Panel { } } + component ScalePill: Button { + id: pill + required property string scaleValue + required property int scaleIndex + + text: scaleValue + "x" + foreground: root.bar.foreground + fontFamily: root.bar.fontFamily + horizontalPadding: Style.spacing.controlPaddingX + verticalPadding: Style.spacing.controlPaddingY + + active: root.normalizeScale(root.monitorScale) === root.normalizeScale(scaleValue) + hasCursor: root.cursorActive && root.focusSection === "scale" && root.selectedIndex === scaleIndex + + onClicked: root.setScale(scaleValue) + onHovered: function(isHovered) { + if (!isHovered) return + root.cursorActive = true + root.focusSection = "scale" + root.selectedIndex = pill.scaleIndex + } + } + component MonitorRow: CursorSurface { id: monitorRow required property var display