mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
hyprland xkb layout indicator: fix weird placement on vertical bar
This commit is contained in:
@@ -293,11 +293,17 @@ Item { // Bar content region
|
||||
active: HyprlandXkb.layoutCodes.length > 1
|
||||
visible: active
|
||||
Layout.rightMargin: indicatorsRowLayout.realSpacing
|
||||
sourceComponent: StyledText {
|
||||
text: HyprlandXkb.currentLayoutCode
|
||||
font.pixelSize: Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
sourceComponent: Item {
|
||||
implicitWidth: layoutCodeText.implicitWidth
|
||||
StyledText {
|
||||
id: layoutCodeText
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: HyprlandXkb.currentLayoutCode.split(":").join("\n")
|
||||
font.pixelSize: text.includes("\n") ? Appearance.font.pixelSize.smaller : Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
}
|
||||
}
|
||||
}
|
||||
MaterialSymbol {
|
||||
|
||||
@@ -273,11 +273,18 @@ Item { // Bar content region
|
||||
active: HyprlandXkb.layoutCodes.length > 1
|
||||
visible: active
|
||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||
sourceComponent: StyledText {
|
||||
text: HyprlandXkb.currentLayoutCode
|
||||
font.pixelSize: Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
sourceComponent: Item {
|
||||
implicitHeight: layoutCodeText.implicitHeight
|
||||
StyledText {
|
||||
id: layoutCodeText
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: HyprlandXkb.currentLayoutCode.split(":").join("\n")
|
||||
font.pixelSize: text.includes("\n") ? Appearance.font.pixelSize.smaller : Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
}
|
||||
}
|
||||
}
|
||||
MaterialSymbol {
|
||||
|
||||
@@ -57,7 +57,7 @@ Singleton {
|
||||
// Match variant: (whitespace + ) variant + whitespace + key + whitespace + description
|
||||
const matchVariant = line.match(/^\s*(\S+)\s+(\S+)\s+(.+)$/);
|
||||
if (matchVariant && matchVariant[3] === targetDescription) {
|
||||
const complexLayout = matchVariant[2] + " " + matchVariant[1];
|
||||
const complexLayout = matchVariant[2] + matchVariant[1];
|
||||
root.cachedLayoutCodes[matchVariant[3]] = complexLayout;
|
||||
root.currentLayoutCode = complexLayout;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user