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 "../services" as S
import "../modules" as M
import NovaStats as NS
// NOT safe for lock screen - notification contents may be sensitive,
// can dismiss/clear notifications and toggle DND
@ -21,9 +22,9 @@ Column {
// Clear all
Text {
text: "\uF1F8"
color: _clearHover.hovered ? S.Theme.base08 : S.Theme.base04
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.iconFontFamily
color: _clearHover.hovered ? NS.ThemeService.base08 : NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.iconFontFamily
visible: S.NotifService.count > 0
HoverHandler {
@ -38,9 +39,9 @@ Column {
// DND toggle
Text {
text: S.NotifService.dnd ? "\uDB82\uDE93" : "\uDB80\uDC9C"
color: S.NotifService.dnd ? S.Theme.base09 : S.Theme.base04
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.iconFontFamily
color: S.NotifService.dnd ? NS.ThemeService.base09 : NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.iconFontFamily
HoverHandler {
cursorShape: Qt.PointingHandCursor
@ -201,7 +202,7 @@ Column {
ListView {
id: _notifList
width: root.contentWidth
height: Math.min(contentHeight, 60 * (S.Modules.notifications.maxVisible || 10))
height: Math.min(contentHeight, 60 * (NS.ModulesService.notificationsMaxVisible || 10))
clip: true
boundsBehavior: Flickable.StopAtBounds
model: root._flatModel
@ -228,7 +229,7 @@ Column {
readonly property real _targetHeight: {
if (_type === "header")
return modelData.collapsed ? (28 + modelData.count * (S.Theme.fontSize + 4)) : 28;
return modelData.collapsed ? (28 + modelData.count * (NS.ThemeService.fontSize + 4)) : 28;
return _notifCard.implicitHeight;
}
@ -298,12 +299,12 @@ Column {
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: (28 - height) / 2
width: S.Theme.fontSize + 2
height: S.Theme.fontSize + 2
width: NS.ThemeService.fontSize + 2
height: NS.ThemeService.fontSize + 2
source: notifDelegate._type === "header" ? (notifDelegate.modelData.resolvedIcon || "") : ""
visible: status === Image.Ready
fillMode: Image.PreserveAspectFit
sourceSize: Qt.size(S.Theme.fontSize + 2, S.Theme.fontSize + 2)
sourceSize: Qt.size(NS.ThemeService.fontSize + 2, NS.ThemeService.fontSize + 2)
asynchronous: true
}
@ -315,9 +316,9 @@ Column {
height: 28
verticalAlignment: Text.AlignVCenter
text: notifDelegate._type === "header" && notifDelegate.modelData.collapsed ? "\u25B8" : "\u25BE"
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
opacity: _headerHover.hovered ? 1 : 0
}
@ -330,9 +331,9 @@ Column {
height: 28
verticalAlignment: Text.AlignVCenter
text: notifDelegate._type === "header" ? (notifDelegate.modelData.appName || "Unknown") : ""
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
}
@ -345,9 +346,9 @@ Column {
height: 28
verticalAlignment: Text.AlignVCenter
text: "\uF1F8"
color: _groupDismissHover.hovered ? S.Theme.base08 : S.Theme.base04
font.pixelSize: S.Theme.fontSize - 1
font.family: S.Theme.iconFontFamily
color: _groupDismissHover.hovered ? NS.ThemeService.base08 : NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize - 1
font.family: NS.ThemeService.iconFontFamily
opacity: _headerHover.hovered ? 1 : 0
HoverHandler {
@ -373,14 +374,14 @@ Column {
anchors.leftMargin: 10
anchors.right: parent.right
anchors.rightMargin: 10
y: 28 + index * (S.Theme.fontSize + 4)
height: S.Theme.fontSize + 4
y: 28 + index * (NS.ThemeService.fontSize + 4)
height: NS.ThemeService.fontSize + 4
verticalAlignment: Text.AlignVCenter
text: modelData
elide: Text.ElideRight
font.pixelSize: S.Theme.fontSize - 2
font.family: S.Theme.fontFamily
color: S.Theme.base04
font.pixelSize: NS.ThemeService.fontSize - 2
font.family: NS.ThemeService.fontFamily
color: NS.ThemeService.base04
}
}
}
@ -442,8 +443,8 @@ Column {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "No notifications"
color: S.Theme.base04
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.fontFamily
color: NS.ThemeService.base04
font.pixelSize: NS.ThemeService.fontSize
font.family: NS.ThemeService.fontFamily
}
}