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

@ -1,5 +1,6 @@
import QtQuick
import "../services" as S
import NovaStats as NS
Column {
id: root
@ -15,7 +16,7 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
}
// Outgoing art - snaps to current opacity, then fades out
@ -132,7 +133,7 @@ Column {
}
GradientStop {
position: 1
color: S.Theme.base01
color: NS.ThemeService.base01
}
}
}
@ -140,9 +141,9 @@ Column {
Text {
anchors.centerIn: parent
text: "\uF001"
color: S.Theme.base04
color: NS.ThemeService.base04
font.pixelSize: 28
font.family: S.Theme.iconFontFamily
font.family: NS.ThemeService.iconFontFamily
visible: !_artImg._hasArt
}
}
@ -164,9 +165,9 @@ Column {
Text {
width: parent.width
text: S.MprisService.player?.trackTitle || "No track"
color: S.Theme.base05
font.pixelSize: S.Theme.fontSize + 1
font.family: S.Theme.fontFamily
color: NS.ThemeService.base05
font.pixelSize: NS.ThemeService.fontSize + 1
font.family: NS.ThemeService.fontFamily
font.bold: true
elide: Text.ElideRight
}
@ -180,9 +181,9 @@ Column {
const artist = Array.isArray(p.trackArtists) ? p.trackArtists.join(", ") : (p.trackArtists || "");
return [artist, p.trackAlbum].filter(s => s).join(" \u2014 ");
}
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
color: NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize - 1
font.family: NS.ThemeService.fontFamily
elide: Text.ElideRight
visible: text !== ""
}
@ -209,18 +210,18 @@ Column {
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: parent._fmtTime(parent.pos)
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
color: NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize - 2
font.family: NS.ThemeService.fontFamily
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: parent._fmtTime(parent.dur)
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
color: NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize - 2
font.family: NS.ThemeService.fontFamily
}
Item {
@ -231,7 +232,7 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 2
}
Rectangle {
@ -254,9 +255,9 @@ Column {
Text {
text: "\uF048"
color: S.MprisService.player?.canGoPrevious ? S.Theme.base05 : S.Theme.base03
font.pixelSize: S.Theme.fontSize + 4
font.family: S.Theme.iconFontFamily
color: S.MprisService.player?.canGoPrevious ? NS.ThemeService.base05 : NS.ThemeService.base03
font.pixelSize: NS.ThemeService.fontSize + 4
font.family: NS.ThemeService.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -270,8 +271,8 @@ Column {
Text {
text: S.MprisService.playing ? "\uF04C" : "\uF04B"
color: root.accentColor
font.pixelSize: S.Theme.fontSize + 8
font.family: S.Theme.iconFontFamily
font.pixelSize: NS.ThemeService.fontSize + 8
font.family: NS.ThemeService.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -283,9 +284,9 @@ Column {
Text {
text: "\uF051"
color: S.MprisService.player?.canGoNext ? S.Theme.base05 : S.Theme.base03
font.pixelSize: S.Theme.fontSize + 4
font.family: S.Theme.iconFontFamily
color: S.MprisService.player?.canGoNext ? NS.ThemeService.base05 : NS.ThemeService.base03
font.pixelSize: NS.ThemeService.fontSize + 4
font.family: NS.ThemeService.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -323,17 +324,17 @@ Column {
width: _pLabel.implicitWidth + 12
height: 18
radius: 9
color: _active ? S.Theme.base02 : (pHover.hovered ? S.Theme.base02 : "transparent")
border.color: _active ? root.accentColor : S.Theme.base03
color: _active ? NS.ThemeService.base02 : (pHover.hovered ? NS.ThemeService.base02 : "transparent")
border.color: _active ? root.accentColor : NS.ThemeService.base03
border.width: _active ? 1 : 0
Text {
id: _pLabel
anchors.centerIn: parent
text: modelData.identity ?? "Player"
color: _active ? root.accentColor : S.Theme.base04
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
color: _active ? root.accentColor : NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize - 2
font.family: NS.ThemeService.fontFamily
font.bold: _active
}