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
@ -22,9 +23,9 @@ Column {
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: S.SystemStats.gpuVendor.toUpperCase()
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
color: NS.ThemeService.base03
font.pixelSize: NS.ThemeService.fontSize - 3
font.family: NS.ThemeService.fontFamily
font.letterSpacing: 1
}
@ -33,9 +34,9 @@ Column {
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: S.SystemStats.gpuUsage + "%"
color: S.Theme.loadColor(S.SystemStats.gpuUsage)
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
color: S.ThemeUtil.loadColor(S.SystemStats.gpuUsage)
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.fontFamily
font.bold: true
}
}
@ -55,14 +56,14 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 3
}
Rectangle {
width: parent.width * Math.min(1, S.SystemStats.gpuUsage / 100)
height: parent.height
color: S.Theme.loadColor(S.SystemStats.gpuUsage)
color: S.ThemeUtil.loadColor(S.SystemStats.gpuUsage)
radius: 3
Behavior on width {
enabled: root.active
@ -84,7 +85,7 @@ Column {
height: 32
history: S.SystemStats.gpuHistory
strokeColor: root.accentColor
colorAt: v => S.Theme.loadColor(v)
colorAt: v => S.ThemeUtil.loadColor(v)
active: root.active
}
@ -100,9 +101,9 @@ Column {
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "VRAM"
color: S.Theme.base03
font.pixelSize: S.Theme.fontSize - 3
font.family: S.Theme.fontFamily
color: NS.ThemeService.base03
font.pixelSize: NS.ThemeService.fontSize - 3
font.family: NS.ThemeService.fontFamily
font.letterSpacing: 1
}
@ -112,8 +113,8 @@ Column {
anchors.verticalCenter: parent.verticalCenter
text: root._fmt(S.SystemStats.gpuVramUsedGb) + " / " + root._fmt(S.SystemStats.gpuVramTotalGb)
color: root.accentColor
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
font.pixelSize: NS.ThemeService.fontSize - 1
font.family: NS.ThemeService.fontFamily
font.bold: true
}
}
@ -132,7 +133,7 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 2
}
@ -158,7 +159,7 @@ Column {
height: 22
label: "Temp"
value: S.SystemStats.gpuTempC + "\u00B0C"
valueColor: S.SystemStats.gpuTempC > S.Modules.gpu.hot ? S.Theme.base08 : S.SystemStats.gpuTempC > S.Modules.gpu.warm ? S.Theme.base0A : S.Theme.base05
valueColor: S.SystemStats.gpuTempC > NS.ModulesService.gpuHot ? NS.ThemeService.base08 : S.SystemStats.gpuTempC > NS.ModulesService.gpuWarm ? NS.ThemeService.base0A : NS.ThemeService.base05
}
Item {