From 27ff725a17d5cf23b10ce5bb66a6a424830ec2e0 Mon Sep 17 00:00:00 2001 From: hecate cantus Date: Wed, 28 Oct 2026 07:28:06 -0700 Subject: [PATCH] wellbeing: open the screen time view from the overview card (#3980) port 2.0 --- quickshell/DMSShellIPC.qml | 2 +- .../DDash/Overview/WellbeingOverviewCard.qml | 1 + .../DIsland/Activities/HomeExpanded.qml | 3 +++ .../DIsland/Activities/WellbeingExpanded.qml | 19 ++++++++++++++++ quickshell/Modules/DIsland/DIsland.qml | 1 + quickshell/Modules/DIsland/DIslandSurface.qml | 22 +++++++++++++++++++ .../Modules/DIsland/IslandContentHost.qml | 18 +++++++++++++++ .../Modules/DIsland/IslandController.qml | 8 ++++++- 8 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 quickshell/Modules/DIsland/Activities/WellbeingExpanded.qml diff --git a/quickshell/DMSShellIPC.qml b/quickshell/DMSShellIPC.qml index ae1215d23..e3729b3a8 100644 --- a/quickshell/DMSShellIPC.qml +++ b/quickshell/DMSShellIPC.qml @@ -419,7 +419,7 @@ Item { } function close(): string { - const islandClosed = SettingsData.islandDashActivities.filter(activity => PopoutService.closeIslandActivity(activity)).length > 0; + const islandClosed = [...SettingsData.islandDashActivities, "wellbeing"].filter(activity => PopoutService.closeIslandActivity(activity)).length > 0; if (root.dankDashPopoutLoaderRef.item) root.dankDashPopoutLoaderRef.item.dashVisible = false; return islandClosed || root.dankDashPopoutLoaderRef.item ? "DASH_CLOSE_SUCCESS" : "DASH_CLOSE_FAILED"; diff --git a/quickshell/Modules/DDash/Overview/WellbeingOverviewCard.qml b/quickshell/Modules/DDash/Overview/WellbeingOverviewCard.qml index b6f8ce33d..106efc73c 100644 --- a/quickshell/Modules/DDash/Overview/WellbeingOverviewCard.qml +++ b/quickshell/Modules/DDash/Overview/WellbeingOverviewCard.qml @@ -24,6 +24,7 @@ Card { readonly property bool overLimit: limitSeconds > 0 && today.active >= limitSeconds entryId: "wellbeing" + clickable: true clipContent: true pad: Theme.spacingM Accessible.name: I18n.tr("Screen time", "dashboard card and settings card title, time spent in apps") diff --git a/quickshell/Modules/DIsland/Activities/HomeExpanded.qml b/quickshell/Modules/DIsland/Activities/HomeExpanded.qml index 1180df5a9..052ca0e80 100644 --- a/quickshell/Modules/DIsland/Activities/HomeExpanded.qml +++ b/quickshell/Modules/DIsland/Activities/HomeExpanded.qml @@ -24,6 +24,9 @@ DashTabFace { if (SettingsData.weatherEnabled) root.controller.requestWeather(false); break; + case "wellbeing": + root.controller.requestActivity("wellbeing", true, true); + break; case "notifications": root.controller.requestNotificationCenter(false); break; diff --git a/quickshell/Modules/DIsland/Activities/WellbeingExpanded.qml b/quickshell/Modules/DIsland/Activities/WellbeingExpanded.qml new file mode 100644 index 000000000..7f86cc0e0 --- /dev/null +++ b/quickshell/Modules/DIsland/Activities/WellbeingExpanded.qml @@ -0,0 +1,19 @@ +pragma ComponentBehavior: Bound + +import QtQuick +import qs.Modules.DDash + +DashTabFace { + id: root + + activityId: "wellbeing" + tabComponent: Component { + WellbeingTab { + live: root.live + transientSurfaceTracker: root.controller.transientSurfaces + } + } + + Component.onCompleted: root.controller.markVisualsReady("wellbeing") + Component.onDestruction: root.controller.setVisualsReady("wellbeing", false) +} diff --git a/quickshell/Modules/DIsland/DIsland.qml b/quickshell/Modules/DIsland/DIsland.qml index 8135a2d4c..8d874c0a4 100644 --- a/quickshell/Modules/DIsland/DIsland.qml +++ b/quickshell/Modules/DIsland/DIsland.qml @@ -119,6 +119,7 @@ Item { case "controlcenter": case "wallpaper": case "weather": + case "wellbeing": case "notificationcenter": case "clipboard": case "powermenu": diff --git a/quickshell/Modules/DIsland/DIslandSurface.qml b/quickshell/Modules/DIsland/DIslandSurface.qml index 567c7ffc5..cd3ac0a81 100644 --- a/quickshell/Modules/DIsland/DIslandSurface.qml +++ b/quickshell/Modules/DIsland/DIslandSurface.qml @@ -460,6 +460,8 @@ Item { wallpaperExpandedComponent: expandedWallpaperComponent weatherCompactComponent: compactWeatherComponent weatherExpandedComponent: expandedWeatherComponent + wellbeingCompactComponent: compactWellbeingComponent + wellbeingExpandedComponent: expandedWellbeingComponent systemCompactComponent: compactSystemComponent systemExpandedComponent: expandedSystemComponent notificationCompactComponent: compactNotificationComponent @@ -757,6 +759,26 @@ Item { } } + Component { + id: compactWellbeingComponent + + DestinationCompact { + controller: root.controller + activityId: "wellbeing" + iconName: "digital_wellbeing" + label: I18n.tr("Screen time", "dashboard card and settings card title, time spent in apps") + } + } + + Component { + id: expandedWellbeingComponent + + WellbeingExpanded { + controller: root.controller + resizeGeometry: root.resizeGeometry + } + } + Component { id: compactSystemComponent diff --git a/quickshell/Modules/DIsland/IslandContentHost.qml b/quickshell/Modules/DIsland/IslandContentHost.qml index b404af48c..0070d5c0d 100644 --- a/quickshell/Modules/DIsland/IslandContentHost.qml +++ b/quickshell/Modules/DIsland/IslandContentHost.qml @@ -42,6 +42,8 @@ Item { required property Component wallpaperExpandedComponent required property Component weatherCompactComponent required property Component weatherExpandedComponent + required property Component wellbeingCompactComponent + required property Component wellbeingExpandedComponent required property Component systemCompactComponent required property Component systemExpandedComponent required property Component notificationCompactComponent @@ -104,6 +106,7 @@ Item { "launcher": launcherExpandedLoader, "wallpaper": wallpaperExpandedLoader, "weather": weatherExpandedLoader, + "wellbeing": wellbeingExpandedLoader, "notificationcenter": notificationCenterExpandedLoader, "clipboard": clipboardExpandedLoader, "powermenu": powerMenuExpandedLoader, @@ -324,6 +327,21 @@ Item { sourceComponent: root.weatherExpandedComponent } + CompactFace { + active: root.surfaceActive("wellbeing") + activity: "wellbeing" + face: root.wellbeingCompactComponent + } + + ExpandedFace { + id: wellbeingExpandedLoader + + activity: "wellbeing" + active: root.controller.visualsRequested("wellbeing") + asynchronous: true + sourceComponent: root.wellbeingExpandedComponent + } + CompactFace { active: root.surfaceActive("notificationcenter") activity: "notificationcenter" diff --git a/quickshell/Modules/DIsland/IslandController.qml b/quickshell/Modules/DIsland/IslandController.qml index da587bb44..24e361282 100644 --- a/quickshell/Modules/DIsland/IslandController.qml +++ b/quickshell/Modules/DIsland/IslandController.qml @@ -183,7 +183,7 @@ QtObject { powerMenuContentWidth = next; } - readonly property var destinations: ["launcher", "controlcenter", "wallpaper", "weather", "notificationcenter", "clipboard", "powermenu"] + readonly property var destinations: ["launcher", "controlcenter", "wallpaper", "weather", "wellbeing", "notificationcenter", "clipboard", "powermenu"] readonly property var blankClickOwners: ["launcher", "controlcenter", "wallpaper", "notificationcenter", "clipboard", "powermenu"] readonly property var destinationDefaults: ({ "launcher": { @@ -202,6 +202,10 @@ QtObject { "contentLength": 130, "contentHeight": 0 }, + "wellbeing": { + "contentLength": 130, + "contentHeight": 0 + }, "notificationcenter": { "contentLength": 170, "contentHeight": 320 @@ -726,6 +730,8 @@ QtObject { return false; if (activityId === "weather" && !SettingsData.weatherEnabled) return false; + if (activityId === "wellbeing" && !SettingsData.wellbeingEnabled) + return false; if (activityId !== "launcher") launcherSessionActive = false;