non important commit

This commit is contained in:
benstrb 2026-03-08 18:52:40 +01:00
parent cb2c336e17
commit 069a5df2b9
7 changed files with 259 additions and 171 deletions

View file

@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Controls
ShellRoot {
id: root
@ -17,8 +16,6 @@ ShellRoot {
property int myMargin: 10
property int edgeMargin: 15
property bool expanderOpen: false
SystemClock {
id: clock
precision: SystemClock.Minutes
@ -27,178 +24,35 @@ ShellRoot {
Variants {
model: Quickshell.screens
PanelWindow {
property var modelData
delegate: Scope {
id: delegate
required property var modelData
screen: modelData
anchors.top: true
anchors.left: true
anchors.bottom: true
property bool expanderOpen: false
implicitWidth: root.barWidth
color: root.bgColor
Rectangle {
id: logo
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: root.edgeMargin
}
implicitHeight: root.recLength
implicitWidth: root.recLength
color: root.recColor
bottomLeftRadius: root.recRadius
bottomRightRadius: root.recRadius
topLeftRadius: root.recRadius
topRightRadius: root.recRadius
Image {
anchors.centerIn: parent
source: "file://" + Quickshell.shellDir + "/assets/logo.svg"
sourceSize.width: 30
sourceSize.height: 30
}
SideBar {
clock: clock
screen: delegate.modelData
bgColor: root.bgColor
recColor: root.recColor
fontColor: root.fontColor
fontSize: root.fontSize
barWidth: root.barWidth
recRadius: root.recRadius
recLength: root.recLength
myMargin: root.myMargin
edgeMargin: root.edgeMargin
expanderOpen: delegate.expanderOpen
onExpanderOpenChanged: delegate.expanderOpen = expanderOpen
}
Rectangle {
id: workspaces
anchors {
horizontalCenter: parent.horizontalCenter
top: logo.bottom
topMargin: root.myMargin
}
implicitHeight: 200
implicitWidth: root.recLength
color: root.recColor
bottomLeftRadius: root.recRadius
bottomRightRadius: root.recRadius
topLeftRadius: root.recRadius
topRightRadius: root.recRadius
Text {
anchors.centerIn: parent
color: root.fontColor
font.pixelSize: root.fontSize
text: "ws"
}
}
Rectangle {
id: notifications
anchors {
horizontalCenter: parent.horizontalCenter
bottom: time.top
bottomMargin: root.myMargin
}
implicitHeight: root.recLength
implicitWidth: root.recLength
color: root.recColor
bottomLeftRadius: root.recRadius
bottomRightRadius: root.recRadius
topLeftRadius: root.recRadius
topRightRadius: root.recRadius
Text {
anchors.centerIn: parent
color: root.fontColor
font.pixelSize: root.fontSize
text: "notif"
}
}
Rectangle {
id: time
anchors {
horizontalCenter: parent.horizontalCenter
bottom: power.top
bottomMargin: root.myMargin
}
implicitHeight: root.recLength
implicitWidth: root.recLength
color: root.recColor
bottomLeftRadius: root.recRadius
bottomRightRadius: root.recRadius
topLeftRadius: root.recRadius
topRightRadius: root.recRadius
Text {
anchors.centerIn: parent
color: root.fontColor
font.pixelSize: root.fontSize
text: Qt.formatDateTime(clock.date, "hh\nmm")
}
}
Button {
id: power
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: root.edgeMargin
}
implicitHeight: root.recLength - 4
implicitWidth: root.recLength - 4
onClicked: root.expanderOpen = !root.expanderOpen
Rectangle {
anchors.centerIn: parent
implicitHeight: root.recLength
implicitWidth: root.recLength
color: root.recColor
bottomLeftRadius: root.recRadius
bottomRightRadius: root.recRadius
topLeftRadius: root.recRadius
topRightRadius: root.recRadius
Image {
anchors.centerIn: parent
source: "file://" + Quickshell.shellDir + "/assets/power.svg"
sourceSize.width: 28
sourceSize.height: 28
}
}
}
}
}
PanelWindow {
visible: root.expanderOpen
anchors.left: true
anchors.bottom: true
implicitWidth: 200
implicitHeight: 150
color: "transparent"
Rectangle {
anchors.fill: parent
color: root.recColor
Text {
anchors.centerIn: parent
color: root.fontColor
text: "Power Menu"
PowerPopup {
screen: delegate.modelData
expanderOpen: delegate.expanderOpen
bgColor: root.bgColor
recColor: root.recColor
recRadius: root.recRadius
barWidth: root.barWidth
}
}
}