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

@ -3,6 +3,7 @@ import QtQuick.Effects
import Quickshell
import "." as M
import "../services" as S
import NovaStats as NS
Item {
id: root
@ -18,14 +19,14 @@ Item {
const effectiveWidth = scr.width - (S.DockState.reservedWidthAnimated ?? 0);
return Math.max(0, Math.min(1, gx / (effectiveWidth > 0 ? effectiveWidth : scr.width)));
}
property color borderColor: Qt.rgba(S.Theme.base0C.r + (S.Theme.base09.r - S.Theme.base0C.r) * _posFrac, S.Theme.base0C.g + (S.Theme.base09.g - S.Theme.base0C.g) * _posFrac, S.Theme.base0C.b + (S.Theme.base09.b - S.Theme.base0C.b) * _posFrac, 1)
property color borderColor: Qt.rgba(NS.ThemeService.base0C.r + (NS.ThemeService.base09.r - NS.ThemeService.base0C.r) * _posFrac, NS.ThemeService.base0C.g + (NS.ThemeService.base09.g - NS.ThemeService.base0C.g) * _posFrac, NS.ThemeService.base0C.b + (NS.ThemeService.base09.b - NS.ThemeService.base0C.b) * _posFrac, 1)
property bool leftEdge: false
property bool rightEdge: false
readonly property real _tlr: leftEdge ? S.Theme.screenRadius : S.Theme.radius
readonly property real _trr: rightEdge ? S.Theme.screenRadius : S.Theme.radius
readonly property real _blr: S.Theme.radius
readonly property real _brr: S.Theme.radius
readonly property real _tlr: leftEdge ? NS.ThemeService.screenRadius : NS.ThemeService.radius
readonly property real _trr: rightEdge ? NS.ThemeService.screenRadius : NS.ThemeService.radius
readonly property real _blr: NS.ThemeService.radius
readonly property real _brr: NS.ThemeService.radius
// Check children's `active` instead of visibleChildren to avoid circular
// effectiveVisible dependency: if the BarGroup is invisible, children's
@ -41,9 +42,9 @@ Item {
}
implicitWidth: row.implicitWidth + _pad * 2
implicitHeight: S.Theme.barHeight - 3 - _pad
implicitHeight: NS.ThemeService.barHeight - 3 - _pad
readonly property int _pad: S.Theme.groupPadding
readonly property int _pad: NS.ThemeService.groupPadding
property bool _hovered: false
HoverHandler {
@ -57,7 +58,7 @@ Item {
topRightRadius: root._trr
bottomLeftRadius: root._blr
bottomRightRadius: root._brr
color: Qt.rgba(S.Theme.base01.r, S.Theme.base01.g, S.Theme.base01.b, 0.55)
color: Qt.rgba(NS.ThemeService.base01.r, NS.ThemeService.base01.g, NS.ThemeService.base01.b, 0.55)
}
// Frost sheen subtle white highlight, top-heavy
@ -137,7 +138,7 @@ Item {
property real _pulse: 0.08
SequentialAnimation on _pulse {
running: root._hovered && !S.Theme.reducedMotion
running: root._hovered && !S.ThemeUtil.reducedMotion
loops: Animation.Infinite
NumberAnimation {
to: 0.22
@ -156,7 +157,7 @@ Item {
id: row
property color accentColor: root.borderColor
anchors.centerIn: parent
spacing: S.Theme.moduleSpacing + 2
spacing: NS.ThemeService.moduleSpacing + 2
}
// Separator lines overlaid between visible row children