feat: basic quickshell setup

This commit is contained in:
2026-06-14 14:30:09 +02:00
parent d2e569114f
commit 940ee3e988
23 changed files with 477 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
import QtQuick
import QtQuick.Layouts
import "../config/"
// Mostly from here: https://github.com/ChrisTitusTech/quickshell/blob/main/bar/BarBlock.qml
Rectangle {
id: root
radius: Appearance.rounding.barItems
Layout.preferredWidth: contentContainer.implicitWidth + 20
Layout.preferredHeight: 30
property Item content: Text {
text: "No content"
}
property bool hoverEnabled: false
property Item mouseArea: mouseArea
property bool dim: false
property var onClicked: function () {}
property int leftPadding
property int rightPadding
// Background color
color: {
if (mouseArea.containsMouse)
return Appearance.colors.m3primary;
return Appearance.colors.m3background;
}
states: [
State {
when: mouseArea.containsMouse
PropertyChanges {
target: root
}
}
]
Behavior on color {
ColorAnimation {
duration: 200
}
}
Item {
// Contents of the bar block
id: contentContainer
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
anchors.centerIn: parent
children: content
}
MouseArea {
enabled: root.hoverEnabled
id: mouseArea
anchors.fill: root
hoverEnabled: true
acceptedButtons: Qt.LeftButton
onClicked: root.onClicked()
}
}