right sidebar: containerize top row elements

This commit is contained in:
end-4
2025-10-20 22:25:23 +02:00
parent 075a21a9db
commit 54fe878580
@@ -18,7 +18,7 @@ import "./volumeMixer/"
Item { Item {
id: root id: root
property int sidebarWidth: Appearance.sizes.sidebarWidth property int sidebarWidth: Appearance.sizes.sidebarWidth
property int sidebarPadding: 12 property int sidebarPadding: 10
property string settingsQmlPath: Quickshell.shellPath("settings.qml") property string settingsQmlPath: Quickshell.shellPath("settings.qml")
property bool showWifiDialog: false property bool showWifiDialog: false
property bool showBluetoothDialog: false property bool showBluetoothDialog: false
@@ -62,7 +62,8 @@ Item {
SystemButtonRow { SystemButtonRow {
Layout.fillHeight: false Layout.fillHeight: false
Layout.margins: 10 Layout.fillWidth: true
// Layout.margins: 10
Layout.topMargin: 5 Layout.topMargin: 5
Layout.bottomMargin: 0 Layout.bottomMargin: 0
} }
@@ -200,30 +201,54 @@ Item {
} }
} }
component SystemButtonRow: RowLayout { component SystemButtonRow: Item {
spacing: 10 implicitHeight: Math.max(uptimeContainer.implicitHeight, systemButtonsRow.implicitHeight)
Rectangle {
id: uptimeContainer
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
}
color: Appearance.colors.colLayer1
radius: height / 2
implicitWidth: uptimeRow.implicitWidth + 24
implicitHeight: uptimeRow.implicitHeight + 8
Row {
id: uptimeRow
anchors.centerIn: parent
spacing: 8
CustomIcon { CustomIcon {
id: distroIcon id: distroIcon
anchors.verticalCenter: parent.verticalCenter
width: 25 width: 25
height: 25 height: 25
source: SystemInfo.distroIcon source: SystemInfo.distroIcon
colorize: true colorize: true
color: Appearance.colors.colOnLayer0 color: Appearance.colors.colOnLayer0
} }
StyledText { StyledText {
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Appearance.font.pixelSize.normal font.pixelSize: Appearance.font.pixelSize.normal
color: Appearance.colors.colOnLayer0 color: Appearance.colors.colOnLayer0
text: Translation.tr("Up %1").arg(DateTime.uptime) text: Translation.tr("Up %1").arg(DateTime.uptime)
textFormat: Text.MarkdownText textFormat: Text.MarkdownText
} }
}
Item {
Layout.fillWidth: true
} }
ButtonGroup { ButtonGroup {
id: systemButtonsRow
anchors {
top: parent.top
bottom: parent.bottom
right: parent.right
}
color: Appearance.colors.colLayer1
padding: 4
QuickToggleButton { QuickToggleButton {
toggled: root.editMode toggled: root.editMode
visible: Config.options.sidebar.quickToggles.style === "android" visible: Config.options.sidebar.quickToggles.style === "android"