From 9b94c200eee644c95c7f1be1645f7b3f3593a360 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sat, 18 Apr 2026 19:04:49 +0200 Subject: [PATCH] Fix action drawer toolButtons ref and page indicator sync NotificationDrawer referenced toolButtons, a sibling defined in ContentContainer, not a local property. Add toolButtonsItem: Item and wire it at the call site. Replace the magic literal 10 with Kirigami.Units.largeSpacing while here. The PageIndicator had a one-way binding to swipeView.currentIndex that would break after a user tap. Make it bidirectional with a Connections block and a loop guard on both sides. --- .../qml/actiondrawer/private/ContentContainer.qml | 1 + .../actiondrawer/private/NotificationDrawer.qml | 6 +++++- .../qml/actiondrawer/private/QuickSettings.qml | 14 +++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/private/ContentContainer.qml b/components/mobileshell/qml/actiondrawer/private/ContentContainer.qml index 8586f57e..fb315e74 100644 --- a/components/mobileshell/qml/actiondrawer/private/ContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/private/ContentContainer.qml @@ -186,6 +186,7 @@ Item { // In convergence, cap the height so it doesn't stretch full-screen maximumHeight: isConvergence ? root.height * 0.6 : -1 + toolButtonsItem: toolButtons } // Secondary swipe area for uses in portrait. diff --git a/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml b/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml index cd634944..8a367faa 100644 --- a/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml @@ -25,6 +25,9 @@ Item { property alias notificationWidget: notificationWidget property real contentY: notificationWidget.listView.contentY + // The sibling toolbar whose height must be subtracted from the available space. + property Item toolButtonsItem: null + property real topPadding: { if (actionDrawer.mode == MobileShell.ActionDrawer.Portrait) return Kirigami.Units.largeSpacing; @@ -42,7 +45,8 @@ Item { property real maximumHeight: -1 height: { - let h = Math.min(actionDrawer.height - toolButtons.height, notificationWidget.listView.contentHeight + 10 + topMargin); + let toolH = toolButtonsItem ? toolButtonsItem.height : 0; + let h = Math.min(actionDrawer.height - toolH, notificationWidget.listView.contentHeight + Kirigami.Units.largeSpacing + topMargin); return maximumHeight > 0 ? Math.min(h, maximumHeight) : h; } diff --git a/components/mobileshell/qml/actiondrawer/private/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/private/QuickSettings.qml index 42c1a588..1ce5b8b8 100644 --- a/components/mobileshell/qml/actiondrawer/private/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/private/QuickSettings.qml @@ -241,10 +241,22 @@ Item { asynchronous: true sourceComponent: PageIndicator { + id: pageIndicatorItem count: swipeView.count currentIndex: swipeView.currentIndex interactive: true - onCurrentIndexChanged: swipeView.currentIndex = currentIndex + onCurrentIndexChanged: { + if (swipeView.currentIndex !== currentIndex) + swipeView.currentIndex = currentIndex; + } + + Connections { + target: swipeView + function onCurrentIndexChanged() { + if (pageIndicatorItem.currentIndex !== swipeView.currentIndex) + pageIndicatorItem.currentIndex = swipeView.currentIndex; + } + } delegate: Rectangle { implicitWidth: 8