Files
Marlon Kranz 4a8f1062be island: open media and the power menu in one step (#3756)
* island: open media and the power menu in one step, fix dash edits

- Clicking media on the home face opens the player. Closing a sheet
  goes back to the face the user picked, and an opt-in setting
  switches to media when playback starts.
- The power menu can open in the island (Super+X, the dock button),
  with its own route row in the island settings.
- An island collapses when another popout opens on its screen.
- The widgets page hides the center section the island replaces.
- Dragging or resizing a dashboard card no longer blanks the overview:
  Qt hands the committed list over as a non-array, which read as empty.
- The island blur region stays inside the rounded fill.

* fix(island): address review feedback on switching faces by mouse

Opening the player with one click removed the only mouse path from
the home face to the media face. A right-click on the collapsed island
now swaps between the two while media is available.

The swap resizes the island under the pointer, so hover-open stays off
until the pointer leaves. Without a face to swap to, the press is not
accepted and reaches the bar's own right-click action as before.
2026-10-12 12:52:12 -04:00

77 lines
2.0 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import qs.Modules.PowerMenu
import qs.Services
FocusScope {
id: root
required property var controller
readonly property bool sheetActive: controller.expanded && controller.activeActivity === "powermenu"
clip: true
function focusFace() {
powerContent.forceActiveFocus();
return true;
}
function reportSize() {
root.controller.setPowerMenuContentWidth(powerContent.desiredWidth);
root.controller.setDestinationContentHeight("powermenu", powerContent.implicitHeight);
}
onSheetActiveChanged: {
if (sheetActive)
return;
powerContent.cancelHold();
powerContent.resetState();
}
PowerMenuContent {
id: powerContent
anchors.fill: parent
focus: true
onDesiredWidthChanged: root.reportSize()
onImplicitHeightChanged: root.reportSize()
onActiveFocusChanged: {
if (!powerContent.activeFocus)
powerContent.cancelHold();
}
onPowerActionRequested: action => {
PopoutService.closeControlCenter();
SessionService.executePowerAction(action);
}
onLockRequested: {
PopoutService.closeControlCenter();
IdleService.lockRequested();
}
onSwitchUserRequested: PopoutService.openSwitchUser()
onCloseRequested: root.controller.requestCollapse()
}
Connections {
target: root.controller
function onSessionStarted(activityId) {
if (activityId !== "powermenu")
return;
powerContent.cancelHold();
powerContent.resetState();
root.focusFace();
}
}
Component.onCompleted: {
root.reportSize();
root.controller.markVisualsReady("powermenu");
}
Component.onDestruction: {
powerContent.cancelHold();
root.controller.setVisualsReady("powermenu", false);
}
}