mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-17 00:34:01 -04:00
island: restore normal control center height until edit mode
This commit is contained in:
@@ -24,9 +24,9 @@ FocusScope {
|
||||
|
||||
readonly property bool pageOpen: (host.expandedSection ?? "") !== ""
|
||||
readonly property real gridHeight: widgetGrid.gridHeight
|
||||
// Held in both modes so entering edit mode never resizes the island or reflows tiles.
|
||||
// Reserved from the grid in both modes so the island growing into edit mode never reflows tiles.
|
||||
readonly property real editRoom: host.editRoom ?? 0
|
||||
readonly property real chromeHeight: editRoom
|
||||
readonly property real chromeHeight: (host.editRoomShown ?? false) ? editRoom : 0
|
||||
readonly property bool stripAbove: host.stripAbove ?? false
|
||||
readonly property bool widgetSheetOpen: widgetSheetLoader.item?.active ?? false
|
||||
readonly property real coveredAmount: Math.max(detailPage.opacity, widgetSheetLoader.item?.progress ?? 0)
|
||||
@@ -48,7 +48,7 @@ FocusScope {
|
||||
// Held during a drag so the trash never moves under the pointer.
|
||||
readonly property real heldGridHeight: widgetGrid.dragging ? widgetGrid.pinnedHeight + dragRoom : gridHeight
|
||||
readonly property real targetImplicitHeight: {
|
||||
const total = CcMetrics.sheetPadding * 2 + heldGridHeight + chromeHeight;
|
||||
const total = CcMetrics.sheetPadding * 2 + heldGridHeight;
|
||||
if (detailPage.shownSection === "")
|
||||
return total;
|
||||
return Math.max(total, detailPage.topInset + detailPage.minimumHeight + CcMetrics.detailDialogInset);
|
||||
@@ -489,7 +489,7 @@ FocusScope {
|
||||
id: editActions
|
||||
|
||||
x: 0
|
||||
y: root.editRoom > 0 ? root.height - root.editRoom + (root.editRoom - height) / 2 : (root.stripAbove ? -height : root.height)
|
||||
y: root.editRoom > 0 ? Math.max(root.height - root.editRoom, CcMetrics.sheetPadding * 2 + root.heldGridHeight) + (root.editRoom - height) / 2 : (root.stripAbove ? -height : root.height)
|
||||
width: root.sheetContentWidth
|
||||
height: implicitHeight
|
||||
// Below the edit rings so the shoulder fill never covers them.
|
||||
|
||||
@@ -54,7 +54,7 @@ FocusScope {
|
||||
property bool editMode: false
|
||||
property string expandedSection: ""
|
||||
|
||||
onEditModeChanged: root.controller.setEditing("controlcenter", editMode)
|
||||
onEditModeChanged: root.controller.setEditing("controlcenter", editMode, CcMetrics.islandEditRoom)
|
||||
|
||||
readonly property int gridColumnCap: root.controller.controlCenterColumnCap
|
||||
readonly property int gridColumns: root.controller.controlCenterColumns
|
||||
@@ -65,6 +65,7 @@ FocusScope {
|
||||
readonly property bool shouldBeVisible: root.controller.activeActivity === "controlcenter" && root.controller.expanded
|
||||
readonly property bool headerTogglesClose: true
|
||||
readonly property real editRoom: CcMetrics.islandEditRoom
|
||||
readonly property bool editRoomShown: root.controller.editRoomGranted && root.controller.editingActivity === "controlcenter"
|
||||
readonly property bool growsFromTop: root.controller.edge === "top"
|
||||
readonly property bool powerMenuOpen: PopoutService.powerMenuModalLoader?.item?.shouldBeVisible ?? false
|
||||
readonly property var screen: root.effectiveScreen
|
||||
|
||||
@@ -83,7 +83,7 @@ QtObject {
|
||||
readonly property int controlCenterColumns: Math.min(CcMetrics.gridColumns, controlCenterColumnCap)
|
||||
readonly property real controlCenterSheetWidth: CcMetrics.sheetWidthFor(controlCenterColumns)
|
||||
readonly property real controlCenterMaxWidth: CcMetrics.sheetWidthFor(editingActivity === "controlcenter" ? controlCenterColumnCap : controlCenterColumns) + controlCenterSheetInset
|
||||
readonly property real controlCenterHeight: Math.max(320, Math.min(controlCenterMaxHeight, destinationContentHeight("controlcenter")))
|
||||
readonly property real controlCenterHeight: controlCenterHeightFor(editRoomGranted && editingActivity === "controlcenter")
|
||||
|
||||
readonly property bool compactDense: compactThickness < 40
|
||||
readonly property real compactFaceThickness: BarMetrics.compactFaceThickness(compactThickness)
|
||||
@@ -103,7 +103,7 @@ QtObject {
|
||||
readonly property real dashboardMaxWidth: Math.min(dashboardAvailableWidth, DashMetrics.widthFor(SettingsData.showWeekNumber, undefined, editingActivity !== "" ? dashboardColumnCap : DashRegistry.widestPanelColumns))
|
||||
property var dashboardContentHeights: ({})
|
||||
readonly property real dashChromeHeight: DashMetrics.islandHandleChromeHeight
|
||||
readonly property real editSurfaceHeight: editRoom > 0 ? dashboardHeightFor(editingActivity, true) : 0
|
||||
readonly property real editSurfaceHeight: editRoom <= 0 ? 0 : editingActivity === "controlcenter" ? controlCenterHeightFor(true) : dashboardHeightFor(editingActivity, true)
|
||||
readonly property real dashboardHeight: Math.min(dashboardAvailableHeight, Math.max(DashMetrics.tabDefaultHeight + root.dashChromeHeight, ...Object.values(dashboardContentHeights)))
|
||||
readonly property int dashboardRowBudget: Math.max(DashMetrics.minimumTabRows, Math.floor((dashboardAvailableHeight - DashMetrics.islandEditChromeHeight + DashMetrics.gridGap) / (DashMetrics.gridRowUnit + DashMetrics.gridGap)))
|
||||
readonly property real mediaCompactMaxLength: 360
|
||||
@@ -156,6 +156,10 @@ QtObject {
|
||||
return Math.min(dashboardAvailableHeight, height + (withEditRoom ? root.editRoom : 0));
|
||||
}
|
||||
|
||||
function controlCenterHeightFor(withEditRoom) {
|
||||
return Math.max(320, Math.min(controlCenterMaxHeight, destinationContentHeight("controlcenter") + (withEditRoom ? root.editRoom : 0)));
|
||||
}
|
||||
|
||||
function dashboardTargetFor(activityId) {
|
||||
return sheetTarget(dashboardWidthFor(activityId), dashboardHeightFor(activityId, root.editRoomGranted && root.editingActivity === activityId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user