diff options
| -rw-r--r-- | components/controls/TextButton.qml | 8 | ||||
| -rw-r--r-- | modules/bar/popouts/KbLayout.qml | 26 |
2 files changed, 31 insertions, 3 deletions
diff --git a/components/controls/TextButton.qml b/components/controls/TextButton.qml index 71ebcfa..ef84185 100644 --- a/components/controls/TextButton.qml +++ b/components/controls/TextButton.qml @@ -25,13 +25,19 @@ StyledRect { property bool internalChecked property color activeColour: type === TextButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondary - property color inactiveColour: type === TextButton.Filled ? Colours.tPalette.m3surfaceContainer : Colours.palette.m3secondaryContainer + property color inactiveColour: { + if (!toggle && type === TextButton.Filled) + return Colours.palette.m3primary; + return type === TextButton.Filled ? Colours.tPalette.m3surfaceContainer : Colours.palette.m3secondaryContainer; + } property color activeOnColour: { if (type === TextButton.Text) return Colours.palette.m3primary; return type === TextButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary; } property color inactiveOnColour: { + if (!toggle && type === TextButton.Filled) + return Colours.palette.m3onPrimary; if (type === TextButton.Text) return Colours.palette.m3primary; return type === TextButton.Filled ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer; diff --git a/modules/bar/popouts/KbLayout.qml b/modules/bar/popouts/KbLayout.qml index 8e5ae8d..b12f2ef 100644 --- a/modules/bar/popouts/KbLayout.qml +++ b/modules/bar/popouts/KbLayout.qml @@ -1,6 +1,28 @@ import qs.components +import qs.components.controls import qs.services +import qs.config +import Quickshell +import QtQuick.Layouts -StyledText { - text: qsTr("Keyboard layout: %1").arg(Hypr.kbLayoutFull) +ColumnLayout { + id: root + + spacing: Appearance.spacing.normal + + StyledText { + Layout.topMargin: Appearance.padding.normal + Layout.rightMargin: Appearance.padding.normal + text: qsTr("Keyboard layout: %1").arg(Hypr.kbLayoutFull) + font.weight: 500 + } + + TextButton { + Layout.bottomMargin: Appearance.padding.normal + Layout.rightMargin: Appearance.padding.normal + Layout.fillWidth: true + + text: qsTr("Switch layout") + onClicked: Quickshell.execDetached(["hyprctl", "switchxkblayout", "all", "next"]) + } } |