diff --git a/app/apps/blocks/blocks-app.worker.ts b/app/apps/blocks/blocks-app.worker.ts index 2b570197..239a3366 100644 --- a/app/apps/blocks/blocks-app.worker.ts +++ b/app/apps/blocks/blocks-app.worker.ts @@ -49,7 +49,7 @@ const PANEL_X = 230; /** * Height the layout above is drawn for: a min-height window's viewport under * the standard top bar. A taller viewport (the status bar folded into the - * switcher row, a full-panel display) centers it vertically. + * switcher row, a Tall or Full Screen display) centers it vertically. */ const LAYOUT_HEIGHT = 260; diff --git a/app/apps/evenhub/evenhub-window.ts b/app/apps/evenhub/evenhub-window.ts index d359b2ee..a0937cb5 100644 --- a/app/apps/evenhub/evenhub-window.ts +++ b/app/apps/evenhub/evenhub-window.ts @@ -29,9 +29,9 @@ class EvenHubAppLayer implements Layer { paint(ctx: LayerContext): GrayImage { const size = ctx.stack.getBaseSize(); - // EvenHub apps lay out for the stock 576-wide surface. In the full-panel - // display mode the window is 640 wide; paint at stock width and centre - // it rather than leaving all the slack on the right. + // EvenHub apps lay out for the stock 576-wide surface. In the Full + // Screen display mode the window is 640 wide; paint at stock width and + // centre it rather than leaving all the slack on the right. if (size.width > EVENHUB_SCREEN_WIDTH) { const content = this.session.paint({ width: EVENHUB_SCREEN_WIDTH, height: size.height }, ctx.stack.isFocused()); const image = new GrayImage(size.width, size.height, 0); diff --git a/app/apps/navigate/navigate-app.worker.ts b/app/apps/navigate/navigate-app.worker.ts index db34f057..b79b09b1 100644 --- a/app/apps/navigate/navigate-app.worker.ts +++ b/app/apps/navigate/navigate-app.worker.ts @@ -33,8 +33,7 @@ import { navigateDestinationAddressDraftSetting, navigateDestinationNameDraftSetting, navigateRememberRecentSetting, - navigateDisplayModeSetting, - navigateVerticalPositionSetting, + navigateDisplayLayoutSetting, mapboxApiKeySetting, enumSettingMenuItem, type ConfigSettingString, @@ -935,10 +934,7 @@ function windowMenuItems(): MenuItem[] { }, }); } - items.push( - enumSettingMenuItem(navigateDisplayModeSetting), - enumSettingMenuItem(navigateVerticalPositionSetting), - ); + items.push(enumSettingMenuItem(navigateDisplayLayoutSetting)); items.push(submenuItem("Saved destinations", (ctx) => { ctx.stack.push(new WindowMenuLayer("Saved destinations", savedDestinationMenuItems())); })); diff --git a/app/apps/onboarding/data-collection-page.ts b/app/apps/onboarding/data-collection-page.ts index 91e944df..ad52e32b 100644 --- a/app/apps/onboarding/data-collection-page.ts +++ b/app/apps/onboarding/data-collection-page.ts @@ -13,7 +13,7 @@ const LABEL_GAP = 24; /** None / Minimal / Full, each with a one-line summary; a tap saves the selected level. */ export class DataCollectionPage implements OnboardingPage { - readonly fullscreen = true; + readonly immersive = true; /** Width of the level-name column, measured each paint. */ private labelColumnWidth = 0; private readonly menu = new Menu({ diff --git a/app/apps/onboarding/depth-page.ts b/app/apps/onboarding/depth-page.ts index fb7bd26a..ad3b1c1d 100644 --- a/app/apps/onboarding/depth-page.ts +++ b/app/apps/onboarding/depth-page.ts @@ -13,7 +13,7 @@ const COLUMN_WIDTH = 220; /** * The whole display's stereo depth, after a layout that has one (Bottom or - * Popup). Not fullscreen, so the page sits in the chosen layout, and the + * Popup). Not immersive, so the page sits in the chosen layout, and the * depth is saved as the selection moves: the shell shifts everything with * it, which is the only way to see the difference. */ diff --git a/app/apps/onboarding/display-mode-page.ts b/app/apps/onboarding/display-mode-page.ts new file mode 100644 index 00000000..b9d0a8e2 --- /dev/null +++ b/app/apps/onboarding/display-mode-page.ts @@ -0,0 +1,94 @@ +import type { GrayImage } from "../../graphics/image"; +import { wrapText } from "../../graphics/textwrap"; +import { displayLayoutSetting, type DisplayLayout } from "../../ui/dashboard-settings"; +import type { InputEvent } from "../../ui/gestures"; +import { Menu, type MenuDrawArgs } from "../../ui/menu-core"; +import { LIST_ROW_TEXT_INSET, listRowHeight } from "../../ui/metrics"; +import { onboardingFont } from "./onboarding-fonts"; +import { drawPageHeading, PAGE_X, type OnboardingNav, type OnboardingPage } from "./onboarding-page"; + +const CONTENT_GAP = 10; +const BOTTOM_MARGIN = 8; +const COLUMN_GAP = 16; + +const DESCRIPTIONS = { + band: "The stock 288px band, at this height in your view, leaving the rest of it clear.", + tall: "Windows use the display's full height.", + fullscreen: "Full height, and the display's whole width. Depth is turned off, since windows reach its edges.", +}; + +/** + * The display mode: how much of the display windows use (a band at one of + * five heights, Tall, or Full Screen where the layout allows it), with a + * line about the selected one. Not immersive, and the mode is saved as the + * selection moves, so this window itself shows each mode as it really is + * (the dashboard controller moves or resizes it, and every other window). + */ +export class DisplayModePage implements OnboardingPage { + private readonly menu = new Menu({ + wrap: false, + rowGap: 2, + highlight: { radius: 8 }, + getHeight: () => listRowHeight(onboardingFont("body")), + draw: (args) => this.drawRow(args), + }); + + enter(): void { + // Full Screen comes and goes with the layout; where the layout doesn't + // allow it, a saved Full Screen shows as Tall, as the shell does. + const values = displayLayoutSetting.values.filter((value) => !displayLayoutSetting.isDisabled(value)); + const index = values.indexOf(displayLayoutSetting.get()); + this.menu.setItems(values, index >= 0 ? index : values.indexOf("tall")); + } + + paint(image: GrayImage, focused: boolean): void { + const top = drawPageHeading( + image, + "Display mode", + "Swipe to choose how much of the display windows use; it changes as you go. Tap to continue.", + ) + CONTENT_GAP; + const body = onboardingFont("body"); + const columnWidth = 20 + Math.max(...this.menu.items.map((value) => body.measureText(displayLayoutSetting.displayValue(value)))); + const menuBox = { x: PAGE_X - 10, y: top, width: columnWidth, height: image.height - top - BOTTOM_MARGIN }; + this.menu.paint(image, menuBox, focused); + const layout = this.menu.selectedItem; + if (layout === null) return; + const detail = onboardingFont("detail"); + const left = menuBox.x + columnWidth + COLUMN_GAP; + let y = top + LIST_ROW_TEXT_INSET; + for (const line of wrapText(detail, description(layout), image.width - PAGE_X - left)) { + if (y + detail.lineHeight > image.height - BOTTOM_MARGIN) break; + image.drawText(detail, left, y, line, 170); + y += detail.lineHeight; + } + } + + handleInput(event: InputEvent, nav: OnboardingNav): void { + switch (event.type) { + case "scroll-up": + case "scroll-down": + void this.menu.handleInput(event); + this.apply(); + return; + case "click": + this.apply(); + nav.next(); + return; + default: + return; + } + } + + private apply(): void { + const layout = this.menu.selectedItem; + if (layout !== null && layout !== displayLayoutSetting.get()) displayLayoutSetting.set(layout); + } + + private drawRow({ image, item: layout, x, y, selected }: MenuDrawArgs): void { + image.drawText(onboardingFont("body"), x + 10, y + LIST_ROW_TEXT_INSET, displayLayoutSetting.displayValue(layout), selected ? 255 : 190); + } +} + +function description(layout: DisplayLayout): string { + return layout === "tall" || layout === "fullscreen" ? DESCRIPTIONS[layout] : DESCRIPTIONS.band; +} diff --git a/app/apps/onboarding/index.ts b/app/apps/onboarding/index.ts index 8de05881..727eac24 100644 --- a/app/apps/onboarding/index.ts +++ b/app/apps/onboarding/index.ts @@ -4,8 +4,8 @@ import { ONBOARDING_APP_ID } from "./onboarding-progress"; /** * First-run setup on the glasses: welcome, text size, data-collection - * preference, layout (app switcher position) and, for layouts that have - * one, depth. The connection controllers open it on their own when it is + * preference, layout (app switcher position), depth for layouts that have + * one, and display mode. The connection controllers open it on their own when it is * due (claimGlassesOnboardingAutoLaunch); the launcher entry reruns it. */ const onboardingApp: AppDefinition = { diff --git a/app/apps/onboarding/ios-privacy-page.ts b/app/apps/onboarding/ios-privacy-page.ts index 726d41af..dd3b94c6 100644 --- a/app/apps/onboarding/ios-privacy-page.ts +++ b/app/apps/onboarding/ios-privacy-page.ts @@ -7,7 +7,7 @@ import { drawPageHeading, PAGE_X, type OnboardingNav, type OnboardingPage } from /** Paginate the notice so no disclosure is silently clipped on a short glasses viewport. */ export class IosPrivacyPage implements OnboardingPage { - readonly fullscreen = true; + readonly immersive = true; private page = 0; private pageCount = 1; diff --git a/app/apps/onboarding/layout-diagram.ts b/app/apps/onboarding/layout-diagram.ts new file mode 100644 index 00000000..3ade4108 --- /dev/null +++ b/app/apps/onboarding/layout-diagram.ts @@ -0,0 +1,177 @@ +/** + * Schematic diagrams of the shell's layouts for the onboarding's Layout + * page: to scale in real-display pixels, simplified, and drawn brighter + * than the real chrome, which they shrink to a few pixels. + */ +import { G2_LENS_WIDTH, type GrayImage } from "../../graphics/image"; +import { statusBarPositionSetting, type AppSwitcherPosition } from "../../ui/dashboard-settings"; +import { SIDEBAR_WIDTH, SWITCHER_ROW_HEIGHT, MIN_WINDOW_HEIGHT, TOP_BAR_HEIGHT } from "../../ui/shell/geometry"; + +export const AREA_OUTLINE = 30; +const CHROME_LINE = 100; +const WINDOW_FRAME = 140; +const ICON = 160; +const SELECTED_ICON = 230; +const STATUS = 140; +const CONTENT = 110; +const CONTENT_TITLE = 170; +/** Window content under a popup switcher, which dims it. */ +const DIM = 0.5; + +/** Draws in real-display pixels, scaled into an image at (x, y). */ +export class Diagram { + constructor( + private readonly image: GrayImage, + private readonly x: number, + private readonly y: number, + private readonly scale: number, + ) {} + + private box(x: number, y: number, width: number, height: number) { + const left = this.x + Math.round(x * this.scale), top = this.y + Math.round(y * this.scale); + return { + x: left, + y: top, + width: Math.max(1, this.x + Math.round((x + width) * this.scale) - left), + height: Math.max(1, this.y + Math.round((y + height) * this.scale) - top), + }; + } + + fill(x: number, y: number, width: number, height: number, value: number, radius = 0): void { + const box = this.box(x, y, width, height); + if (radius) this.image.fillRoundedRect(box.x, box.y, box.width, box.height, value, Math.max(1, Math.round(radius * this.scale))); + else this.image.fillRect(box.x, box.y, box.width, box.height, value); + } + + outline(x: number, y: number, width: number, height: number, value: number, radius = 0): void { + const box = this.box(x, y, width, height); + this.image.drawRoundedRect(box.x, box.y, box.width, box.height, value, Math.max(0, Math.round(radius * this.scale))); + } + + /** A one-pixel line along a real-pixel row (horizontal) or column. */ + hline(x: number, y: number, width: number, value: number): void { + const box = this.box(x, y, width, 1); + this.image.fillRect(box.x, box.y, box.width, 1, value); + } + + vline(x: number, y: number, height: number, value: number): void { + const box = this.box(x, y, 1, height); + this.image.fillRect(box.x, box.y, 1, box.height, value); + } +} + +/** + * The foreground window's band, in real-display rows: its top and height + * (header and content; a bottom switcher row hangs under it), and whether + * it spans the panel's whole width (Full Screen; never beside a side strip). + */ +export type DiagramBand = { top: number; height: number; fullWidth: boolean }; + +/** + * A layout as the real chrome lays it out (geometry.ts, chrome-layer.ts): + * the window band with its status bar and frame, and the switcher with a + * few icons, the first selected. A popup switcher shows only with + * `popupOpen`, dimming the window as it does. Status bar placement follows + * the current setting. + */ +export function drawLayout(d: Diagram, position: AppSwitcherPosition, band: DiagramBand, popupOpen: boolean): void { + const statusAtBottom = statusBarPositionSetting.get() === "bottom"; + const { top, height } = band; + switch (position) { + case "left": + case "right": { + const stripLeft = position === "left" ? 0 : G2_LENS_WIDTH - SIDEBAR_WIDTH; + const contentLeft = position === "left" ? SIDEBAR_WIDTH : 0; + const windowWidth = G2_LENS_WIDTH - SIDEBAR_WIDTH; + drawStatusBar(d, contentLeft, top, windowWidth, TOP_BAR_HEIGHT - 1); + drawContent(d, contentLeft, top + TOP_BAR_HEIGHT, windowWidth, height - TOP_BAR_HEIGHT, 1); + // The strip keeps to the 288px band's height, even beside taller windows. + const separator = position === "left" ? SIDEBAR_WIDTH - 1 : stripLeft; + d.vline(separator, top + TOP_BAR_HEIGHT, MIN_WINDOW_HEIGHT - TOP_BAR_HEIGHT, CHROME_LINE); + // One column of icons against the separator. + const column = position === "left" ? SIDEBAR_WIDTH - 36 : stripLeft; + for (let slot = 0; slot < 4; slot++) drawIcon(d, column + 2, top + TOP_BAR_HEIGHT + 10 + slot * 40, slot === 0); + return; + } + case "bottom": { + const { left, width, framed } = windowSpan(band); + // With the status bar in the row, the window's header is just the frame's top. + const header = !statusAtBottom ? TOP_BAR_HEIGHT : framed ? 1 : 0; + if (!statusAtBottom) drawStatusBar(d, left, top, width, framed ? null : TOP_BAR_HEIGHT - 1); + drawContent(d, left, top + header, width, height - header, 1); + if (framed) d.outline(left - 1, top + header - 1, width + 2, height - header + 2, WINDOW_FRAME, 8); + else d.hline(left, top + height, width, CHROME_LINE); + // The first cell starts at the frame's side, or inset like a scrolled row's (chrome-layer switcherLayout). + const cellsLeft = framed ? left - 1 : left + 8; + for (let slot = 0; slot < 4; slot++) drawIcon(d, cellsLeft + 2 + slot * 40, top + height + 2, slot === 0); + if (statusAtBottom) drawStatusItems(d, left + width, top + height + 4); + return; + } + case "popup": { + const { left, width, framed } = windowSpan(band); + const edge = framed ? 1 : 0; + const statusTop = statusAtBottom ? top + height - TOP_BAR_HEIGHT : top; + const contentTop = statusAtBottom ? top + edge : top + TOP_BAR_HEIGHT; + const contentHeight = height - TOP_BAR_HEIGHT - edge; + drawStatusBar(d, left, statusTop, width, framed ? null : statusAtBottom ? 0 : TOP_BAR_HEIGHT - 1); + drawContent(d, left, contentTop, width, contentHeight, popupOpen ? DIM : 1); + if (framed) d.outline(left - 1, contentTop - 1, width + 2, contentHeight + 2, WINDOW_FRAME, 8); + if (!popupOpen) return; + // The popup: a row of icons over the selected window's title, centred on the content. + const box = { width: 272, height: 98 }; + const boxLeft = left + (width - box.width) / 2; + const boxTop = contentTop + (contentHeight - box.height) / 2; + d.fill(boxLeft, boxTop, box.width, box.height, 0); + d.outline(boxLeft, boxTop, box.width, box.height, WINDOW_FRAME); + const iconsLeft = boxLeft + (box.width - (3 * 48 - 4)) / 2; + for (let slot = 0; slot < 3; slot++) drawIcon(d, iconsLeft + slot * 48 + 6, boxTop + 18, slot === 0); + d.fill(boxLeft + box.width / 2 - 50, boxTop + 70, 100, 12, STATUS, 6); + return; + } + } +} + +/** A bottom row or popup layout's window: centred at 576 wide and framed, or the panel's width without a frame. */ +function windowSpan(band: DiagramBand): { left: number; width: number; framed: boolean } { + return band.fullWidth + ? { left: 0, width: G2_LENS_WIDTH, framed: false } + : { left: SIDEBAR_WIDTH / 2, width: G2_LENS_WIDTH - SIDEBAR_WIDTH, framed: true }; +} + +/** + * A status bar's 28 rows from `y`; `divider` is the row (within them) of its + * line toward the window, if it draws one rather than meeting a frame. + */ +function drawStatusBar(d: Diagram, x: number, y: number, width: number, divider: number | null): void { + if (divider !== null) d.hline(x, y + divider, width, CHROME_LINE); + drawStatusItems(d, x + width, y); +} + +/** Notification icons, a battery and the clock, ending at `right`, in a status bar's 28 rows from `top`. */ +function drawStatusItems(d: Diagram, right: number, top: number): void { + d.fill(right - 64, top + 7, 56, 14, STATUS, 4); + d.outline(right - 108, top + 8, 32, 12, STATUS, 2); + d.outline(right - 148, top + 4, 20, 20, CHROME_LINE, 4); + d.outline(right - 176, top + 4, 20, 20, CHROME_LINE, 4); +} + +/** A switcher icon (32px); the selected one filled, as the switcher's selection tab is. */ +function drawIcon(d: Diagram, x: number, y: number, selected: boolean): void { + if (selected) d.fill(x, y, 32, 32, SELECTED_ICON, 6); + else d.outline(x, y, 32, 32, ICON, 6); +} + +/** Stand-in window content: a title and as many list rows as fit, the first selected. */ +function drawContent(d: Diagram, x: number, y: number, width: number, height: number, brightness: number): void { + const rowWidths = [width - 60, 300, 360, 240]; + d.fill(x + 18, y + 14, 150, 18, Math.round(CONTENT_TITLE * brightness), 6); + d.outline(x + 8, y + 44, width - 16, 34, Math.round(CONTENT * brightness), 8); + for (let row = 0; ; row++) { + const rowTop = y + 52 + row * 44; + if (rowTop + 18 > y + height - 8) break; + d.fill(x + 18, rowTop, Math.min(rowWidths[row % rowWidths.length]!, width - 36), 18, Math.round(CONTENT * brightness), 6); + } +} + +/** Real-display rows the Layout page's diagrams cover: a 288px band and a bottom switcher row under it. */ +export const LAYOUT_AREA_HEIGHT = MIN_WINDOW_HEIGHT + SWITCHER_ROW_HEIGHT; diff --git a/app/apps/onboarding/layout-page.ts b/app/apps/onboarding/layout-page.ts index 51aa7c05..0d2eae6c 100644 --- a/app/apps/onboarding/layout-page.ts +++ b/app/apps/onboarding/layout-page.ts @@ -1,8 +1,9 @@ import { G2_LENS_WIDTH, type GrayImage, type UiFont } from "../../graphics/image"; -import { appSwitcherPositionSetting, statusBarPositionSetting, type AppSwitcherPosition } from "../../ui/dashboard-settings"; +import { appSwitcherPositionSetting, type AppSwitcherPosition } from "../../ui/dashboard-settings"; import type { InputEvent } from "../../ui/gestures"; import { MENU_HIGHLIGHT_FILL, MENU_HIGHLIGHT_STROKE } from "../../ui/menu-core"; -import { MIN_WINDOW_HEIGHT, SIDEBAR_WIDTH, SWITCHER_ROW_HEIGHT, TOP_BAR_HEIGHT } from "../../ui/shell/geometry"; +import { MIN_WINDOW_HEIGHT } from "../../ui/shell/geometry"; +import { AREA_OUTLINE, Diagram, drawLayout, LAYOUT_AREA_HEIGHT } from "./layout-diagram"; import { onboardingFont } from "./onboarding-fonts"; import { drawPageHeading, type OnboardingNav, type OnboardingPage } from "./onboarding-page"; @@ -10,8 +11,6 @@ const CONTENT_GAP = 10; const BOTTOM_MARGIN = 8; /** Diagram width as a fraction of the display's: the most a diagram is drawn at. */ const DIAGRAM_SCALE = 0.4; -/** The real-display area a diagram covers: a 288px window band and a bottom switcher row under it. */ -const DIAGRAM_AREA_HEIGHT = MIN_WINDOW_HEIGHT + SWITCHER_ROW_HEIGHT; /** Padding inside a cell's selection box, round the diagram and its caption. */ const CELL_PADDING = 8; const CAPTION_GAP = 4; @@ -32,12 +31,12 @@ export function layoutHasDepth(position: AppSwitcherPosition): boolean { * The app switcher position, as a 2×2 grid of captioned diagrams of each * layout, Bottom (recommended, and selected at first) and Popup on top; * swipes move through them in reading order, a tap saves the selected one. - * The page is fullscreen, so the diagrams get 40% of the display's width + * The page is immersive, so the diagrams get 40% of the display's width * each. Choosing a layout reflows open windows (the dashboard controller * watches the setting). */ export class LayoutPage implements OnboardingPage { - readonly fullscreen = true; + readonly immersive = true; /** Kept across visits, so going back returns to the last choice. */ private selected = LAYOUT_ORDER.indexOf(RECOMMENDED_LAYOUT); @@ -54,11 +53,11 @@ export class LayoutPage implements OnboardingPage { // Short of DIAGRAM_SCALE only where two rows of cells wouldn't fit. const scale = Math.min( DIAGRAM_SCALE, - ((available - ROW_GAP) / 2 - 2 * CELL_PADDING - captionHeight) / DIAGRAM_AREA_HEIGHT, + ((available - ROW_GAP) / 2 - 2 * CELL_PADDING - captionHeight) / LAYOUT_AREA_HEIGHT, ((image.width - COLUMN_GAP) / 2 - 2 * CELL_PADDING) / G2_LENS_WIDTH, ); const diagramWidth = Math.round(G2_LENS_WIDTH * scale); - const diagramHeight = Math.round(DIAGRAM_AREA_HEIGHT * scale); + const diagramHeight = Math.round(LAYOUT_AREA_HEIGHT * scale); const cellWidth = diagramWidth + 2 * CELL_PADDING; const cellHeight = diagramHeight + 2 * CELL_PADDING + captionHeight; const left = Math.round((image.width - 2 * cellWidth - COLUMN_GAP) / 2); @@ -103,157 +102,13 @@ export class LayoutPage implements OnboardingPage { } } -// Diagram brightnesses: brighter than the real chrome's, which the diagrams -// shrink to a few pixels. -const AREA_OUTLINE = 30; -const CHROME_LINE = 100; -const WINDOW_FRAME = 140; -const ICON = 160; -const SELECTED_ICON = 230; -const STATUS = 140; -const CONTENT = 110; -const CONTENT_TITLE = 170; -/** Window content under a popup switcher, which dims it. */ -const DIM = 0.5; - /** - * Draws in real-display pixels, scaled into a cell: the DIAGRAM_AREA_HEIGHT - * rows from the diagram's top, or from `top` rows down (see from). + * A layout's diagram: the 288px band, with the popup switcher open. Only a + * bottom switcher row takes rows under the band; without one, the band sits + * centred in their place, as the band and row share the screen's slack. */ -class Diagram { - constructor( - private readonly image: GrayImage, - private readonly x: number, - private readonly y: number, - private readonly scale: number, - private readonly top = 0, - ) {} - - /** The same diagram with its row 0 `top` rows down. */ - from(top: number): Diagram { - return new Diagram(this.image, this.x, this.y, this.scale, top); - } - - private box(x: number, y: number, width: number, height: number) { - y += this.top; - const left = this.x + Math.round(x * this.scale), top = this.y + Math.round(y * this.scale); - return { - x: left, - y: top, - width: Math.max(1, this.x + Math.round((x + width) * this.scale) - left), - height: Math.max(1, this.y + Math.round((y + height) * this.scale) - top), - }; - } - - fill(x: number, y: number, width: number, height: number, value: number, radius = 0): void { - const box = this.box(x, y, width, height); - if (radius) this.image.fillRoundedRect(box.x, box.y, box.width, box.height, value, Math.max(1, Math.round(radius * this.scale))); - else this.image.fillRect(box.x, box.y, box.width, box.height, value); - } - - outline(x: number, y: number, width: number, height: number, value: number, radius = 0): void { - const box = this.box(x, y, width, height); - this.image.drawRoundedRect(box.x, box.y, box.width, box.height, value, Math.max(0, Math.round(radius * this.scale))); - } - - /** A one-pixel line along a real-pixel row (horizontal) or column. */ - hline(x: number, y: number, width: number, value: number): void { - const box = this.box(x, y, width, 1); - this.image.fillRect(box.x, box.y, box.width, 1, value); - } - - vline(x: number, y: number, height: number, value: number): void { - const box = this.box(x, y, 1, height); - this.image.fillRect(box.x, box.y, 1, box.height, value); - } -} - -/** - * A layout as the real chrome lays it out (geometry.ts, chrome-layer.ts), - * to scale and simplified: the window band with its status bar and frame, - * and the switcher with a few icons, the first selected. Status bar - * placement follows the current setting. Only a bottom switcher row takes - * rows under the band; without one, the band sits centred in their place, - * as the band and row share the screen's slack. - */ -function drawLayoutDiagram(area: Diagram, position: AppSwitcherPosition): void { - area.outline(0, 0, G2_LENS_WIDTH, DIAGRAM_AREA_HEIGHT, AREA_OUTLINE, 12); - const d = position === "bottom" ? area : area.from((DIAGRAM_AREA_HEIGHT - MIN_WINDOW_HEIGHT) / 2); - const statusAtBottom = statusBarPositionSetting.get() === "bottom"; - const windowLeft = SIDEBAR_WIDTH / 2, windowWidth = G2_LENS_WIDTH - SIDEBAR_WIDTH; - switch (position) { - case "left": - case "right": { - const stripLeft = position === "left" ? 0 : G2_LENS_WIDTH - SIDEBAR_WIDTH; - const contentLeft = position === "left" ? SIDEBAR_WIDTH : 0; - drawStatusBar(d, contentLeft, 0, windowWidth, true); - drawContent(d, contentLeft, TOP_BAR_HEIGHT, windowWidth, MIN_WINDOW_HEIGHT - TOP_BAR_HEIGHT, 1); - const separator = position === "left" ? SIDEBAR_WIDTH - 1 : stripLeft; - d.vline(separator, TOP_BAR_HEIGHT, MIN_WINDOW_HEIGHT - TOP_BAR_HEIGHT, CHROME_LINE); - // One column of icons against the separator. - const column = position === "left" ? SIDEBAR_WIDTH - 36 : stripLeft; - for (let slot = 0; slot < 4; slot++) drawIcon(d, column + 2, TOP_BAR_HEIGHT + 10 + slot * 40, slot === 0); - return; - } - case "bottom": { - // With the status bar in the row, the window's header is just the frame's top. - const contentTop = statusAtBottom ? 1 : TOP_BAR_HEIGHT; - if (!statusAtBottom) drawStatusBar(d, windowLeft, 0, windowWidth, false); - drawContent(d, windowLeft, contentTop, windowWidth, MIN_WINDOW_HEIGHT - contentTop, 1); - d.outline(windowLeft - 1, contentTop - 1, windowWidth + 2, MIN_WINDOW_HEIGHT - contentTop + 2, WINDOW_FRAME, 8); - for (let slot = 0; slot < 4; slot++) drawIcon(d, windowLeft + 1 + slot * 40, MIN_WINDOW_HEIGHT + 2, slot === 0); - if (statusAtBottom) drawStatusItems(d, windowLeft + windowWidth, MIN_WINDOW_HEIGHT + 4); - return; - } - case "popup": { - const statusTop = statusAtBottom ? MIN_WINDOW_HEIGHT - TOP_BAR_HEIGHT : 0; - const contentTop = statusAtBottom ? 1 : TOP_BAR_HEIGHT; - const contentHeight = MIN_WINDOW_HEIGHT - TOP_BAR_HEIGHT - 1; - drawStatusBar(d, windowLeft, statusTop, windowWidth, false); - drawContent(d, windowLeft, contentTop, windowWidth, contentHeight, DIM); - d.outline(windowLeft - 1, contentTop - 1, windowWidth + 2, contentHeight + 2, WINDOW_FRAME, 8); - // The popup: a row of icons over the selected window's title, centred on the content. - const box = { width: 272, height: 98 }; - const boxLeft = (G2_LENS_WIDTH - box.width) / 2; - const boxTop = contentTop + (contentHeight - box.height) / 2; - d.fill(boxLeft, boxTop, box.width, box.height, 0); - d.outline(boxLeft, boxTop, box.width, box.height, WINDOW_FRAME); - const iconsLeft = boxLeft + (box.width - (3 * 48 - 4)) / 2; - for (let slot = 0; slot < 3; slot++) drawIcon(d, iconsLeft + slot * 48 + 6, boxTop + 18, slot === 0); - d.fill(G2_LENS_WIDTH / 2 - 50, boxTop + 70, 100, 12, STATUS, 6); - return; - } - } -} - -/** A status bar along a window's top or bottom edge; `divider` draws its line toward the window. */ -function drawStatusBar(d: Diagram, x: number, y: number, width: number, divider: boolean): void { - if (divider) d.hline(x, y + TOP_BAR_HEIGHT - 1, width, CHROME_LINE); - drawStatusItems(d, x + width, y); -} - -/** Notification icons, a battery and the clock, ending at `right`, in a status bar's 28 rows from `top`. */ -function drawStatusItems(d: Diagram, right: number, top: number): void { - d.fill(right - 64, top + 7, 56, 14, STATUS, 4); - d.outline(right - 108, top + 8, 32, 12, STATUS, 2); - d.outline(right - 148, top + 4, 20, 20, CHROME_LINE, 4); - d.outline(right - 176, top + 4, 20, 20, CHROME_LINE, 4); -} - -/** A switcher icon (32px); the selected one filled, as the switcher's selection tab is. */ -function drawIcon(d: Diagram, x: number, y: number, selected: boolean): void { - if (selected) d.fill(x, y, 32, 32, SELECTED_ICON, 6); - else d.outline(x, y, 32, 32, ICON, 6); -} - -/** Stand-in window content: a title and list rows, the first selected. */ -function drawContent(d: Diagram, x: number, y: number, width: number, height: number, brightness: number): void { - const rowWidths = [width - 60, 300, 360, 240]; - d.fill(x + 18, y + 14, 150, 18, CONTENT_TITLE * brightness, 6); - d.outline(x + 8, y + 44, width - 16, 34, CONTENT * brightness, 8); - for (let row = 0; row < rowWidths.length; row++) { - const rowTop = y + 52 + row * 44; - if (rowTop + 18 > y + height) break; - d.fill(x + 18, rowTop, Math.min(rowWidths[row]!, width - 36), 18, CONTENT * brightness, 6); - } +function drawLayoutDiagram(d: Diagram, position: AppSwitcherPosition): void { + d.outline(0, 0, G2_LENS_WIDTH, LAYOUT_AREA_HEIGHT, AREA_OUTLINE, 12); + const top = position === "bottom" ? 0 : (LAYOUT_AREA_HEIGHT - MIN_WINDOW_HEIGHT) / 2; + drawLayout(d, position, { top, height: MIN_WINDOW_HEIGHT, fullWidth: false }, true); } diff --git a/app/apps/onboarding/onboarding-app.ts b/app/apps/onboarding/onboarding-app.ts index 1aa56c96..66a7000d 100644 --- a/app/apps/onboarding/onboarding-app.ts +++ b/app/apps/onboarding/onboarding-app.ts @@ -6,6 +6,7 @@ import { shell } from "../../ui/shell/shell"; import { findSoundEffect, playSoundEffect } from "../../ui/sound-effects"; import { DataCollectionPage } from "./data-collection-page"; import { DepthPage } from "./depth-page"; +import { DisplayModePage } from "./display-mode-page"; import { IosPrivacyPage } from "./ios-privacy-page"; import { LayoutPage } from "./layout-page"; import { markGlassesOnboardingFinished, ONBOARDING_APP_ID } from "./onboarding-progress"; @@ -27,7 +28,7 @@ export function createOnboardingAppWindow(options: InProcessAppOptions): InProce const pages: OnboardingPage[] = [ new WelcomePage(), new TextSizePage(), ...(global.isIOS ? [new IosPrivacyPage()] : []), - new DataCollectionPage(), new LayoutPage(), new DepthPage(), + new DataCollectionPage(), new LayoutPage(), new DepthPage(), new DisplayModePage(), ]; const app = createInProcessWindow({ appId: ONBOARDING_APP_ID, @@ -36,12 +37,12 @@ export function createOnboardingAppWindow(options: InProcessAppOptions): InProce iconLetter: "On", icon: "sparkles", closeable: true, - fullscreen: pages[0]!.fullscreen, + immersive: pages[0]!.immersive, actions: options.actions, baseLayer: new OnboardingLayer( pages, // Only called on page changes, by when `app` is set. - (fullscreen) => app.setFullscreen(fullscreen), + (immersive) => app.setImmersive(immersive), () => { markGlassesOnboardingFinished(); shell.closeWindow(ONBOARDING_WINDOW_ID); @@ -69,7 +70,7 @@ function playWelcomeSound(actions: LayerActions): void { } /** - * Hosts the current page, fullscreen or not as it asks. Double-click steps + * Hosts the current page, immersive or not as it asks. Double-click steps * back a page, or leaves the app from the first one (the standard yield to * the app switcher); every other gesture goes to the page. Pages that don't * apply (Depth beside a side-strip app switcher) are skipped either way. @@ -79,7 +80,7 @@ export class OnboardingLayer implements Layer { constructor( private readonly pages: readonly OnboardingPage[], - private readonly setFullscreen: (fullscreen: boolean) => void, + private readonly setImmersive: (immersive: boolean) => void, private readonly finish: () => void, ) { pages[0]!.enter?.(); @@ -120,6 +121,6 @@ export class OnboardingLayer implements Layer { this.index = index; const page = this.pages[index]!; page.enter?.(); - this.setFullscreen(page.fullscreen ?? false); + this.setImmersive(page.immersive ?? false); } } diff --git a/app/apps/onboarding/onboarding-page.ts b/app/apps/onboarding/onboarding-page.ts index 8f2d1541..5081854d 100644 --- a/app/apps/onboarding/onboarding-page.ts +++ b/app/apps/onboarding/onboarding-page.ts @@ -16,11 +16,11 @@ export type OnboardingNav = { */ export interface OnboardingPage { /** - * Show the page fullscreen: the whole 640×480 panel, with the app switcher - * and status bar hidden. Otherwise it is an ordinary window in the - * chosen layout. + * Show the page immersive (full-screen): the whole 640×480 panel, with + * the app switcher and status bar hidden. Otherwise it is an ordinary + * window in the chosen layout. */ - readonly fullscreen?: boolean; + readonly immersive?: boolean; /** Whether the page belongs in the flow right now; skipped both ways when false. */ applies?(): boolean; /** The page became current, going forward or back. */ diff --git a/app/apps/onboarding/text-size-page.ts b/app/apps/onboarding/text-size-page.ts index 49969c36..4c67627c 100644 --- a/app/apps/onboarding/text-size-page.ts +++ b/app/apps/onboarding/text-size-page.ts @@ -48,7 +48,7 @@ type Face = * while scrolling. */ export class TextSizePage implements OnboardingPage { - readonly fullscreen = true; + readonly immersive = true; private face: Face = { kind: "fixed", label: "Terminus" }; private readonly sizeMenu = new Menu({ wrap: false, diff --git a/app/apps/onboarding/welcome-page.ts b/app/apps/onboarding/welcome-page.ts index 1a96b715..4d9c62b4 100644 --- a/app/apps/onboarding/welcome-page.ts +++ b/app/apps/onboarding/welcome-page.ts @@ -16,7 +16,7 @@ type TextLine = { font: UiFont; text: string; value: number; spaceBefore: number /** The splash: logo beside the name, version and how to go on, centred as one group. */ export class WelcomePage implements OnboardingPage { - readonly fullscreen = true; + readonly immersive = true; paint(image: GrayImage): void { const { width, height } = image; diff --git a/app/apps/pinball/pinball-app.worker.ts b/app/apps/pinball/pinball-app.worker.ts index 9881d602..13d5242e 100644 --- a/app/apps/pinball/pinball-app.worker.ts +++ b/app/apps/pinball/pinball-app.worker.ts @@ -66,7 +66,7 @@ const PANEL_X = 310; /** * Height the table and panel are drawn for: a min-height window's viewport * under the standard top bar. A taller viewport (the status bar folded into - * the switcher row, a full-panel display) centers the layout vertically. + * the switcher row, a Tall or Full Screen display) centers the layout vertically. */ const LAYOUT_HEIGHT = 260; diff --git a/app/apps/terminal/terminal-app.worker.ts b/app/apps/terminal/terminal-app.worker.ts index 6cf44429..87bf9fdc 100644 --- a/app/apps/terminal/terminal-app.worker.ts +++ b/app/apps/terminal/terminal-app.worker.ts @@ -55,10 +55,9 @@ import { clamp } from "../../util/numeric-util"; import { enumSettingMenuItem, terminalAutoReconnectSetting, - terminalDisplayModeSetting, + terminalDisplayLayoutSetting, terminalLaunchPresetsSetting, terminalNewConnectionSetting, - terminalVerticalPositionSetting, terminalWakeOnBellSetting, textSettingMenuItem, toggleSettingMenuItem, @@ -1118,8 +1117,7 @@ function windowMenuItems(window: TerminalWindow): MenuItem[] { */ function settingsMenuItems(): MenuItem[] { return [ - enumSettingMenuItem(terminalDisplayModeSetting), - enumSettingMenuItem(terminalVerticalPositionSetting), + enumSettingMenuItem(terminalDisplayLayoutSetting), terminalFontPickerMenuItem(), // Opens the phone text editor; the settings listener repaints its page. textSettingMenuItem(terminalLaunchPresetsSetting), diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 3bee2934..53ce6cb8 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -72,7 +72,7 @@ import { loadPersistedOpenApps, savePersistedOpenApps } from "../ui/shell/open-a import { appViewportRect, isOnSwitcherEdge, sidebarStripVisible, type WindowHeightMode } from "../ui/shell/geometry"; import { type LayerActions, type TextSettingsEditToggle } from "../ui/layers"; import { type KeyboardInputSession } from "../ui/shell/keyboard-input"; -import { appSwitcherPositionSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayModeSetting, navigateDisplayModeSetting, navigateVerticalPositionSetting, terminalDisplayModeSetting, terminalVerticalPositionSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, verticalPositionSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings"; +import { appSwitcherPositionSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayLayoutSetting, navigateDisplayLayoutSetting, terminalDisplayLayoutSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings"; import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization"; import { getInstalledEvenHubAppById, @@ -184,24 +184,26 @@ const EVEN_APP_DETECTED_MESSAGE = const LAUNCHABLE_APPS = ALL_APPS.filter((app) => app.showInLauncher !== false); /** - * The global settings window viewport sizes depend on: the display mode, - * whether the app switcher takes width beside windows, height below them - * or neither (a popup), and the chrome rows each window loses to it: below - * them, whether the status bar joins the row (dropping the top bar); with a - * popup, whether the status bar keeps rows of its own and the window frame - * (where the status bar goes only moves windows). + * The global settings window viewport sizes depend on: the display mode's + * size (a band's position only moves windows), whether the app switcher + * takes width beside windows, height below them or neither (a popup), and + * the chrome rows each window loses to it: below them, whether the status + * bar joins the row (dropping the top bar); with a popup, whether the + * status bar keeps rows of its own and the window frame (where the status + * bar goes only moves windows). */ function viewportSizesKey(): string { const position = appSwitcherPositionSetting.get(); const switcher = position === "bottom" ? `row|${statusBarPositionSetting.get()}` : position === "popup" ? `popup|${statusBarVisibilitySetting.get()}|${windowBorderSetting.get()}` : "strip"; - return `${displayModeSetting.get()}|${switcher}`; + const layout = displayLayoutSetting.get(); + return `${layout.startsWith("band-") ? "band" : layout}|${switcher}`; } /** The global settings that move window surfaces without resizing them. */ function windowPlacementKey(): string { - return `${verticalPositionSetting.get()}|${appSwitcherPositionSetting.get()}|${statusBarPositionSetting.get()}`; + return `${displayLayoutSetting.get()}|${appSwitcherPositionSetting.get()}|${statusBarPositionSetting.get()}`; } function createInitialDisplayPreview(): ImageSource | null { @@ -449,8 +451,8 @@ class DashboardController { this.pushFirmwareDebugFlags(); this.pushBrightness(); this.syncEvenHubScreenOffSetting(); - // Display mode first: a reflow repositions every surface too, so the - // vertical-position check after it then has nothing left to do. + // Display mode size first: a reflow repositions every surface too, so + // the band-position check after it then has nothing left to do. this.applyDisplayModeIfChanged(); this.applyVerticalPositionIfChanged(); this.applyAppLayoutsIfChanged(); @@ -530,7 +532,7 @@ class DashboardController { }); } - // Vertical-position changes (and moving the app switcher between the left + // Band position changes (and moving the app switcher between the left // and right edges, or a popup switcher's status bar between the top and // bottom) move every window surface and the chrome that aligns with them; // the values are tracked so unrelated setting changes don't trigger a full @@ -540,7 +542,7 @@ class DashboardController { private lastViewportSizes = viewportSizesKey(); /** - * Display mode changed (Settings > Display, or the phone page's picker), + * Display mode size changed (Settings > Display, or the phone page's picker), * or the app switcher or its chrome changed what windows lose to them * (see viewportSizesKey): every window's viewport size changes. In-process windows re-measure in place; workers * that support resizing receive the new viewport. Other worker windows are @@ -586,8 +588,8 @@ class DashboardController { private appLayouts(): Record { return { - navigate: `${navigateDisplayModeSetting.get()}:${navigateVerticalPositionSetting.get()}`, - terminal: `${terminalDisplayModeSetting.get()}:${terminalVerticalPositionSetting.get()}`, + navigate: navigateDisplayLayoutSetting.get(), + terminal: terminalDisplayLayoutSetting.get(), }; } diff --git a/app/g2/ios-preview-controller.ts b/app/g2/ios-preview-controller.ts index feace883..699414e5 100644 --- a/app/g2/ios-preview-controller.ts +++ b/app/g2/ios-preview-controller.ts @@ -44,7 +44,7 @@ import { noopLayerActions, type LayerActions } from '../ui/layers' import { TextViewerLayer } from '../apps/files/text-viewer' import { shell, rawInputEventToInputEvent, type ShellWindow } from '../ui/shell/shell' import { appViewportRect, isOnSwitcherEdge, sidebarStripVisible } from '../ui/shell/geometry' -import { DISPLAY_MODE_VALUES, displayModeLabel, displayModeSetting, onAnySettingChanged, +import { onAnySettingChanged, previewColorSetting, lockScreenEnabledSetting, getBrightnessPreferences, getStringSettingById, nightscoutSiteUrlSetting, nightscoutApiTokenSetting } from '../ui/dashboard-settings' import type { PhoneGesture } from '../phone-ui/phone-gestures' @@ -658,11 +658,6 @@ export class IosPreviewController { this.appHosts.set(appId, host) return host } - cycleDisplayMode(): void { - const values = DISPLAY_MODE_VALUES - displayModeSetting.set(values[(values.indexOf(displayModeSetting.get()) + 1) % values.length]) - } - get displayModeLabel(): string { return displayModeLabel(displayModeSetting.get()) } get connectionState(): SessionState | null { return this.sessionCreated ? this.state : null } get connectionDetails(): string { const state = this.connectionState diff --git a/app/g2/wear-remote.ts b/app/g2/wear-remote.ts index 492fb9d8..9ce66457 100644 --- a/app/g2/wear-remote.ts +++ b/app/g2/wear-remote.ts @@ -28,8 +28,6 @@ import { type AppDefinition } from "../apps/app-definition"; import { getInstalledEvenHubApps, installedEvenHubAppId } from "../apps/evenhub/installed-apps"; import { WEAR_PATHS, wearBridge, type WearMessage } from "../native/wear-bridge"; import { - DISPLAY_MODE_VALUES, - displayModeSetting, onAnySettingChanged, watchCanUnlockSetting, watchCrownClockwiseNextSetting, @@ -88,7 +86,6 @@ const COMMANDS = [ "connect", "disconnect", "close-assistant", - "display-mode", ] as const; type WearCommand = (typeof COMMANDS)[number]; @@ -277,7 +274,6 @@ export class WearRemote { acceptsText: typeof window.receiveTextInput === "function", })), apps: this.listApps(), - displayMode: displayModeSetting.get(), remoteEnabled: watchRemoteEnabledSetting.get(), crownClockwiseNext: watchCrownClockwiseNextSetting.get(), canUnlock: watchCanUnlockSetting.get(), @@ -522,17 +518,6 @@ export class WearRemote { // but tell the watch which of the two happened. ack(true, shell.closeAssistant() ? "" : "The assistant was not open."); return; - case "display-mode": { - const value = String(payload.value ?? ""); - if (!(DISPLAY_MODE_VALUES as readonly string[]).includes(value)) { - ack(false, `Unknown display mode: ${value}`); - return; - } - displayModeSetting.set(value as (typeof DISPLAY_MODE_VALUES)[number]); - this.schedulePublish(); - ack(true, `Display mode: ${value}`); - return; - } default: ack(false, `Unhandled command: ${command}`); } diff --git a/app/phone-ui/remote-controls-view-model.ts b/app/phone-ui/remote-controls-view-model.ts index b846cea9..8efdd3d8 100644 --- a/app/phone-ui/remote-controls-view-model.ts +++ b/app/phone-ui/remote-controls-view-model.ts @@ -1,8 +1,5 @@ import { Dialogs, Observable } from '@nativescript/core'; -import { - brightnessSetting, DISPLAY_MODE_VALUES, displayModeLabel, displayModeSetting, - type BrightnessSetting, type DisplayModeSetting, -} from '../ui/dashboard-settings'; +import { brightnessSetting, displayLayoutSetting, type BrightnessSetting } from '../ui/dashboard-settings'; type ControlsTab = 'settings' | 'watch' | 'ring'; // Remember the tab across navigation on both platforms, without persisting it. @@ -65,17 +62,19 @@ export class RemoteControlsViewModel extends Observable { // ---- display mode and brightness, on the Settings tab ---- get displayModeLabel(): string { - return displayModeLabel(displayModeSetting.get()) + " ▾"; + return displayLayoutSetting.displayValue() + " ▾"; } async onDisplayModeTap(): Promise { - const current = displayModeSetting.get(); - const options = DISPLAY_MODE_VALUES.map((value) => displayModeLabel(value) + (value === current ? " ✓" : "")); + const current = displayLayoutSetting.get(); + // Full Screen is offered only with a bottom or popup app switcher. + const values = displayLayoutSetting.values.filter((value) => !displayLayoutSetting.isDisabled(value)); + const options = values.map((value) => displayLayoutSetting.displayValue(value) + (value === current ? " ✓" : "")); const picked = await Dialogs.action({ title: "Display mode", cancelButtonText: "Cancel", actions: options }); const index = options.indexOf(picked); if (index < 0) return; - const value = DISPLAY_MODE_VALUES[index] as DisplayModeSetting; - if (value !== current) displayModeSetting.set(value); + const value = values[index]!; + if (value !== current) displayLayoutSetting.set(value); this.notifyPropertyChange("displayModeLabel", this.displayModeLabel); } diff --git a/app/phone-ui/remote-controls.xml b/app/phone-ui/remote-controls.xml index 4790537f..943d39e9 100644 --- a/app/phone-ui/remote-controls.xml +++ b/app/phone-ui/remote-controls.xml @@ -38,7 +38,7 @@ -