controlcenter: converted taskbar panel to single pane view

This commit is contained in:
ATMDA 2025-11-17 09:24:28 -05:00
parent f248051904
commit 2c91bde795

View file

@ -13,7 +13,7 @@ import Quickshell.Widgets
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
RowLayout { Item {
id: root id: root
required property Session session required property Session session
@ -49,8 +49,6 @@ RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0
Component.onCompleted: { Component.onCompleted: {
// Update entries // Update entries
if (Config.bar.entries) { if (Config.bar.entries) {
@ -120,43 +118,31 @@ RowLayout {
id: entriesModel id: entriesModel
} }
Item {
id: leftTaskbarItem
Layout.preferredWidth: Math.floor(parent.width * 0.4)
Layout.minimumWidth: 420
Layout.fillHeight: true
ClippingRectangle { ClippingRectangle {
id: leftTaskbarClippingRect id: taskbarClippingRect
anchors.fill: parent anchors.fill: parent
anchors.margins: Appearance.padding.normal anchors.margins: Appearance.padding.normal
anchors.leftMargin: 0
anchors.rightMargin: Appearance.padding.normal / 2
radius: leftTaskbarBorder.innerRadius radius: taskbarBorder.innerRadius
color: "transparent" color: "transparent"
Loader { Loader {
id: leftTaskbarLoader id: taskbarLoader
anchors.fill: parent anchors.fill: parent
anchors.margins: Appearance.padding.large + Appearance.padding.normal anchors.margins: Appearance.padding.large * 2
anchors.leftMargin: Appearance.padding.large
anchors.rightMargin: Appearance.padding.large + Appearance.padding.normal / 2
asynchronous: true asynchronous: true
sourceComponent: leftTaskbarContentComponent sourceComponent: taskbarContentComponent
} }
} }
InnerBorder { InnerBorder {
id: leftTaskbarBorder id: taskbarBorder
leftThickness: 0
rightThickness: Appearance.padding.normal / 2
} }
Component { Component {
id: leftTaskbarContentComponent id: taskbarContentComponent
StyledFlickable { StyledFlickable {
id: sidebarFlickable id: sidebarFlickable
@ -620,104 +606,4 @@ RowLayout {
} }
} }
} }
}
Item {
id: rightTaskbarItem
Layout.fillWidth: true
Layout.fillHeight: true
ClippingRectangle {
id: rightTaskbarClippingRect
anchors.fill: parent
anchors.margins: Appearance.padding.normal
anchors.leftMargin: 0
anchors.rightMargin: Appearance.padding.normal / 2
radius: rightTaskbarBorder.innerRadius
color: "transparent"
Loader {
id: rightTaskbarLoader
anchors.fill: parent
anchors.margins: Appearance.padding.large * 2
asynchronous: true
sourceComponent: rightTaskbarContentComponent
}
}
InnerBorder {
id: rightTaskbarBorder
leftThickness: Appearance.padding.normal / 2
}
Component {
id: rightTaskbarContentComponent
StyledFlickable {
flickableDirection: Flickable.VerticalFlick
contentHeight: contentLayout.height
StyledScrollBar.vertical: StyledScrollBar {
flickable: parent
}
ColumnLayout {
id: contentLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: Appearance.spacing.normal
MaterialIcon {
Layout.alignment: Qt.AlignHCenter
text: "task_alt"
font.pointSize: Appearance.font.size.extraLarge * 3
font.bold: true
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Taskbar Settings")
font.pointSize: Appearance.font.size.large
font.bold: true
}
StyledText {
Layout.topMargin: Appearance.spacing.large
Layout.alignment: Qt.AlignHCenter
text: qsTr("Clock")
font.pointSize: Appearance.font.size.larger
font.weight: 500
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: root.clockShowIcon ? qsTr("Clock icon enabled") : qsTr("Clock icon disabled")
color: Colours.palette.m3outline
}
StyledText {
Layout.topMargin: Appearance.spacing.large
Layout.alignment: Qt.AlignHCenter
text: qsTr("Taskbar Entries")
font.pointSize: Appearance.font.size.larger
font.weight: 500
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Configure which entries appear in the taskbar")
color: Colours.palette.m3outline
}
}
}
}
}
} }