feat: battery, refactor

This commit is contained in:
Kat Inskip 2025-12-07 23:37:25 -08:00
parent 9ae22c832f
commit 1ba98534eb
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
15 changed files with 122 additions and 6 deletions

View file

@ -0,0 +1,53 @@
import Quickshell
import Quickshell.Widgets
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "root:/DataSources"
import "root:/Helpers"
import Quickshell.Services.Notifications
RowLayout {
required property Notification modelData_
Layout.minimumHeight: 0
Layout.preferredHeight: modelData_.actions.length > 0 ? 30 : 0
visible: modelData_.actions.length > 0
spacing: 5
Repeater {
model: modelData_.actions
delegate: Item {
required property NotificationAction modelData
width: 100
height: 30
Rectangle {
anchors.fill: parent
color: Stylix.base00
radius: 5
Text {
text: modelData.text
color: Stylix.base05
anchors.centerIn: parent
font.pixelSize: 12
anchors {
left: parent.left
leftMargin: 10
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: modelData.invoke()
}
}
}
}
}