From 527bb0613ef23a0bb6afdba665fb7afb7d9ce5f8 Mon Sep 17 00:00:00 2001 From: purian23 Date: Wed, 28 Oct 2026 16:30:20 -0400 Subject: [PATCH] island: match control center sheet and insets to the popout Port 2.0 (cherry picked from commit e97e41036bd4ad1aa05344ed381b14dc5464e91b) --- .../Modules/ControlCenter/CcMetrics.qml | 10 ++++----- .../Activities/ControlCenterExpanded.qml | 22 +++++++------------ quickshell/Modules/DIsland/IslandBarHost.qml | 1 - .../Modules/DIsland/IslandController.qml | 6 ++--- 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/quickshell/Modules/ControlCenter/CcMetrics.qml b/quickshell/Modules/ControlCenter/CcMetrics.qml index ba6621a0f..a565cf5a5 100644 --- a/quickshell/Modules/ControlCenter/CcMetrics.qml +++ b/quickshell/Modules/ControlCenter/CcMetrics.qml @@ -41,15 +41,13 @@ Singleton { } readonly property real maxHeightInset: 100 // Short-grid floors scale with the row unit, or compact would pad small layouts back out. - readonly property real gridScale: tileHeight / baseTileHeight - readonly property real minHeight: Math.round(300 * gridScale) - readonly property real islandMinHeight: Math.round(320 * gridScale) - readonly property real islandMaxHeight: 640 - readonly property real islandSheetInset: 30 + readonly property int minimumRows: 4 + readonly property real minHeight: sheetPadding * 2 + gridRowUnit * minimumRows + readonly property real islandInset: Theme.spacingXS readonly property real fallbackScreenHeight: 1080 readonly property real triggerWidth: 80 - // Density-free bases for Dash and gridScale. + // Density-free bases for Dash. readonly property real baseTileHeight: Theme.minimumTouchTargetSize + Theme.spacingS * 2 readonly property real baseIconBoxSize: Theme.minimumTouchTargetSize * iconScale diff --git a/quickshell/Modules/DIsland/Activities/ControlCenterExpanded.qml b/quickshell/Modules/DIsland/Activities/ControlCenterExpanded.qml index 0bf979996..4f69dd282 100644 --- a/quickshell/Modules/DIsland/Activities/ControlCenterExpanded.qml +++ b/quickshell/Modules/DIsland/Activities/ControlCenterExpanded.qml @@ -15,8 +15,7 @@ FocusScope { property real alignedWidth: 0 property real alignedHeight: 0 property QtObject resizeGeometry: null - readonly property real sideInset: Theme.spacingXS - property real bottomInset: Theme.spacingM + readonly property real inset: CcMetrics.islandInset property bool _heightReportPending: false signal windowRequested(string windowName) @@ -44,7 +43,7 @@ FocusScope { root._heightReportPending = true; Qt.callLater(() => { root._heightReportPending = false; - root.controller.setDestinationContentHeight("controlcenter", content.targetImplicitHeight + Theme.spacingXS + root.bottomInset); + root.controller.setDestinationContentHeight("controlcenter", content.targetImplicitHeight + root.inset * 2); }); } @@ -58,9 +57,9 @@ FocusScope { readonly property int gridColumnCap: root.controller.controlCenterColumnCap readonly property int gridColumns: root.controller.controlCenterColumns - readonly property real availableHeight: root.controller.controlCenterMaxHeight - Theme.spacingXS - root.bottomInset - readonly property real sheetContentWidth: root.controller.controlCenterSheetWidth + root.controller.controlCenterSheetInset - root.sideInset * 2 - readonly property real renderedAlignedX: (root.resizeGeometry?.renderedX ?? 0) + root.sideInset + readonly property real availableHeight: root.controller.controlCenterMaxHeight - root.inset * 2 + readonly property real sheetContentWidth: root.controller.controlCenterSheetWidth + readonly property real renderedAlignedX: (root.resizeGeometry?.renderedX ?? 0) + root.inset readonly property real renderedAlignedY: root.resizeGeometry?.renderedY ?? 0 readonly property bool shouldBeVisible: root.controller.activeActivity === "controlcenter" && root.controller.expanded readonly property bool headerTogglesClose: true @@ -105,7 +104,7 @@ FocusScope { } function alignedXFor(width) { - return (root.resizeGeometry?.screenXFor(width + root.sideInset * 2) ?? 0) + root.sideInset; + return (root.resizeGeometry?.screenXFor(width + root.inset * 2) ?? 0) + root.inset; } } @@ -155,13 +154,8 @@ FocusScope { ControlCenterContent { id: content - anchors { - fill: parent - leftMargin: root.sideInset - rightMargin: root.sideInset - topMargin: Theme.spacingXS - bottomMargin: root.bottomInset - } + anchors.fill: parent + anchors.margins: root.inset host: hostContract onTargetImplicitHeightChanged: root.queueHeightReport() diff --git a/quickshell/Modules/DIsland/IslandBarHost.qml b/quickshell/Modules/DIsland/IslandBarHost.qml index 3caf88cbc..85fed1111 100644 --- a/quickshell/Modules/DIsland/IslandBarHost.qml +++ b/quickshell/Modules/DIsland/IslandBarHost.qml @@ -441,7 +441,6 @@ Item { launcherCycleEnabled: SettingsData.launcherStyle === "island" dashboardAvailableWidth: Math.max(0, (root.screen?.width ?? root.referenceScreenWidth) - (root.isVertical ? root.crossInsetStart + root.crossInsetEnd + root.outerGap + root.nearInset : root.alongInset) - Theme.spacingL * 2) dashboardAvailableHeight: Math.max(0, (root.screen?.height ?? root.referenceScreenHeight) - (root.isVertical ? root.alongInset : root.crossInsetStart + root.crossInsetEnd + root.outerGap + root.nearInset) - Theme.spacingL * 2) - controlCenterMaxHeight: dashboardAvailableHeight notificationExpandAllowed: root.setting("islandNotificationExpand") unreadNotificationCount: root.setting("islandNotificationBadgeClearOnOpen") ? NotificationService.unreadCount : NotificationService.notifications.length hoverOpenDelay: Math.max(0, Math.min(root.maxHoverDelay, root.setting("islandHoverOpenDelay"))) diff --git a/quickshell/Modules/DIsland/IslandController.qml b/quickshell/Modules/DIsland/IslandController.qml index 8b279fce2..5fc5268ee 100644 --- a/quickshell/Modules/DIsland/IslandController.qml +++ b/quickshell/Modules/DIsland/IslandController.qml @@ -77,12 +77,12 @@ QtObject { property int hoverOpenDelay: 150 property int hoverCloseDelay: 150 property int mediaReturnDelay: 1800 - property real controlCenterMaxHeight: CcMetrics.islandMaxHeight + readonly property real controlCenterMaxHeight: dashboardAvailableHeight property string editingActivity: "" property real editRoom: 0 // The bar host grants the room once its surface has presented a frame at the grown size. property bool editRoomGranted: false - readonly property real controlCenterSheetInset: CcMetrics.islandSheetInset + readonly property real controlCenterSheetInset: CcMetrics.islandInset * 2 readonly property int controlCenterColumnCap: CcMetrics.columnCapFor(dashboardAvailableWidth - controlCenterSheetInset - PopoutMetrics.editOverflow * 2) readonly property int controlCenterColumns: Math.min(CcMetrics.gridColumns, controlCenterColumnCap) readonly property real controlCenterSheetWidth: CcMetrics.sheetWidthFor(controlCenterColumns) @@ -161,7 +161,7 @@ QtObject { } function controlCenterHeightFor(withEditRoom) { - return Math.max(CcMetrics.islandMinHeight, Math.min(controlCenterMaxHeight, destinationContentHeight("controlcenter") + (withEditRoom ? root.editRoom : 0))); + return Math.max(CcMetrics.minHeight + controlCenterSheetInset, Math.min(controlCenterMaxHeight, destinationContentHeight("controlcenter") + (withEditRoom ? root.editRoom : 0))); } function dashboardTargetFor(activityId) {