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