more dynamic color scheme stuff

This commit is contained in:
Zacharias-Brohn
2025-11-23 23:34:24 +01:00
parent 5a87930cad
commit 5593cce7ca
6 changed files with 58 additions and 27 deletions
+9 -3
View File
@@ -30,6 +30,7 @@ Repeater {
property bool shouldShow: false
property bool isExpanded: false
property bool collapseAnimRunning: false
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "white"
function closeAll(): void {
for ( const n of NotifServer.notClosed.filter( n => n.appName === modelData ))
@@ -111,16 +112,21 @@ Repeater {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.leftMargin: 5
text: groupColumn.modelData
color: "white"
color: groupColumn.textColor
font.pointSize: 14
font.bold: true
}
Rectangle {
id: collapseRect
property color notifyBgColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "#E53935"
property color notifyColor: Config.useDynamicColors ? DynamicColors.palette.m3onPrimary : "#FFCDD2"
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.fillHeight: true
Layout.preferredWidth: 30
color: !groupColumn.isExpanded ? "#E53935" : collapseArea.containsMouse ? "#15FFFFFF" : "transparent"
color: !groupColumn.isExpanded ? collapseRect.notifyBgColor : ( collapseArea.containsMouse ? "#15FFFFFF" : "transparent" )
radius: groupColumn.isExpanded ? 4 : height / 2
visible: true
@@ -129,7 +135,7 @@ Repeater {
text: groupColumn.isExpanded ? "\ue944" : groupColumn.notifications.length
font.family: groupColumn.isExpanded ? "Material Symbols Rounded" : "Rubik"
font.pointSize: 18
color: "white"
color: groupColumn.isExpanded ? groupColumn.textColor : collapseRect.notifyColor
}
MouseArea {
+14 -8
View File
@@ -64,15 +64,18 @@ Scope {
Rectangle {
id: backgroundRect
property color backgroundColor: Config.useDynamicColors ? DynamicColors.tPalette.m3surface : Config.baseBgColor
anchors.bottom: parent.bottom
anchors.bottomMargin: -1
anchors.bottomMargin: Config.useDynamicColors ? 0 : -1
implicitHeight: mainLayout.childrenRect.height + 20
implicitWidth: appListRect.implicitWidth
x: Math.round(( parent.width - width ) / 2 )
color: "#d01a1a1a"
color: backgroundColor
opacity: 1
border.color: Config.baseBorderColor
border.width: 1
border.width: Config.useDynamicColors ? 0 : 1
border.color: Config.useDynamicColors ? "transparent" : Config.baseBorderColor
ParallelAnimation {
id: openAnim
@@ -173,11 +176,11 @@ Scope {
implicitWidth: appListContainer.implicitWidth + 20
implicitHeight: appListContainer.implicitHeight + 20
anchors.bottom: backgroundRect.top
anchors.bottomMargin: -1
anchors.bottomMargin: Config.useDynamicColors ? 0 : -1
color: backgroundRect.color
topRightRadius: 8
topLeftRadius: 8
border.color: backgroundRect.border.color
border.color: Config.useDynamicColors ? "transparent" : backgroundRect.border.color
clip: true
Behavior on implicitHeight {
@@ -308,6 +311,9 @@ Scope {
anchors.fill: parent
sourceComponent: ListView {
id: appListView
property color highlightColor: Config.useDynamicColors ? DynamicColors.tPalette.m3onSurface : "#FFFFFF"
anchors.fill: parent
model: ScriptModel {
id: appModel
@@ -327,8 +333,8 @@ Scope {
focus: true
highlight: Rectangle {
radius: 4
color: "#FFFFFF"
opacity: 0.08
color: appListView.highlightColor
opacity: Config.useDynamicColors ? 0.20 : 0.08
y: appListView.currentItem?.y
implicitWidth: appListView.width
+15 -7
View File
@@ -22,9 +22,9 @@ Repeater {
width: parent.width
height: contentColumn.height + 15
color: Config.baseBgColor
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : Config.baseBgColor
border.color: "#555555"
border.width: 1
border.width: Config.useDynamicColors ? 0 : 1
radius: 8
opacity: previewHidden ? 0 : 1
scale: previewHidden ? 0.7 : 1.0
@@ -124,6 +124,8 @@ Repeater {
width: parent.width
spacing: 10
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3secondaryFixed : "#FFFFFF"
IconImage {
source: groupHeader.modelData.image === "" ? Qt.resolvedUrl(groupHeader.modelData.appIcon) : Qt.resolvedUrl(groupHeader.modelData.image)
Layout.preferredWidth: 48
@@ -139,7 +141,7 @@ Repeater {
TextRender {
text: groupHeader.modelData.summary
color: "white"
color: infoRow.textColor
font.bold: true
font.pointSize: 16
elide: Text.ElideRight
@@ -149,7 +151,7 @@ Repeater {
TextRender {
text: groupHeader.modelData.body
color: "#dddddd"
color: infoRow.textColor
font.pointSize: 12
elide: Text.ElideRight
textFormat: Text.MarkdownText
@@ -169,7 +171,7 @@ Repeater {
TextRender {
text: groupHeader.modelData.timeStr
font.pointSize: 10
color: "#666666"
color: infoRow.textColor
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
}
@@ -189,18 +191,24 @@ Repeater {
Layout.fillWidth: true
Layout.preferredHeight: 30
required property var modelData
color: buttonArea.containsMouse ? "#15FFFFFF" : "#09FFFFFF"
required property int index
property color btnColor: Config.useDynamicColors ? ( actionButton.index === 0 ? DynamicColors.palette.m3primary : DynamicColors.palette.m3secondary ) : Config.accentColor.accents.primary
property color textColor: Config.useDynamicColors ? ( actionButton.index === 0 ? DynamicColors.palette.m3onPrimaryFixed : DynamicColors.palette.m3onSecondaryFixed ) : "white"
color: buttonArea.containsMouse ? DynamicColors.layer(btnColor, 0) : btnColor
radius: 4
TextRender {
anchors.centerIn: parent
text: actionButton.modelData.text
color: "white"
color: actionButton.textColor
font.pointSize: 12
}
MouseArea {
id: buttonArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
console.log( groupHeader.modelData.actions );
actionButton.modelData.invoke();
+6 -3
View File
@@ -114,12 +114,15 @@ PanelWindow {
y: 10
x: Screen.width
z: 1
property color backgroundColor: Config.useDynamicColors ? DynamicColors.tPalette.m3surface : Config.baseBgColor
implicitWidth: 400
implicitHeight: root.height - 20
color: Config.baseBgColor
color: backgroundColor
radius: 8
border.color: "#555555"
border.width: 1
border.width: Config.useDynamicColors ? 0 : 1
ColumnLayout {
anchors.fill: parent
anchors.margins: 10
@@ -129,7 +132,7 @@ PanelWindow {
Rectangle {
color: "#333333"
Layout.preferredHeight: 1
Layout.preferredHeight: Config.useDynamicColors ? 0 : 1
Layout.fillWidth: true
}
+7 -2
View File
@@ -4,8 +4,13 @@ import QtQuick
import QtQuick.Layouts
import QtQuick.Controls.FluentWinUI3
import qs.Daemons
import qs.Config
RowLayout {
id: root
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "white"
Layout.fillWidth: true
Switch {
@@ -27,7 +32,7 @@ RowLayout {
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
text: "Clear all"
color: "white"
color: root.textColor
}
Rectangle {
@@ -42,7 +47,7 @@ RowLayout {
text: "\ue0b8"
font.family: "Material Symbols Rounded"
font.pointSize: 18
color: "white"
color: root.textColor
}
MouseArea {
+7 -4
View File
@@ -26,6 +26,8 @@ PanelWindow {
property list<Region> notifRegions: []
required property bool centerShown
required property PanelWindow bar
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "white"
property color backgroundColor: Config.useDynamicColors ? DynamicColors.tPalette.m3surface : Config.baseBgColor
visible: Hyprland.monitorFor(screen).focused
Component.onCompleted: {
@@ -127,7 +129,8 @@ PanelWindow {
id: backgroundRect
implicitWidth: 400
implicitHeight: contentLayout.childrenRect.height + 16
color: Config.baseBgColor
color: root.backgroundColor
border.width: Config.useDynamicColors ? 0 : 1
border.color: "#555555"
radius: 8
@@ -161,7 +164,7 @@ PanelWindow {
Text {
text: rootItem.modelData.appName
color: "white"
color: root.textColor
font.bold: true
font.pointSize: 14
elide: Text.ElideRight
@@ -171,7 +174,7 @@ PanelWindow {
Text {
text: rootItem.modelData.summary
color: "white"
color: root.textColor
font.pointSize: 12
font.bold: true
elide: Text.ElideRight
@@ -183,7 +186,7 @@ PanelWindow {
}
Text {
text: rootItem.modelData.body
color: "#dddddd"
color: root.textColor
font.pointSize: 14
textFormat: Text.MarkdownText
elide: Text.ElideRight