notif actions fix

This commit is contained in:
Zacharias-Brohn
2026-02-05 15:47:32 +01:00
parent fa9bdca241
commit 73a3b85141
13 changed files with 225 additions and 624 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ import qs.Components
import qs.Config
import qs.Modules
import qs.Daemons
import qs.Helpers
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
@@ -20,7 +21,7 @@ CustomRect {
property bool expanded: Config.notifs.openExpanded
color: root.modelData.urgency === NotificationUrgency.Critical ? DynamicColors.palette.m3secondaryContainer : DynamicColors.tPalette.m3surfaceContainer
radius: Appearance.rounding.normal
radius: 8
implicitWidth: Config.notifs.sizes.width
implicitHeight: inner.implicitHeight
@@ -113,6 +114,7 @@ CustomRect {
width: Config.notifs.sizes.image
height: Config.notifs.sizes.image
visible: root.hasImage || root.hasAppIcon
asynchronous: true
sourceComponent: ClippingRectangle {
radius: 1000
@@ -138,6 +140,7 @@ CustomRect {
anchors.verticalCenter: root.hasImage ? undefined : image.verticalCenter
anchors.right: root.hasImage ? image.right : undefined
anchors.bottom: root.hasImage ? image.bottom : undefined
asynchronous: true
sourceComponent: CustomRect {
radius: 1000
@@ -151,6 +154,7 @@ CustomRect {
active: root.hasAppIcon
anchors.centerIn: parent
asynchronous: true
width: Math.round(parent.width * 0.6)
height: Math.round(parent.width * 0.6)
@@ -167,6 +171,7 @@ CustomRect {
anchors.centerIn: parent
anchors.horizontalCenterOffset: -18 * 0.02
anchors.verticalCenterOffset: 18 * 0.02
asynchronous: true
sourceComponent: MaterialIcon {
text: Icons.getNotifIcon(root.modelData.summary, root.modelData.urgency)
+1 -1
View File
@@ -129,7 +129,7 @@ CustomRect {
Layout.fillWidth: true
textFormat: Text.MarkdownText
text: root.modelData.body.replace(/(.)\n(?!\n)/g, "$1\n\n") || qsTr("No body here! :/")
text: root.modelData.body.replace(/(.)\n(?!\n)/g, "$1\n\n") || qsTr("No body given")
color: root.modelData.urgency === "critical" ? DynamicColors.palette.m3secondary : DynamicColors.palette.m3onSurface
wrapMode: Text.WordWrap
@@ -17,71 +17,6 @@ Item {
Layout.fillWidth: true
implicitHeight: flickable.contentHeight
layer.enabled: true
layer.smooth: true
layer.effect: OpacityMask {
maskSource: gradientMask
}
Item {
id: gradientMask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
position: 0
color: Qt.rgba(0, 0, 0, 0)
}
GradientStop {
position: 0.1
color: Qt.rgba(0, 0, 0, 1)
}
GradientStop {
position: 0.9
color: Qt.rgba(0, 0, 0, 1)
}
GradientStop {
position: 1
color: Qt.rgba(0, 0, 0, 0)
}
}
}
Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
implicitWidth: parent.width / 2
opacity: flickable.contentX > 0 ? 0 : 1
Behavior on opacity {
Anim {}
}
}
Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
implicitWidth: parent.width / 2
opacity: flickable.contentX < flickable.contentWidth - parent.width ? 0 : 1
Behavior on opacity {
Anim {}
}
}
}
CustomFlickable {
id: flickable
@@ -113,8 +48,8 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
implicitWidth: actionInner.implicitWidth + 10 * 2
implicitHeight: actionInner.implicitHeight + 10 * 2
implicitWidth: actionInner.implicitWidth + 5 * 2
implicitHeight: actionInner.implicitHeight + 5 * 2
Layout.preferredWidth: implicitWidth + (actionStateLayer.pressed ? 18 : 0)
radius: actionStateLayer.pressed ? 6 / 2 : 6
@@ -123,7 +58,7 @@ Item {
Timer {
id: copyTimer
interval: 3000
interval: 1000
onTriggered: actionInner.item.text = "content_copy"
}
@@ -91,13 +91,6 @@ Item {
sourceComponent: ColumnLayout {
spacing: 20
Image {
asynchronous: true
source: Qt.resolvedUrl(`${Quickshell.shellDir}/assets/dino.png`)
fillMode: Image.PreserveAspectFit
sourceSize.width: clipRect.width * 0.8
}
CustomText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("No Notifications")
@@ -35,7 +35,6 @@ Item {
map.set(n.appName, null);
for (const n of NotifServer.list)
map.set(n.appName, null);
console.log(map.keys())
return [...map.keys()];
}
onValuesChanged: root.flagChanged()
@@ -52,8 +51,9 @@ Item {
property int startY
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)) {
n.close();
}
}
y: {