From 69fc822ffdb74bc40cae30e9bb6c12bad920760f Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 27 Oct 2026 13:01:55 -0400 Subject: [PATCH] cc: fix band expansion of footer items port 2.0 (cherry picked from commit 2609b49846897ca3172e1f4b93ab0b2ce7a14614) --- .../Modules/ControlCenter/Components/CcDetailBand.qml | 6 +++++- .../Modules/ControlCenter/ControlCenterContent.qml | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/quickshell/Modules/ControlCenter/Components/CcDetailBand.qml b/quickshell/Modules/ControlCenter/Components/CcDetailBand.qml index c918d9009..c2733bea4 100644 --- a/quickshell/Modules/ControlCenter/Components/CcDetailBand.qml +++ b/quickshell/Modules/ControlCenter/Components/CcDetailBand.qml @@ -31,17 +31,21 @@ FocusScope { property string shownSection: "" readonly property var pageItem: pageLoader.item + readonly property bool pluginPage: shownSection.startsWith("plugin_") || shownSection.startsWith("builtin_") + // A page measures itself a tick after it loads; waiting for that keeps the first target the final one. readonly property real pageHeight: { const own = pageItem?.implicitHeight ?? 0; if (own > 0) return own; + if (!pluginPage) + return 0; const preferred = pageItem?.preferredHeight ?? 0; return preferred > 0 ? preferred : CcMetrics.detailHeightDefault; } // The band's extent includes the gap above and below its card, so they grow and shrink with it. readonly property real chromeHeight: CcMetrics.gridGap * 2 + CcMetrics.detailHeaderHeight + CcMetrics.detailDialogPadding * 2 readonly property real contentCap: Math.max(CcMetrics.detailHeightFloor(shownSection, pageItem?.preferredHeight ?? 0), maximumHeight - chromeHeight) - readonly property real targetHeight: section === "" ? 0 : chromeHeight + Math.min(pageHeight, contentCap) + readonly property real targetHeight: section === "" || pageHeight <= 0 ? 0 : chromeHeight + Math.min(pageHeight, contentCap) readonly property bool transitioning: heightAnimation.running // Only IPC can ask for a plugin section whose tile is not placed, so there is nothing to show. readonly property bool pageEmpty: pageItem?.empty === true diff --git a/quickshell/Modules/ControlCenter/ControlCenterContent.qml b/quickshell/Modules/ControlCenter/ControlCenterContent.qml index e8ec7889b..ad3e3ca2c 100644 --- a/quickshell/Modules/ControlCenter/ControlCenterContent.qml +++ b/quickshell/Modules/ControlCenter/ControlCenterContent.qml @@ -47,8 +47,10 @@ FocusScope { readonly property real dragRoom: widgetGrid.dragging && (host.growsFromTop ?? true) && widgetGrid.pinnedHeight + newRowUnit <= availableGridHeight ? newRowUnit : 0 readonly property real newRowUnit: CcMetrics.gridGap + widgetGrid.slotLayout.rowUnit // Held during a drag so the trash never moves under the pointer. - readonly property real heldGridHeight: widgetGrid.dragging ? widgetGrid.pinnedHeight + dragRoom : gridTargetHeight - readonly property real targetImplicitHeight: CcMetrics.sheetPadding * 2 + heldGridHeight + readonly property real heldGridHeight: widgetGrid.dragging ? widgetGrid.pinnedHeight + dragRoom : gridHeight + // The popout sizes to where the band is going; the content inside follows the band frame by frame. + readonly property real targetImplicitHeight: CcMetrics.sheetPadding * 2 + (widgetGrid.dragging ? heldGridHeight : gridTargetHeight) + readonly property bool contentOverflows: targetImplicitHeight > (host.availableHeight ?? Infinity) property Item detailReturnFocus: null property var pageHistory: [] // One string so Discard and undo can compare and restore the whole session state at once. @@ -128,9 +130,9 @@ FocusScope { host.collapseAll(); } - // Followed while the band grows, so it stays in view however the popout and the grid settle around it. + // Only a popout the screen has capped scrolls; otherwise it grows around the band and any scroll would bounce. function revealDetail() { - if (detailBand.section === "") + if (detailBand.section === "" || !contentOverflows) return; const top = mainColumn.y + body.y + detailBand.y; contentFlickable.revealRange(top, top + detailBand.height);