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)
CustomIcon { Rectangle {
id: distroIcon id: uptimeContainer
width: 25 anchors {
height: 25 top: parent.top
source: SystemInfo.distroIcon bottom: parent.bottom
colorize: true left: parent.left
color: Appearance.colors.colOnLayer0 }
} color: Appearance.colors.colLayer1
radius: height / 2
StyledText { implicitWidth: uptimeRow.implicitWidth + 24
font.pixelSize: Appearance.font.pixelSize.normal implicitHeight: uptimeRow.implicitHeight + 8
color: Appearance.colors.colOnLayer0
text: Translation.tr("Up %1").arg(DateTime.uptime) Row {
textFormat: Text.MarkdownText id: uptimeRow
} anchors.centerIn: parent
spacing: 8
Item { CustomIcon {
Layout.fillWidth: true id: distroIcon
anchors.verticalCenter: parent.verticalCenter
width: 25
height: 25
source: SystemInfo.distroIcon
colorize: true
color: Appearance.colors.colOnLayer0
}
StyledText {
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Appearance.font.pixelSize.normal
color: Appearance.colors.colOnLayer0
text: Translation.tr("Up %1").arg(DateTime.uptime)
textFormat: Text.MarkdownText
}
}
} }
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"