mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
bar: refractor xkb layout indicator
This commit is contained in:
@@ -289,22 +289,9 @@ Item { // Bar content region
|
||||
color: rightSidebarButton.colText
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
active: HyprlandXkb.layoutCodes.length > 1
|
||||
visible: active
|
||||
HyprlandXkbIndicator {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.rightMargin: indicatorsRowLayout.realSpacing
|
||||
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.smallie : Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
}
|
||||
}
|
||||
}
|
||||
MaterialSymbol {
|
||||
Layout.rightMargin: indicatorsRowLayout.realSpacing
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
|
||||
Loader {
|
||||
id: root
|
||||
property bool vertical: false
|
||||
|
||||
active: HyprlandXkb.layoutCodes.length > 1
|
||||
visible: active
|
||||
|
||||
sourceComponent: Item {
|
||||
implicitWidth: root.vertical ? undefined : layoutCodeText.implicitWidth
|
||||
implicitHeight: root.vertical ? layoutCodeText.implicitHeight : undefined
|
||||
StyledText {
|
||||
id: layoutCodeText
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: HyprlandXkb.currentLayoutCode.split(":").join("\n")
|
||||
font.pixelSize: text.includes("\n") ? Appearance.font.pixelSize.smallie : Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -269,23 +269,10 @@ Item { // Bar content region
|
||||
color: rightSidebarButton.colText
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
active: HyprlandXkb.layoutCodes.length > 1
|
||||
visible: active
|
||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||
Bar.HyprlandXkbIndicator {
|
||||
vertical: 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.smallie : Appearance.font.pixelSize.small
|
||||
color: rightSidebarButton.colText
|
||||
animateChange: true
|
||||
}
|
||||
}
|
||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||
}
|
||||
MaterialSymbol {
|
||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||
|
||||
Reference in New Issue
Block a user