plugin: rust-side modules + theme services with serde-typed config

This commit is contained in:
Damocles 2026-05-04 22:58:12 +02:00
parent a86e90e927
commit f34f3f2f4e
95 changed files with 2477 additions and 1011 deletions

View file

@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Wayland
import "." as M
import "../services" as S
import NovaStats as NS
PanelWindow {
id: root
@ -43,9 +44,9 @@ PanelWindow {
Text {
text: Qt.formatDateTime(clock.date, "HH")
color: S.Theme.base0D
color: NS.ThemeService.base0D
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
anchors.verticalCenter: parent.verticalCenter
}
@ -53,22 +54,22 @@ PanelWindow {
text: ":"
color: colon._colors[colon._colorIdx % colon._colors.length]
Behavior on color {
enabled: !S.Theme.reducedMotion
enabled: !S.ThemeUtil.reducedMotion
ColorAnimation {
duration: 500
}
}
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
opacity: colon.opacity
anchors.verticalCenter: parent.verticalCenter
}
Text {
text: Qt.formatDateTime(clock.date, "mm")
color: S.Theme.base0E
color: NS.ThemeService.base0E
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
anchors.verticalCenter: parent.verticalCenter
}
@ -78,7 +79,7 @@ PanelWindow {
source: glowSource
anchors.fill: glowSource
shadowEnabled: true
shadowColor: S.Theme.base0D
shadowColor: NS.ThemeService.base0D
shadowBlur: 1.0
shadowVerticalOffset: 0
shadowHorizontalOffset: 0
@ -91,10 +92,10 @@ PanelWindow {
Text {
text: Qt.formatDateTime(clock.date, "HH")
color: S.Theme.base0D
color: NS.ThemeService.base0D
opacity: 0.85
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
anchors.verticalCenter: parent.verticalCenter
}
@ -102,16 +103,16 @@ PanelWindow {
id: colon
text: ":"
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
opacity: 0.85
anchors.verticalCenter: parent.verticalCenter
property int _colorIdx: 0
readonly property var _colors: [S.Theme.base08, S.Theme.base09, S.Theme.base0A, S.Theme.base0B, S.Theme.base0C, S.Theme.base0D, S.Theme.base0E, S.Theme.base05]
readonly property var _colors: [NS.ThemeService.base08, NS.ThemeService.base09, NS.ThemeService.base0A, NS.ThemeService.base0B, NS.ThemeService.base0C, NS.ThemeService.base0D, NS.ThemeService.base0E, NS.ThemeService.base05]
color: _colors[_colorIdx % _colors.length]
Behavior on color {
enabled: !S.Theme.reducedMotion
enabled: !S.ThemeUtil.reducedMotion
ColorAnimation {
duration: 500
}
@ -139,7 +140,7 @@ PanelWindow {
Connections {
target: clock
function onDateChanged() {
if (S.Theme.reducedMotion)
if (S.ThemeUtil.reducedMotion)
return;
colon._colorIdx++;
colonAnim.restart();
@ -148,10 +149,10 @@ PanelWindow {
}
Text {
text: Qt.formatDateTime(clock.date, "mm")
color: S.Theme.base0E
color: NS.ThemeService.base0E
opacity: 0.85
font.pixelSize: 72
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.bold: true
anchors.verticalCenter: parent.verticalCenter
}
@ -163,16 +164,16 @@ PanelWindow {
id: dateText
anchors.horizontalCenter: parent.horizontalCenter
text: Qt.formatDateTime(clock.date, "dddd, dd MMMM yyyy")
color: S.Theme.base05
color: NS.ThemeService.base05
opacity: 0.5
font.pixelSize: 18
font.family: S.Theme.fontFamily
font.family: NS.ThemeService.fontFamily
font.letterSpacing: 4
layer.enabled: true
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: S.Theme.base0D
shadowColor: NS.ThemeService.base0D
shadowBlur: 0.4
shadowVerticalOffset: 0
shadowHorizontalOffset: 0
@ -187,7 +188,7 @@ PanelWindow {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 1
opacity: 0.3
}
@ -196,7 +197,7 @@ PanelWindow {
height: parent.height
color: colon._colors[colon._colorIdx % colon._colors.length]
Behavior on color {
enabled: !S.Theme.reducedMotion
enabled: !S.ThemeUtil.reducedMotion
ColorAnimation {
duration: 500
}
@ -205,7 +206,7 @@ PanelWindow {
opacity: 0.6
Behavior on width {
enabled: !S.Theme.reducedMotion
enabled: !S.ThemeUtil.reducedMotion
NumberAnimation {
duration: 50
}