forked from Shinonome/dots-hyprland
bar: refractor xkb layout indicator
This commit is contained in:
@@ -289,22 +289,9 @@ Item { // Bar content region
|
|||||||
color: rightSidebarButton.colText
|
color: rightSidebarButton.colText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loader {
|
HyprlandXkbIndicator {
|
||||||
active: HyprlandXkb.layoutCodes.length > 1
|
Layout.alignment: Qt.AlignVCenter
|
||||||
visible: active
|
|
||||||
Layout.rightMargin: indicatorsRowLayout.realSpacing
|
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 {
|
MaterialSymbol {
|
||||||
Layout.rightMargin: indicatorsRowLayout.realSpacing
|
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
|
color: rightSidebarButton.colText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loader {
|
Bar.HyprlandXkbIndicator {
|
||||||
active: HyprlandXkb.layoutCodes.length > 1
|
vertical: true
|
||||||
visible: active
|
|
||||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
sourceComponent: Item {
|
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
Layout.bottomMargin: indicatorsColumnLayout.realSpacing
|
||||||
|
|||||||
Reference in New Issue
Block a user