Files
dotfiles/dotfiles/.config/quickshell/modules/bar/Bar.qml
thomas e563ec22d2 Feature: Shorter bar labels on narrow screens
Bar.qml switches ActiveWindow and MediaPlayer to tighter truncation
limits when the bar is narrower than compactBarWidth (1600px), so on
the laptop's eDP-1 they don't crowd the centre clock/weather group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 09:24:49 +01:00

68 lines
1.7 KiB
QML

import Quickshell
import Quickshell.Wayland
import QtQuick
import QtQuick.Layouts
import "../../config"
PanelWindow {
id: bar
anchors {
top: true
left: true
right: true
}
implicitHeight: Appearance.barHeight
exclusiveZone: implicitHeight
color: "transparent"
// Narrow screen (laptop): shorten the left-side free-text labels so they
// don't crowd the centre group.
readonly property bool compact: width < Appearance.compactBarWidth
WlrLayershell.layer: WlrLayer.Top
WlrLayershell.namespace: "quickshell:bar"
Rectangle {
anchors.fill: parent
color: Colors.background
}
RowLayout {
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
leftMargin: Appearance.spacing
}
spacing: Appearance.spacing
Workspaces { screen: bar.screen }
MediaPlayer { barWindow: bar; compact: bar.compact }
ActiveWindow { compact: bar.compact }
}
RowLayout {
anchors.centerIn: parent
spacing: Appearance.spacing
Weather { barWindow: bar }
Clock {}
SystemUpdate { barWindow: bar }
}
RowLayout {
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
rightMargin: Appearance.spacing
}
spacing: Appearance.spacing
PinnedTray {}
TailscaleIndicator { barWindow: bar }
VpnIndicator { barWindow: bar }
NetworkIndicator { barWindow: bar }
BluetoothIndicator { barWindow: bar }
Volume { barWindow: bar }
BatteryIndicator { barWindow: bar }
PowerButton { barWindow: bar }
}
}