island: decouple blank-click policy from destinations, centralize escape

This commit is contained in:
bbedward
2026-09-01 18:57:20 -04:00
parent 8fb83d251c
commit ba04356d64
6 changed files with 10 additions and 47 deletions
@@ -58,16 +58,7 @@ FocusScope {
visible: !tabLoader.visible
}
Keys.onPressed: event => {
if (root.overviewTab?.handleKeyEvent(event) === true) {
event.accepted = true;
return;
}
if (event.key === Qt.Key_Escape) {
root.controller.requestCollapse();
event.accepted = true;
}
}
Keys.onPressed: event => event.accepted = root.overviewTab?.handleKeyEvent(event) === true
Component.onCompleted: root.contentStaged = true
}
@@ -75,16 +75,7 @@ FocusScope {
visible: !tabLoader.visible
}
Keys.onPressed: event => {
if (root.playerTab?.handleKeyEvent(event) === true) {
event.accepted = true;
return;
}
if (event.key === Qt.Key_Escape) {
root.controller.requestCollapse();
event.accepted = true;
}
}
Keys.onPressed: event => event.accepted = root.playerTab?.handleKeyEvent(event) === true
Connections {
target: root.controller
@@ -67,16 +67,7 @@ FocusScope {
visible: !tabLoader.visible
}
Keys.onPressed: event => {
if (root.wallpaperTab?.handleKeyEvent(event) === true) {
event.accepted = true;
return;
}
if (event.key === Qt.Key_Escape) {
root.controller.requestCollapse();
event.accepted = true;
}
}
Keys.onPressed: event => event.accepted = root.wallpaperTab?.handleKeyEvent(event) === true
Connections {
target: root.controller
@@ -22,12 +22,6 @@ FocusScope {
root.forceActiveFocus();
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: root.controller.requestCollapse()
}
Loader {
id: tabLoader
@@ -56,13 +50,6 @@ FocusScope {
visible: !tabLoader.visible
}
Keys.onPressed: event => {
if (event.key === Qt.Key_Escape) {
root.controller.requestCollapse();
event.accepted = true;
}
}
Component.onCompleted: {
root.contentStaged = true;
root.controller.markVisualsReady("weather");
@@ -52,6 +52,8 @@ Item {
property real outgoingMorph: 0
property bool homeExpandedTouched: false
Keys.onEscapePressed: root.controller.requestCollapse()
function fadeCompact(morph) {
return 1 - Math.max(0, Math.min(1, morph / 0.34));
}
@@ -92,6 +92,7 @@ QtObject {
}
readonly property var destinations: ["launcher", "controlcenter", "wallpaper", "weather", "notificationcenter"]
readonly property var blankClickOwners: ["launcher", "controlcenter", "wallpaper", "notificationcenter"]
readonly property var destinationDefaults: ({
"launcher": {
"contentWidth": 160,
@@ -323,7 +324,7 @@ QtObject {
readonly property bool notificationHeldForSystem: root.systemActivityActive && root.transientReturnActivity === "notification"
readonly property bool transientActive: systemActivityActive || notificationActive
readonly property bool timeoutSuspended: pointerInside || (expanded && !notificationActive)
readonly property bool activityOwnsBlankClicks: isDestination(activeActivity)
readonly property bool activityOwnsBlankClicks: blankClickOwners.indexOf(activeActivity) !== -1
readonly property bool hoverExpandEnabled: root.interactionMode === "hybrid" && !root.systemActivityActive
function compactTargetFor(activityId) {
switch (activityId) {
@@ -411,7 +412,7 @@ QtObject {
keyboardYielded = false;
launcherSessionActive = false;
clearPendingRequests("");
if (activityOwnsBlankClicks)
if (isDestination(activeActivity))
activeActivity = mediaAvailable && mediaPreferred ? "media" : "home";
}
@@ -452,7 +453,7 @@ QtObject {
syncTransientTimeout(true);
return false;
}
if (activityOwnsBlankClicks)
if (isDestination(activeActivity))
return requestActivity(activeActivity, true, requestKeyboardFocus);
if (notificationActive && !notificationExpandAllowed)
return requestNotificationCenter(false);
@@ -484,7 +485,7 @@ QtObject {
finishTransient();
return true;
}
if (activityOwnsBlankClicks)
if (isDestination(activeActivity))
activeActivity = mediaAvailable && mediaPreferred ? "media" : "home";
return true;
}