different icon when tracked notifs > 0
This commit is contained in:
@@ -4,6 +4,7 @@ import Quickshell
|
|||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
Variants {
|
Variants {
|
||||||
@@ -16,10 +17,6 @@ Scope {
|
|||||||
screen: modelData
|
screen: modelData
|
||||||
property var root: Quickshell.shellDir
|
property var root: Quickshell.shellDir
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
console.log(modelData.x);
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: ncProcess
|
id: ncProcess
|
||||||
command: ["sh", "-c", `qs -p ${bar.root}/shell.qml ipc call root showCenter`]
|
command: ["sh", "-c", `qs -p ${bar.root}/shell.qml ipc call root showCenter`]
|
||||||
@@ -102,10 +99,11 @@ Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
id: notificationCenterIcon
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: "\ue7f4"
|
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
|
||||||
font.family: "Material Symbols Rounded"
|
font.family: "Material Symbols Rounded"
|
||||||
font.pixelSize: 20
|
font.pixelSize: 22
|
||||||
color: "white"
|
color: "white"
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property alias hasNotifications: adapter.hasNotifications
|
||||||
|
|
||||||
|
JsonObject {
|
||||||
|
id: adapter
|
||||||
|
property bool hasNotifications: false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import QtQuick.Effects
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Services.Notifications
|
import Quickshell.Services.Notifications
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
import qs.Helpers
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
@@ -26,6 +27,14 @@ PanelWindow {
|
|||||||
|
|
||||||
mask: Region { item: backgroundRect }
|
mask: Region { item: backgroundRect }
|
||||||
|
|
||||||
|
onNotificationsChanged: {
|
||||||
|
if ( root.notifications.length > 0 ) {
|
||||||
|
HasNotifications.hasNotifications = true;
|
||||||
|
} else {
|
||||||
|
HasNotifications.hasNotifications = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
id: ipcHandler
|
id: ipcHandler
|
||||||
target: "root"
|
target: "root"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ MouseArea {
|
|||||||
property point globalPos
|
property point globalPos
|
||||||
|
|
||||||
implicitWidth: 22
|
implicitWidth: 22
|
||||||
implicitHeight: 22
|
implicitHeight: parent.height
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Rectangle {
|
|||||||
id: root
|
id: root
|
||||||
required property PanelWindow bar
|
required property PanelWindow bar
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
implicitWidth: rowL.implicitWidth + 20
|
implicitWidth: rowL.implicitWidth + 10
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 10
|
spacing: 5
|
||||||
id: rowL
|
id: rowL
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
Repeater {
|
Repeater {
|
||||||
|
|||||||
Reference in New Issue
Block a user