cc: fix band expansion of footer items

port 2.0

(cherry picked from commit 2609b49846)
This commit is contained in:
bbedward authored and dux-ci[bot] committed 2026-10-27 17:02:33 +00:00
1 parent 93d36ac7cd
commit 69fc822ffd
2 files changed
+11 -5

No files matched your search

@@ -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
@@ -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);