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,6 +1,7 @@
import QtQuick
import Quickshell.Services.Pipewire
import "../services" as S
import NovaStats as NS
Column {
id: root
@ -11,7 +12,7 @@ Column {
property real volume: sink?.audio?.volume ?? 0
property bool muted: sink?.audio?.muted ?? false
readonly property string volumeIcon: muted ? "\uF026" : (volume > 0.5 ? "\uF028" : (volume > 0 ? "\uF027" : "\uF026"))
readonly property color volumeColor: muted ? S.Theme.base04 : root.accentColor
readonly property color volumeColor: muted ? NS.ThemeService.base04 : root.accentColor
// Slider row
Item {
@ -25,8 +26,8 @@ Column {
anchors.verticalCenter: parent.verticalCenter
text: root.volumeIcon
color: root.volumeColor
font.pixelSize: S.Theme.fontSize + 2
font.family: S.Theme.iconFontFamily
font.pixelSize: NS.ThemeService.fontSize + 2
font.family: NS.ThemeService.iconFontFamily
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -48,7 +49,7 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 3
}
Rectangle {
@ -86,9 +87,9 @@ Column {
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: Math.round(root.volume * 100) + "%"
color: root.muted ? S.Theme.base04 : S.Theme.base05
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
color: root.muted ? NS.ThemeService.base04 : NS.ThemeService.base05
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.fontFamily
width: 30
}
}
@ -113,8 +114,8 @@ Column {
leftPadding: 12
text: "Output Devices"
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
}
Repeater {
@ -134,9 +135,9 @@ Column {
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: modelData.description || modelData.name || "Unknown"
color: parent._active ? root.accentColor : S.Theme.base05
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
color: parent._active ? root.accentColor : NS.ThemeService.base05
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.fontFamily
font.bold: parent._active
elide: Text.ElideRight
}
@ -159,8 +160,8 @@ Column {
leftPadding: 12
text: "Applications"
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
}
Repeater {
@ -183,9 +184,9 @@ Column {
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: streamEntry._muted ? "\uF026" : "\uF028"
color: streamEntry._muted ? S.Theme.base04 : S.Theme.base05
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.iconFontFamily
color: streamEntry._muted ? NS.ThemeService.base04 : NS.ThemeService.base05
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.iconFontFamily
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -202,9 +203,9 @@ Column {
anchors.leftMargin: 6
anchors.verticalCenter: parent.verticalCenter
text: streamEntry._appName
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
elide: Text.ElideRight
width: 70
}
@ -220,13 +221,13 @@ Column {
Rectangle {
anchors.fill: parent
color: S.Theme.base02
color: NS.ThemeService.base02
radius: 2
}
Rectangle {
width: parent.width * Math.min(1, Math.max(0, streamEntry._vol))
height: parent.height
color: streamEntry._muted ? S.Theme.base04 : root.accentColor
color: streamEntry._muted ? NS.ThemeService.base04 : root.accentColor
radius: 2
}
@ -253,9 +254,9 @@ Column {
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: Math.round(streamEntry._vol * 100) + "%"
color: streamEntry._muted ? S.Theme.base04 : S.Theme.base05
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.fontFamily
color: streamEntry._muted ? NS.ThemeService.base04 : NS.ThemeService.base05
font.pixelSize: NS.ThemeService.fontSize - 1
font.family: NS.ThemeService.fontFamily
width: 28
}
}