diff --git a/quickshell/Modals/DLauncherV2/Components/LauncherMetrics.qml b/quickshell/Modals/DLauncherV2/Components/LauncherMetrics.qml index 8017335e4..9a2b78ab2 100644 --- a/quickshell/Modals/DLauncherV2/Components/LauncherMetrics.qml +++ b/quickshell/Modals/DLauncherV2/Components/LauncherMetrics.qml @@ -41,9 +41,8 @@ Singleton { readonly property real spotlightWidth: Theme.launcherWidthWide readonly property real spotlightTopFraction: 0.33 readonly property real spotlightInset: Theme.spacingM - readonly property real islandBottomInset: 18 - // The footerless island sheet ends in ResultsList's spacingS plus its bottom inset, not spacingM. - readonly property real islandEdgeInset: islandBottomInset + Theme.spacingS - Theme.spacingM + // The footerless island sheet adds ResultsList's spacingS below its spacingM margin. + readonly property real islandEdgeInset: Theme.spacingS FontMetrics { id: tileLabelMetrics diff --git a/quickshell/Modals/DLauncherV2/LauncherContent.qml b/quickshell/Modals/DLauncherV2/LauncherContent.qml index 84b782d62..18997c9b4 100644 --- a/quickshell/Modals/DLauncherV2/LauncherContent.qml +++ b/quickshell/Modals/DLauncherV2/LauncherContent.qml @@ -675,7 +675,6 @@ FocusScope { focusReturnTarget: searchField keyForwardTargets: [root] anchors.fill: parent - fitGridRows: true resizing: actionPanel.animating controller: root.controller leadingSectionHeaderAtBottom: contentHolder.inverted diff --git a/quickshell/Modals/DLauncherV2/ResultsList.qml b/quickshell/Modals/DLauncherV2/ResultsList.qml index 7ee464053..82a394aa4 100644 --- a/quickshell/Modals/DLauncherV2/ResultsList.qml +++ b/quickshell/Modals/DLauncherV2/ResultsList.qml @@ -34,9 +34,10 @@ Item { readonly property int _densityLevel: Theme.densityLevel readonly property int pageRows: Math.max(1, Math.floor((height - LauncherMetrics.fadeLength) / (LauncherMetrics.rowHeight + LauncherMetrics.rowGap))) property real availableHeight: 0 - property bool fitGridRows: false // Set while the host animates height, so fitted cells settle once instead of every frame - property bool resizing: false + required property bool resizing + // Content-sized hosts follow fittedHeight, so their cells fit the budget rather than the current height + readonly property real _fitSpace: availableHeight > 0 ? availableHeight : height readonly property real fittedHeight: { const rows = _visualModel.rows; const starts = _visualModel.heights; @@ -132,8 +133,8 @@ Item { var cols = root.controller?.getGridColumns(sectionId) ?? root.gridColumns; var cellWidth = Math.floor(root.width / cols); var cellHeight = mode === "tile" ? cellWidth * LauncherMetrics.tileImageRatio : cellWidth + LauncherMetrics.tileLabelHeight; - var gridSpace = root.height - sectionBand - LauncherMetrics.fadeLength; - if (root.fitGridRows && mode === "grid" && gridSpace > 0) { + var gridSpace = root._fitSpace - sectionBand - LauncherMetrics.fadeLength; + if (mode === "grid" && gridSpace > 0) { // Never aim below what the icon and label need var target = Math.max(cellHeight * LauncherMetrics.gridDensityScale, Math.min(cellHeight, LauncherMetrics.tileMinHeight)); cellHeight = gridSpace / Math.max(1, Math.round(gridSpace / target)); @@ -204,12 +205,12 @@ Item { onGridColumnsChanged: rebuildTimer.restart() onWidthChanged: rebuildTimer.restart() - onHeightChanged: _settleHeight() + on_FitSpaceChanged: _settleHeight() onResizingChanged: _settleHeight() // Only fitted grid cells depend on height function _settleHeight() { - if (!fitGridRows || resizing) + if (resizing) return; if (_visualModel.hasGrid) rebuildTimer.restart(); diff --git a/quickshell/Modals/DLauncherV2/SpotlightLauncherContent.qml b/quickshell/Modals/DLauncherV2/SpotlightLauncherContent.qml index 3f8d93f77..d21d9411c 100644 --- a/quickshell/Modals/DLauncherV2/SpotlightLauncherContent.qml +++ b/quickshell/Modals/DLauncherV2/SpotlightLauncherContent.qml @@ -440,6 +440,7 @@ FocusScope { keyForwardTargets: [searchKeyHandler] readonly property real bottomInset: Theme.spacingS availableHeight: Math.max(0, root._maxResultsH - root._resultsTopGap - bottomInset) + resizing: actionPanel.animating anchors.fill: parent anchors.topMargin: root._resultsTopGap controller: root.controller diff --git a/quickshell/Modules/DIsland/Activities/LauncherExpanded.qml b/quickshell/Modules/DIsland/Activities/LauncherExpanded.qml index 82d1d9f7c..e394a7c22 100644 --- a/quickshell/Modules/DIsland/Activities/LauncherExpanded.qml +++ b/quickshell/Modules/DIsland/Activities/LauncherExpanded.qml @@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound import QtQuick import qs.Common import qs.Modals.DLauncherV2 -import qs.Modals.DLauncherV2.Components FocusScope { id: root @@ -16,7 +15,6 @@ FocusScope { property real screenHeight: effectiveScreen?.height ?? 1080 property real alignedX: 0 property real alignedY: 0 - property real bottomInset: LauncherMetrics.islandBottomInset clip: true @@ -69,17 +67,14 @@ FocusScope { id: launcherContent anchors.fill: parent - anchors.leftMargin: Theme.spacingM - anchors.rightMargin: Theme.spacingM - anchors.topMargin: Theme.spacingM - anchors.bottomMargin: root.bottomInset + anchors.margins: Theme.spacingM parentModal: hostContract resultsInset: 0 controllerOverride: root.launcherController transientSurfaceTracker: root.transientSurfaceTracker showResultsWithoutQuery: true resizeAnimated: false - maxResultsHeight: Math.max(120, root.controller.launcherExpandedTarget.height - Theme.spacingM - root.bottomInset - launcherContent.searchAreaHeight - launcherContent.actionPanelHeight) + maxResultsHeight: Math.max(120, root.controller.launcherExpandedTarget.height - Theme.spacingM * 2 - launcherContent.searchAreaHeight - launcherContent.actionPanelHeight) } onActiveFocusChanged: root.controller.launcherInputFocused = activeFocus