bar: add "hella shortened" form for even narrower screens

This commit is contained in:
end-4
2025-05-24 11:44:07 +02:00
parent 0e74fc78e5
commit c8a4da6d8b
4 changed files with 32 additions and 10 deletions
+8 -2
View File
@@ -8,7 +8,9 @@ import Quickshell.Io
import Quickshell.Services.Mpris
Rectangle {
id: root
property bool borderless: ConfigOptions.bar.borderless
property bool alwaysShowAllResources: false
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
implicitHeight: 32
color: borderless ? "transparent" : Appearance.colors.colLayer1
@@ -30,14 +32,18 @@ Rectangle {
Resource {
iconName: "swap_horiz"
percentage: ResourceUsage.swapUsedPercentage
shown: (ConfigOptions.bar.resources.alwaysShowSwap && percentage > 0) || (MprisController.activePlayer?.trackTitle == null)
shown: (ConfigOptions.bar.resources.alwaysShowSwap && percentage > 0) ||
(MprisController.activePlayer?.trackTitle == null) ||
root.alwaysShowAllResources
Layout.leftMargin: shown ? 4 : 0
}
Resource {
iconName: "settings_slow_motion"
percentage: ResourceUsage.cpuUsage
shown: ConfigOptions.bar.resources.alwaysShowCpu || !(MprisController.activePlayer?.trackTitle?.length > 0)
shown: ConfigOptions.bar.resources.alwaysShowCpu ||
!(MprisController.activePlayer?.trackTitle?.length > 0) ||
root.alwaysShowAllResources
Layout.leftMargin: shown ? 4 : 0
}