diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 092363e5..ec80503f 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -93,7 +93,7 @@ import { createNotificationsAppWindow, NOTIFICATIONS_SURFACE_ID, NOTIFICATIONS_W import { isInstalledPackagePresent } from "../apps/evenhub/updates"; import { wearerVerificationOptions } from "../apps/microphones/speakers"; import { micSession } from "../apps/microphones/mic-session"; -import { glassesDisplayLabel } from "./glasses-display-state"; +import { glassesDisplayAsleep, glassesDisplayLabel, type GlassesDisplayState } from "./glasses-display-state"; import { PreviewDisplayTarget, type DisplayTarget } from "../native/preview-display"; type ConnectionPhase = "disconnected" | "connecting" | "connected" | "charging" | "disconnecting"; @@ -1171,14 +1171,23 @@ class DashboardController { /** What occupies the foreground-title line on the watch-style controls. */ glassesDisplayLabel(): string { - return glassesDisplayLabel({ + return glassesDisplayLabel(this.glassesDisplayState()); + } + + /** Whether that line reads "Display off" (the watch face adds a wake hint under it). */ + glassesDisplayAsleep(): boolean { + return glassesDisplayAsleep(this.glassesDisplayState()); + } + + private glassesDisplayState(): GlassesDisplayState { + return { phase: this.phase, silentMode: this.silentMode, screenOn: shell.isScreenOn(), battery: this.lastHeadsetBattery, foregroundTitle: shell.getForegroundApp()?.title ?? null, previewMode: this.isPreviewDisplayActive(), - }); + }; } /** diff --git a/app/g2/glasses-display-state.ts b/app/g2/glasses-display-state.ts index ebda5fa2..c9e51e4b 100644 --- a/app/g2/glasses-display-state.ts +++ b/app/g2/glasses-display-state.ts @@ -23,12 +23,25 @@ export function glassesDisplayLabel(state: GlassesDisplayState): string { if (state.silentMode) { return "Silent mode"; } - if (!state.screenOn) { + if (glassesDisplayAsleep(state)) { return "Display off"; } return state.foregroundTitle || "Launcher"; } +/** + * True when the label reads "Display off": the screen is dark but the glasses + * (or the preview standing in for them) would light it on a wake gesture. + */ +export function glassesDisplayAsleep(state: GlassesDisplayState): boolean { + return ( + state.phase !== "charging" && + (state.phase === "connected" || state.previewMode) && + !state.silentMode && + !state.screenOn + ); +} + export function chargingDisplayLabel(battery: number | null): string { return validBatteryLevel(battery) ? `Charging · G2 ${battery}%` : "Charging"; } diff --git a/app/phone-ui/main-view-model.ts b/app/phone-ui/main-view-model.ts index a413f432..8f4a3a53 100644 --- a/app/phone-ui/main-view-model.ts +++ b/app/phone-ui/main-view-model.ts @@ -1127,8 +1127,14 @@ export class MainViewModel extends RemoteControlsViewModel { return dashboardController.glassesDisplayLabel(); } + protected override get padDisplayAsleep(): boolean { + return dashboardController.glassesDisplayAsleep(); + } + private refreshPadFocusLine(): void { this.notifyPropertyChange("padFocusLine", this.padFocusLine); + this.notifyPropertyChange("padFocusClass", this.padFocusClass); + this.notifyPropertyChange("padWakeHintVisibility", this.padWakeHintVisibility); } async onPadTap(): Promise { diff --git a/app/phone-ui/remote-controls-view-model.ts b/app/phone-ui/remote-controls-view-model.ts index 8efdd3d8..18c80b14 100644 --- a/app/phone-ui/remote-controls-view-model.ts +++ b/app/phone-ui/remote-controls-view-model.ts @@ -33,6 +33,23 @@ export class RemoteControlsViewModel extends Observable { return this._controlsTab === "ring" ? "tab-button tab-button-selected" : "tab-button"; } + /** + * The watch face's status line reads "Display off": dim it and show the wake + * gesture under it. The host overrides this and notifies padFocusClass and + * padWakeHintVisibility when it changes. + */ + protected get padDisplayAsleep(): boolean { + return false; + } + + get padFocusClass(): string { + return this.padDisplayAsleep ? "pad-focus pad-focus-asleep" : "pad-focus"; + } + + get padWakeHintVisibility(): "visible" | "collapse" { + return this.padDisplayAsleep ? "visible" : "collapse"; + } + onSettingsTabTap(): void { this.setControlsTab("settings"); } diff --git a/app/phone-ui/remote-controls.css b/app/phone-ui/remote-controls.css index eeac7612..ac0e693d 100644 --- a/app/phone-ui/remote-controls.css +++ b/app/phone-ui/remote-controls.css @@ -104,10 +104,14 @@ font-size: 20; color: #ffffff; } -.pad-legend { - font-size: 11; +/* "Display off": dimmed like the dark screen it describes. */ +.pad-focus-asleep { color: #8a8a8a; - margin-bottom: 8; +} +.pad-wake-hint { + font-size: 13; + color: #6a6a6a; + margin-top: 4; } .action-row { margin-top: 6; diff --git a/app/phone-ui/remote-controls.xml b/app/phone-ui/remote-controls.xml index 943d39e9..aaae10f0 100644 --- a/app/phone-ui/remote-controls.xml +++ b/app/phone-ui/remote-controls.xml @@ -52,10 +52,12 @@ - -