From b42425ca561b12d61eb59077e66caaa728040e87 Mon Sep 17 00:00:00 2001 From: lucy Date: Thu, 28 May 2026 20:36:51 +0200 Subject: [PATCH] fix notification styling --- .../wall-theme-switcher/WallThemeSwitcher.qml | 1 + modules/notifications/NotiCard.qml | 157 +++++++++--------- 2 files changed, 80 insertions(+), 78 deletions(-) create mode 100644 modules/applets/wall-theme-switcher/WallThemeSwitcher.qml diff --git a/modules/applets/wall-theme-switcher/WallThemeSwitcher.qml b/modules/applets/wall-theme-switcher/WallThemeSwitcher.qml new file mode 100644 index 0000000..83f9bc3 --- /dev/null +++ b/modules/applets/wall-theme-switcher/WallThemeSwitcher.qml @@ -0,0 +1 @@ +import Quickshell diff --git a/modules/notifications/NotiCard.qml b/modules/notifications/NotiCard.qml index d809017..0b0cad2 100644 --- a/modules/notifications/NotiCard.qml +++ b/modules/notifications/NotiCard.qml @@ -7,85 +7,86 @@ import qs.settings import qs.widgets WrapperRectangle { - id: root - required property var notification - required property ShellScreen nScreen - implicitWidth: nScreen.width / 6 - implicitHeight: 100 - radius: Config.rounding - anchors.right: parent?.right - color: Colors.base01 - clip: true - Timer { - id: dismissTimer - running: true - interval: 5000 - repeat: false - onTriggered: root.notification?.dismiss() - } - child: WrapperMouseArea { - id: mouseHandler - child: RowLayout { - spacing: 10 - IconImage { - id: appIcon - Layout.leftMargin: 8 - visible: root.notification?.image ? true : false - source: root.notification?.image ? root.notification.image : '' - implicitSize: 64 - } - ColumnLayout { - Layout.alignment: Qt.AlignLeft - Layout.fillWidth: true - Layout.preferredWidth: 0 - Layout.fillHeight: true - Layout.leftMargin: appIcon.visible ? 0 : 16 - RowLayout { - Layout.alignment: Qt.AlignTop - MaterialIcon { - text: "\ue7f4" - font.pixelSize: 12 - } - StyledText { - id: appId - text: root.notification?.appName ? root.notification.appName : '' - opacity: 0.4 - } + id: root + required property var notification + required property ShellScreen nScreen + implicitWidth: nScreen.width / 6 + implicitHeight: 100 + radius: Config.rounding + anchors.right: parent?.right + color: Colors.base01 + clip: true + Timer { + id: dismissTimer + running: true + interval: 5000 + repeat: false + onTriggered: root.notification?.dismiss() + } + child: WrapperMouseArea { + id: mouseHandler + child: RowLayout { + spacing: 10 + IconImage { + id: appIcon + Layout.leftMargin: 8 + visible: root.notification?.image ? true : false + source: root.notification?.image ? root.notification.image : '' + implicitSize: 64 + } + ColumnLayout { + Layout.alignment: Qt.AlignLeft + Layout.fillWidth: true + Layout.preferredWidth: 0 + Layout.fillHeight: true + Layout.leftMargin: appIcon.visible ? 0 : 16 + RowLayout { + Layout.alignment: Qt.AlignTop + MaterialIcon { + text: "\ue7f4" + font.pixelSize: 12 + } + StyledText { + id: appId + text: root.notification?.appName ? root.notification.appName : '' + opacity: 0.4 + } + } + ColumnLayout { + spacing: 0 + Layout.rightMargin: 40 + StyledText { + id: title + Layout.bottomMargin: 0 + Layout.topMargin: 5 + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + text: root.notification?.summary == null ? '' : root.notification.summary + elide: Text.ElideRight + } + StyledText { + id: body + Layout.alignment: Qt.AlignBottom + text: root.notification?.body ? root.notification.body : '' + elide: Text.ElideRight + maximumLineCount: 1 + Layout.fillWidth: true + opacity: 0.6 + } + } + } } - ColumnLayout { - spacing: 0 - StyledText { - id: title - Layout.bottomMargin: 0 - Layout.topMargin: 5 - Layout.alignment: Qt.AlignBottom - Layout.fillWidth: true - text: root.notification?.summary == null ? '' : root.notification.summary - elide: Text.ElideRight - } - StyledText { - id: body - Layout.alignment: Qt.AlignBottom - text: root.notification?.body ? root.notification.body : '' - elide: Text.ElideRight - maximumLineCount: 1 - Layout.fillWidth: true - opacity: 0.6 - } + acceptedButtons: Qt.LeftButton + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + onEntered: { + root.color = Colors.base03; + } + onExited: { + root.color = Colors.base01; + } + onClicked: { + root.notification ? root.notification.dismiss() : ''; } - } } - acceptedButtons: Qt.LeftButton - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - onEntered: { - root.color = Colors.base03; - } - onExited: { - root.color = Colors.base01; - } - onClicked: { - root.notification ? root.notification.dismiss() : ''; - } - } }