From a9e5bb524d39418e5daaabbbeaa4c2c52b44b267 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 30 Aug 2025 23:29:53 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell/Bar.qml | 106 +++++++++++++++------------ 1 file changed, 59 insertions(+), 47 deletions(-) diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml index 47f3a83c..52f875da 100644 --- a/accounts/gkleen@sif/shell/quickshell/Bar.qml +++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml @@ -217,53 +217,7 @@ PanelWindow { anchors.right: parent.right anchors.rightMargin: 8 anchors.verticalCenter: parent.verticalCenter - spacing: 8 - - Rectangle { - id: kbdWidget - - property var keyboardAbbrev: { "English (programmer Dvorak)": "dvp", "English (US)": "us" } - - width: kbdLabel.contentWidth - color: { - /* if (kbdMouseArea.containsMouse) { - return "#33808080"; - } */ - return "transparent"; - } - height: parent.height - anchors.verticalCenter: parent.verticalCenter - - MouseArea { - id: kbdMouseArea - - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - enabled: true - onClicked: { - NiriService.sendCommand({ "Action": { "SwitchLayout": { "layout": "Next" } } }, _ => {}) - } - } - - Text { - id: kbdLabel - - font.pointSize: 10 - font.family: "Fira Sans" - color: { - if (NiriService.keyboardLayouts?.current_idx === 0) - return "#555"; - return "white"; - } - anchors.centerIn: parent - - text: { - const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; - return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; - } - } - } + spacing: 0 Item { anchors.verticalCenter: parent.verticalCenter @@ -355,6 +309,64 @@ PanelWindow { } } + Rectangle { + height: parent.height + width: 4 + color: "transparent" + } + + Rectangle { + id: kbdWidget + + property var keyboardAbbrev: { "English (programmer Dvorak)": "dvp", "English (US)": "us" } + + width: kbdLabel.contentWidth + 8 + color: { + if (kbdMouseArea.containsMouse) { + return "#33808080"; + } + return "transparent"; + } + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + MouseArea { + id: kbdMouseArea + + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + enabled: true + onClicked: { + NiriService.sendCommand({ "Action": { "SwitchLayout": { "layout": "Next" } } }, _ => {}) + } + } + + Text { + id: kbdLabel + + font.pointSize: 10 + font.family: "Fira Sans" + color: { + if (NiriService.keyboardLayouts?.current_idx === 0) + return "#555"; + return "white"; + } + anchors.centerIn: parent + + text: { + const currentLayout = NiriService.keyboardLayouts?.names?.[NiriService.keyboardLayouts.current_idx]; + return kbdWidget.keyboardAbbrev[currentLayout] ? kbdWidget.keyboardAbbrev[currentLayout] : currentLayout; + } + } + } + + Rectangle { + height: parent.height + width: 4 + color: "transparent" + } + Text { id: clock color: "white" -- cgit v1.2.3