From 99dd0a4e2e5765386479ba86884a5dbc062c51ca Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 25 Oct 2025 00:11:17 +0200 Subject: [PATCH] make notif status row less weird --- .../ii/modules/common/widgets/GroupButton.qml | 2 +- .../notifications/NotificationList.qml | 65 +++++++------------ .../NotificationStatusButton.qml | 11 ++-- 3 files changed, 30 insertions(+), 48 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/widgets/GroupButton.qml b/dots/.config/quickshell/ii/modules/common/widgets/GroupButton.qml index ed93eb77f..de9ce5603 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/GroupButton.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/GroupButton.qml @@ -27,7 +27,7 @@ Button { property real clickedWidth: baseWidth + (isAtSide ? 10 : 20) property real clickedHeight: baseHeight property var parentGroup: root.parent - property int indexInParent: parentGroup?.children.indexOf(root) ?? 0 + property int indexInParent: parentGroup?.children.indexOf(root) ?? -1 property int clickIndex: parentGroup?.clickIndex ?? -1 property bool isAtSide: indexInParent === 0 || indexInParent === (parentGroup?.childrenCount - 1) diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml b/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml index a54c65d01..d52d51a55 100644 --- a/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml +++ b/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationList.qml @@ -64,53 +64,32 @@ Item { } } - Item { + ButtonGroup { id: statusRow - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - - Layout.fillWidth: true - implicitHeight: Math.max( - controls.implicitHeight, - statusText.implicitHeight - ) - - StyledText { - id: statusText - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 10 - horizontalAlignment: Text.AlignHCenter - text: Translation.tr("%1 notifications").arg(Notifications.list.length) - - opacity: Notifications.list.length > 0 ? 1 : 0 - visible: opacity > 0 - Behavior on opacity { - animation: Appearance.animation.elementMove.numberAnimation.createObject(this) - } + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom } - ButtonGroup { - id: controls - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.rightMargin: 5 - - NotificationStatusButton { - buttonIcon: "notifications_paused" - buttonText: Translation.tr("Silent") - toggled: Notifications.silent - onClicked: () => { - Notifications.silent = !Notifications.silent; - } + NotificationStatusButton { + Layout.fillWidth: false + buttonIcon: "notifications_paused" + toggled: Notifications.silent + onClicked: () => { + Notifications.silent = !Notifications.silent; } - NotificationStatusButton { - buttonIcon: "clear_all" - buttonText: Translation.tr("Clear") - onClicked: () => { - Notifications.discardAllNotifications() - } + } + NotificationStatusButton { + enabled: false + Layout.fillWidth: true + buttonText: Translation.tr("%1 notifications").arg(Notifications.list.length) + } + NotificationStatusButton { + Layout.fillWidth: false + buttonIcon: "clear_all" + onClicked: () => { + Notifications.discardAllNotifications() } } } diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml b/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml index d6001a3a9..2609b5f56 100644 --- a/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml +++ b/dots/.config/quickshell/ii/modules/sidebarRight/notifications/NotificationStatusButton.qml @@ -5,11 +5,12 @@ import QtQuick.Layouts GroupButton { id: button - property string buttonText: "" property string buttonIcon: "" + property string buttonText: "" - baseWidth: content.implicitWidth + 10 * 2 - baseHeight: 30 + baseHeight: 36 + baseWidth: content.implicitWidth + 46 + clickedWidth: baseWidth + 6 buttonRadius: baseHeight / 2 buttonRadiusPressed: Appearance.rounding.small @@ -28,11 +29,13 @@ GroupButton { anchors.centerIn: parent spacing: 5 MaterialSymbol { + visible: buttonIcon !== "" text: buttonIcon - iconSize: Appearance.font.pixelSize.large + iconSize: Appearance.font.pixelSize.huge color: button.colText } StyledText { + visible: buttonText !== "" text: buttonText font.pixelSize: Appearance.font.pixelSize.small color: button.colText