popouts/kblayout: add switch layout button (#682)
* keyboard layout * Update KbLayout.qml Code cleanup * Update KbLayout.qml more code cleanup * fix --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
This commit is contained in:
parent
21e1efd944
commit
50ef4871c7
2 changed files with 31 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,28 @@
|
|||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import QtQuick.Layouts
|
||||
|
||||
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"])
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue