From 1f64bb80311e0169e75a6a507fc07d909117c90c Mon Sep 17 00:00:00 2001 From: purian23 Date: Fri, 20 Mar 2026 19:09:03 -0400 Subject: [PATCH] notifications(Settings): Update notifs popout settings overflow --- .../Center/NotificationCenterPopout.qml | 12 ++++++-- .../Center/NotificationSettings.qml | 29 +++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml index e7b34c07..a5e667a2 100644 --- a/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml +++ b/quickshell/Modules/Notifications/Center/NotificationCenterPopout.qml @@ -133,13 +133,20 @@ DankPopout { property var externalKeyboardController: null property real cachedHeaderHeight: 32 + readonly property real settingsMaxHeight: { + const screenH = root.screen ? root.screen.height : 1080; + const maxPopupH = screenH * 0.8; + const overhead = cachedHeaderHeight + Theme.spacingL * 2 + Theme.spacingM * 2; + return Math.max(200, maxPopupH - overhead - 150); + } implicitHeight: { let baseHeight = Theme.spacingL * 2; baseHeight += cachedHeaderHeight; baseHeight += Theme.spacingM * 2; - const settingsHeight = notificationSettings.expanded ? notificationSettings.contentHeight : 0; - let listHeight = notificationHeader.currentTab === 0 ? notificationList.stableContentHeight : Math.max(200, NotificationService.historyList.length * 80); + const settingsHeight = notificationSettings.expanded ? Math.min(notificationSettings.naturalContentHeight, notificationContent.settingsMaxHeight) : 0; + const currentListHeight = root.shouldBeVisible ? notificationList.stableContentHeight : notificationList.listContentHeight; + let listHeight = notificationHeader.currentTab === 0 ? currentListHeight : Math.max(200, NotificationService.historyList.length * 80); if (notificationHeader.currentTab === 0 && NotificationService.groupedNotifications.length === 0) { listHeight = 200; } @@ -231,6 +238,7 @@ DankPopout { NotificationSettings { id: notificationSettings expanded: notificationHeader.showSettings + maxAllowedHeight: notificationContent.settingsMaxHeight } KeyboardNavigatedNotificationList { diff --git a/quickshell/Modules/Notifications/Center/NotificationSettings.qml b/quickshell/Modules/Notifications/Center/NotificationSettings.qml index cffa29c1..fa3a9290 100644 --- a/quickshell/Modules/Notifications/Center/NotificationSettings.qml +++ b/quickshell/Modules/Notifications/Center/NotificationSettings.qml @@ -6,10 +6,11 @@ Rectangle { id: root property bool expanded: false - readonly property real contentHeight: contentColumn.height + Theme.spacingL * 2 + property real maxAllowedHeight: 0 + readonly property real naturalContentHeight: contentColumn.height + Theme.spacingL * 2 width: parent.width - height: expanded ? contentHeight : 0 + height: expanded ? (maxAllowedHeight > 0 ? Math.min(naturalContentHeight, maxAllowedHeight) : naturalContentHeight) : 0 visible: expanded clip: true radius: Theme.cornerRadius @@ -105,13 +106,22 @@ Rectangle { return Math.round(value / 60000) + " minutes"; } - Column { - id: contentColumn - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: Theme.spacingL - spacing: Theme.spacingM + Flickable { + id: settingsFlickable + anchors.fill: parent + contentHeight: contentColumn.height + Theme.spacingL * 2 + clip: true + flickableDirection: Flickable.VerticalFlick + boundsBehavior: Flickable.DragAndOvershootBounds + interactive: root.naturalContentHeight > root.height + + Column { + id: contentColumn + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Theme.spacingL + spacing: Theme.spacingM StyledText { text: I18n.tr("Notification Settings") @@ -421,4 +431,5 @@ Rectangle { } } } + } }