new_dots/configuration/modules/dots/quick_shell/config/SideBar.qml
2026-03-13 17:56:47 +01:00

143 lines
3.7 KiB
QML

pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Controls
PanelWindow {
id: sideBar
required property var clock
required property color bgColor
required property color recColor
required property color fontColor
required property int fontSize
required property int barWidth
required property int recRadius
required property int recLength
required property int myMargin
required property int edgeMargin
required property bool powerExpanderOpen
required property bool calendarExpanderOpen
anchors.top: true
anchors.left: true
anchors.bottom: true
implicitWidth: sideBar.barWidth
color: sideBar.bgColor
Rectangle {
id: logo
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: sideBar.edgeMargin
}
implicitHeight: sideBar.recLength
implicitWidth: sideBar.recLength
radius: sideBar.recRadius
color: sideBar.recColor
Image {
anchors.centerIn: parent
source: "file://" + Quickshell.shellDir + "/assets/logo.svg"
sourceSize.width: 30
sourceSize.height: 30
}
}
Rectangle {
id: workspaces
anchors {
horizontalCenter: parent.horizontalCenter
top: logo.bottom
topMargin: sideBar.myMargin
}
implicitHeight: 200
implicitWidth: sideBar.recLength
radius: sideBar.recRadius
color: sideBar.recColor
Text {
anchors.centerIn: parent
color: sideBar.fontColor
font.pixelSize: sideBar.fontSize
text: "ws"
}
}
Rectangle {
id: notifications
anchors {
horizontalCenter: parent.horizontalCenter
bottom: time.top
bottomMargin: sideBar.myMargin
}
implicitHeight: sideBar.recLength
implicitWidth: sideBar.recLength
radius: sideBar.recRadius
color: sideBar.recColor
Text {
anchors.centerIn: parent
color: sideBar.fontColor
font.pixelSize: sideBar.fontSize
text: "notif"
}
}
Rectangle {
id: time
anchors {
horizontalCenter: parent.horizontalCenter
bottom: power.top
bottomMargin: sideBar.myMargin
}
implicitHeight: sideBar.recLength
implicitWidth: sideBar.recLength
radius: sideBar.recRadius
color: sideBar.recColor
property real hello: time.y
Button {
anchors.fill: parent
opacity: 0
onClicked: sideBar.calendarExpanderOpen = !sideBar.calendarExpanderOpen
}
Text {
anchors.centerIn: parent
color: sideBar.fontColor
font.pixelSize: sideBar.fontSize
text: Qt.formatDateTime(sideBar.clock.date, "hh\nmm")
}
}
Rectangle {
id: power
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: sideBar.edgeMargin
}
implicitHeight: sideBar.recLength
implicitWidth: sideBar.recLength
radius: sideBar.recRadius
color: sideBar.recColor
Button {
anchors.fill: parent
opacity: 0
onClicked: sideBar.powerExpanderOpen = !sideBar.powerExpanderOpen
}
Image {
anchors.centerIn: parent
source: "file://" + Quickshell.shellDir + "/assets/power.svg"
sourceSize.width: 28
sourceSize.height: 28
}
}
}