1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-15 10:12:07 -04:00

notifications(Settings): Update notifs popout settings overflow

This commit is contained in:
purian23
2026-03-20 19:09:03 -04:00
parent a53b9afb44
commit 07dbba6c53
2 changed files with 28 additions and 10 deletions

View File

@@ -173,12 +173,18 @@ DankPopout {
property var externalKeyboardController: null property var externalKeyboardController: null
property real cachedHeaderHeight: 32 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: { implicitHeight: {
let baseHeight = Theme.spacingL * 2; let baseHeight = Theme.spacingL * 2;
baseHeight += cachedHeaderHeight; baseHeight += cachedHeaderHeight;
baseHeight += Theme.spacingM * 2; baseHeight += Theme.spacingM * 2;
const settingsHeight = notificationSettings.expanded ? notificationSettings.contentHeight : 0; const settingsHeight = notificationSettings.expanded ? Math.min(notificationSettings.naturalContentHeight, settingsMaxHeight) : 0;
const currentListHeight = root.shouldBeVisible ? notificationList.stableContentHeight : notificationList.listContentHeight; const currentListHeight = root.shouldBeVisible ? notificationList.stableContentHeight : notificationList.listContentHeight;
let listHeight = notificationHeader.currentTab === 0 ? currentListHeight : Math.max(200, NotificationService.historyList.length * 80); let listHeight = notificationHeader.currentTab === 0 ? currentListHeight : Math.max(200, NotificationService.historyList.length * 80);
if (notificationHeader.currentTab === 0 && NotificationService.groupedNotifications.length === 0) { if (notificationHeader.currentTab === 0 && NotificationService.groupedNotifications.length === 0) {
@@ -272,6 +278,7 @@ DankPopout {
NotificationSettings { NotificationSettings {
id: notificationSettings id: notificationSettings
expanded: notificationHeader.showSettings expanded: notificationHeader.showSettings
maxAllowedHeight: notificationContent.settingsMaxHeight
} }
Item { Item {

View File

@@ -6,10 +6,11 @@ Rectangle {
id: root id: root
property bool expanded: false 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 width: parent.width
height: expanded ? contentHeight : 0 height: expanded ? (maxAllowedHeight > 0 ? Math.min(naturalContentHeight, maxAllowedHeight) : naturalContentHeight) : 0
visible: expanded visible: expanded
clip: true clip: true
radius: Theme.cornerRadius radius: Theme.cornerRadius
@@ -105,6 +106,15 @@ Rectangle {
return Math.round(value / 60000) + " " + I18n.tr("minutes"); return Math.round(value / 60000) + " " + I18n.tr("minutes");
} }
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 { Column {
id: contentColumn id: contentColumn
anchors.top: parent.top anchors.top: parent.top
@@ -436,3 +446,4 @@ Rectangle {
} }
} }
} }
}