wellbeing: open the screen time view from the overview card (#3980)

port 2.0
This commit is contained in:
hecate cantus authored and GitHub committed 2026-10-28 10:28:06 -04:00
1 parent 5d53fdb684
commit 27ff725a17
8 files changed
+72 -2

No files matched your search

+1 -1
View File
@@ -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";
@@ -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")
@@ -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;
@@ -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)
}
+1
View File
@@ -119,6 +119,7 @@ Item {
case "controlcenter":
case "wallpaper":
case "weather":
case "wellbeing":
case "notificationcenter":
case "clipboard":
case "powermenu":
@@ -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
@@ -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"
@@ -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;