diff --git a/quickshell/Modules/DankIsland/Activities/HomeExpanded.qml b/quickshell/Modules/DankIsland/Activities/HomeExpanded.qml index 8b12a5d10..b25ea64a3 100644 --- a/quickshell/Modules/DankIsland/Activities/HomeExpanded.qml +++ b/quickshell/Modules/DankIsland/Activities/HomeExpanded.qml @@ -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 } diff --git a/quickshell/Modules/DankIsland/Activities/MediaExpanded.qml b/quickshell/Modules/DankIsland/Activities/MediaExpanded.qml index 7d35685e4..09f077866 100644 --- a/quickshell/Modules/DankIsland/Activities/MediaExpanded.qml +++ b/quickshell/Modules/DankIsland/Activities/MediaExpanded.qml @@ -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 diff --git a/quickshell/Modules/DankIsland/Activities/WallpaperExpanded.qml b/quickshell/Modules/DankIsland/Activities/WallpaperExpanded.qml index 6adb6c512..5cfe68535 100644 --- a/quickshell/Modules/DankIsland/Activities/WallpaperExpanded.qml +++ b/quickshell/Modules/DankIsland/Activities/WallpaperExpanded.qml @@ -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 diff --git a/quickshell/Modules/DankIsland/Activities/WeatherExpanded.qml b/quickshell/Modules/DankIsland/Activities/WeatherExpanded.qml index 27a76e6da..bdaab4436 100644 --- a/quickshell/Modules/DankIsland/Activities/WeatherExpanded.qml +++ b/quickshell/Modules/DankIsland/Activities/WeatherExpanded.qml @@ -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"); diff --git a/quickshell/Modules/DankIsland/IslandContentHost.qml b/quickshell/Modules/DankIsland/IslandContentHost.qml index f67654dd6..f8b1802a3 100644 --- a/quickshell/Modules/DankIsland/IslandContentHost.qml +++ b/quickshell/Modules/DankIsland/IslandContentHost.qml @@ -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)); } diff --git a/quickshell/Modules/DankIsland/IslandController.qml b/quickshell/Modules/DankIsland/IslandController.qml index c2105007c..75320fcc4 100644 --- a/quickshell/Modules/DankIsland/IslandController.qml +++ b/quickshell/Modules/DankIsland/IslandController.qml @@ -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; }