mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-10 06:19:36 -04:00
feat(SystemUpdate): Implement system update IPC commands
This commit is contained in:
@@ -37,34 +37,34 @@ Item {
|
||||
property bool _hadAdjacentLeftBar: false
|
||||
property bool _hadAdjacentRightBar: false
|
||||
|
||||
onHasAdjacentTopBarLiveChanged: if (hasAdjacentTopBarLive) _hadAdjacentTopBar = true
|
||||
onHasAdjacentBottomBarLiveChanged: if (hasAdjacentBottomBarLive) _hadAdjacentBottomBar = true
|
||||
onHasAdjacentLeftBarLiveChanged: if (hasAdjacentLeftBarLive) _hadAdjacentLeftBar = true
|
||||
onHasAdjacentRightBarLiveChanged: if (hasAdjacentRightBarLive) _hadAdjacentRightBar = true
|
||||
onHasAdjacentTopBarLiveChanged: if (hasAdjacentTopBarLive)
|
||||
_hadAdjacentTopBar = true
|
||||
onHasAdjacentBottomBarLiveChanged: if (hasAdjacentBottomBarLive)
|
||||
_hadAdjacentBottomBar = true
|
||||
onHasAdjacentLeftBarLiveChanged: if (hasAdjacentLeftBarLive)
|
||||
_hadAdjacentLeftBar = true
|
||||
onHasAdjacentRightBarLiveChanged: if (hasAdjacentRightBarLive)
|
||||
_hadAdjacentRightBar = true
|
||||
|
||||
readonly property real _frameLeftInset: {
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || _barIsVertical) return 0
|
||||
return hasAdjacentLeftBarLive
|
||||
? SettingsData.frameBarSize
|
||||
: (_hadAdjacentLeftBar ? _frameEdgeFloorInset : 0)
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || _barIsVertical)
|
||||
return 0;
|
||||
return hasAdjacentLeftBarLive ? SettingsData.frameBarSize : (_hadAdjacentLeftBar ? _frameEdgeFloorInset : 0);
|
||||
}
|
||||
readonly property real _frameRightInset: {
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || _barIsVertical) return 0
|
||||
return hasAdjacentRightBarLive
|
||||
? SettingsData.frameBarSize
|
||||
: (_hadAdjacentRightBar ? _frameEdgeFloorInset : 0)
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || _barIsVertical)
|
||||
return 0;
|
||||
return hasAdjacentRightBarLive ? SettingsData.frameBarSize : (_hadAdjacentRightBar ? _frameEdgeFloorInset : 0);
|
||||
}
|
||||
readonly property real _frameTopInset: {
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || !_barIsVertical) return 0
|
||||
return hasAdjacentTopBarLive
|
||||
? SettingsData.frameThickness
|
||||
: (_hadAdjacentTopBar ? _frameEdgeFloorInset : 0)
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || !_barIsVertical)
|
||||
return 0;
|
||||
return hasAdjacentTopBarLive ? SettingsData.frameThickness : (_hadAdjacentTopBar ? _frameEdgeFloorInset : 0);
|
||||
}
|
||||
readonly property real _frameBottomInset: {
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || !_barIsVertical) return 0
|
||||
return hasAdjacentBottomBarLive
|
||||
? SettingsData.frameThickness
|
||||
: (_hadAdjacentBottomBar ? _frameEdgeFloorInset : 0)
|
||||
if (!_hasBarWindow || !SettingsData.frameEnabled || !_barIsVertical)
|
||||
return 0;
|
||||
return hasAdjacentBottomBarLive ? SettingsData.frameThickness : (_hadAdjacentBottomBar ? _frameEdgeFloorInset : 0);
|
||||
}
|
||||
|
||||
property alias hLeftSection: hLeftSection
|
||||
@@ -75,14 +75,10 @@ Item {
|
||||
property alias vRightSection: vRightSection
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: _edgeBaseMargin + _frameLeftInset
|
||||
anchors.rightMargin: _edgeBaseMargin + _frameRightInset
|
||||
anchors.topMargin: (_barIsVertical
|
||||
? (hasAdjacentTopBarLive ? outlineThickness : Theme.spacingXS)
|
||||
: 0) + _frameTopInset
|
||||
anchors.bottomMargin: (_barIsVertical
|
||||
? (hasAdjacentBottomBarLive ? outlineThickness : Theme.spacingXS)
|
||||
: 0) + _frameBottomInset
|
||||
anchors.leftMargin: _edgeBaseMargin + _frameLeftInset
|
||||
anchors.rightMargin: _edgeBaseMargin + _frameRightInset
|
||||
anchors.topMargin: (_barIsVertical ? (hasAdjacentTopBarLive ? outlineThickness : Theme.spacingXS) : 0) + _frameTopInset
|
||||
anchors.bottomMargin: (_barIsVertical ? (hasAdjacentBottomBarLive ? outlineThickness : Theme.spacingXS) : 0) + _frameBottomInset
|
||||
clip: false
|
||||
|
||||
DeferredAction {
|
||||
@@ -1535,6 +1531,16 @@ Item {
|
||||
section: topBarContent.getWidgetSection(parent) || "right"
|
||||
popoutTarget: systemUpdateLoader.item ?? null
|
||||
parentScreen: barWindow.screen
|
||||
|
||||
Component.onCompleted: {
|
||||
barWindow.systemUpdateButtonRef = this;
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
if (barWindow.systemUpdateButtonRef === this)
|
||||
barWindow.systemUpdateButtonRef = null;
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
systemUpdateLoader.active = true;
|
||||
if (!systemUpdateLoader.item)
|
||||
|
||||
@@ -20,6 +20,24 @@ PanelWindow {
|
||||
|
||||
property var controlCenterButtonRef: null
|
||||
property var clockButtonRef: null
|
||||
property var systemUpdateButtonRef: null
|
||||
|
||||
function triggerSystemUpdate() {
|
||||
systemUpdateLoader.active = true;
|
||||
if (!systemUpdateLoader.item)
|
||||
return;
|
||||
const popout = systemUpdateLoader.item;
|
||||
const barPosition = axis?.edge === "left" ? 2 : (axis?.edge === "right" ? 3 : (axis?.edge === "top" ? 0 : 1));
|
||||
if (systemUpdateButtonRef && popout.setTriggerPosition) {
|
||||
const screenPos = systemUpdateButtonRef.mapToItem(null, 0, 0);
|
||||
const pos = SettingsData.getPopupTriggerPosition(screenPos, barWindow.screen, barWindow.effectiveBarThickness, systemUpdateButtonRef.width, barConfig?.spacing ?? 4, barPosition, barConfig);
|
||||
const section = systemUpdateButtonRef.section || "right";
|
||||
popout.setTriggerPosition(pos.x, pos.y, pos.width, section, barWindow.screen, barPosition, barWindow.effectiveBarThickness, barConfig?.spacing ?? 4, barConfig);
|
||||
} else {
|
||||
popout.screen = barWindow.screen;
|
||||
}
|
||||
PopoutManager.requestPopout(popout, undefined, "systemUpdate");
|
||||
}
|
||||
|
||||
function triggerControlCenter() {
|
||||
controlCenterLoader.active = true;
|
||||
|
||||
Reference in New Issue
Block a user