island: match control center sheet and insets to the popout

Port 2.0

(cherry picked from commit e97e41036b)
This commit is contained in:
purian23 authored and dux-ci[bot] committed 2026-10-28 20:30:47 +00:00
1 parent 41e0f1d434
commit 527bb0613e
4 files changed
+15 -24

No files matched your search

@@ -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
@@ -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()
@@ -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")))
@@ -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) {