move Theme, SystemStats, Modules to shell/services/

This commit is contained in:
Damocles 2026-04-17 22:07:00 +02:00
parent 197f6976e0
commit 989182d603
59 changed files with 432 additions and 388 deletions

View file

@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Services.Notifications
import "." as M
import "../services" as S
// Shared notification card: background, progress bar, urgency bar, icon, text, dismiss button.
// Does NOT include dismiss animation or dismiss logic emits dismissRequested() instead.
@ -14,7 +15,7 @@ Item {
property bool dismissOnAction: true
property int iconSize: 32
property int bodyMaxLines: 3
property color accentColor: M.Theme.base0D
property color accentColor: S.Theme.base0D
signal dismissRequested
@ -34,9 +35,9 @@ Item {
// Background: base01, base02 on hover
Rectangle {
anchors.fill: parent
color: _hover.hovered ? M.Theme.base02 : M.Theme.base01
opacity: _hover.hovered ? 1.0 : Math.max(M.Theme.barOpacity, 0.9)
radius: M.Theme.radius
color: _hover.hovered ? S.Theme.base02 : S.Theme.base01
opacity: _hover.hovered ? 1.0 : Math.max(S.Theme.barOpacity, 0.9)
radius: S.Theme.radius
Behavior on color {
ColorAnimation {
@ -51,7 +52,7 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width * Math.min(1, Math.max(0, (root.notif?.hints?.value ?? 0) / 100))
color: M.Theme.base03
color: S.Theme.base03
radius: parent.radius
Behavior on width {
@ -71,7 +72,7 @@ Item {
radius: 1
color: {
const u = root.notif?.urgency ?? NotificationUrgency.Normal;
return u === NotificationUrgency.Critical ? M.Theme.base08 : u === NotificationUrgency.Low ? M.Theme.base04 : M.Theme.base0D;
return u === NotificationUrgency.Critical ? S.Theme.base08 : u === NotificationUrgency.Low ? S.Theme.base04 : S.Theme.base0D;
}
}
@ -107,9 +108,9 @@ Item {
anchors.top: parent.top
anchors.topMargin: 8
text: "\uF00D"
color: _dismissHover.hovered ? M.Theme.base08 : M.Theme.base03
font.pixelSize: M.Theme.fontSize - 1
font.family: M.Theme.iconFontFamily
color: _dismissHover.hovered ? S.Theme.base08 : S.Theme.base03
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.iconFontFamily
opacity: _hover.hovered ? 1 : 0
HoverHandler {
@ -163,9 +164,9 @@ Item {
Text {
text: root.notif?.appName ?? "Notification"
color: M.Theme.base04
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
width: parent.width - _timeText.implicitWidth - 4
elide: Text.ElideRight
}
@ -173,9 +174,9 @@ Item {
Text {
id: _timeText
text: root.notif?.timeStr ?? ""
color: M.Theme.base03
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
}
}
@ -186,9 +187,9 @@ Item {
Text {
text: root.notif?.summary ?? ""
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
font.bold: true
elide: Text.ElideRight
width: parent.width - _inlineTime.implicitWidth - 4
@ -197,9 +198,9 @@ Item {
Text {
id: _inlineTime
text: root.notif?.timeStr ?? ""
color: M.Theme.base03
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
anchors.verticalCenter: parent.verticalCenter
}
}
@ -208,9 +209,9 @@ Item {
visible: root.showAppName
width: parent.width
text: root.notif?.summary ?? ""
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
font.bold: true
elide: Text.ElideRight
wrapMode: Text.WordWrap
@ -220,9 +221,9 @@ Item {
Text {
width: parent.width
text: root.notif?.body ?? ""
color: M.Theme.base04
font.pixelSize: M.Theme.fontSize - 1
font.family: M.Theme.fontFamily
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
elide: Text.ElideRight
wrapMode: Text.WordWrap
maximumLineCount: root.bodyMaxLines
@ -243,9 +244,9 @@ Item {
required property var modelData
width: _actText.implicitWidth + 12
height: _actText.implicitHeight + 6
radius: M.Theme.radius
color: _actHover.hovered ? M.Theme.base03 : "transparent"
border.color: M.Theme.base03
radius: S.Theme.radius
color: _actHover.hovered ? S.Theme.base03 : "transparent"
border.color: S.Theme.base03
border.width: 1
Text {
@ -253,8 +254,8 @@ Item {
anchors.centerIn: parent
text: parent.modelData.text
color: root.accentColor
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
}
HoverHandler {