1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 15:02:50 -05:00

Implement sizing mechanism for bar widget content

This commit is contained in:
bbedward
2025-10-06 20:40:02 -04:00
parent 7158e09b0e
commit ef9f76190d
27 changed files with 149 additions and 93 deletions

View File

@@ -13,6 +13,7 @@ Rectangle {
property bool isVertical: axis?.isVertical ?? false
property var axis: null
property real widgetThickness: 30
property real barThickness: 48
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetThickness / 30))
property string currentLayout: ""
property string hyprlandKeyboard: ""
@@ -59,7 +60,7 @@ Rectangle {
DankIcon {
name: "keyboard"
size: Theme.iconSize - 8
size: Theme.barIconSize(barThickness)
color: Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
}
@@ -73,7 +74,7 @@ Rectangle {
}
return currentLayout.substring(0, 2).toUpperCase()
}
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: Theme.barTextSize(barThickness)
font.weight: Font.Medium
color: Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
@@ -89,7 +90,7 @@ Rectangle {
StyledText {
text: currentLayout
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: Theme.barTextSize(barThickness)
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}