forked from Blendman974/faceclaw
UI improvements
Menus can paginate and be taller than quarter-screen. Text config setting editor selects all on enter, exits on confirm. Notification icons are displayed on the notifications-list and single-notification pages.
This commit is contained in:
1 parent
049824f489
commit
d2a942f5a3
11 files changed
+223
-26
No files matched your search
+10
-2
@@ -5,7 +5,7 @@ import { mediaControllerBridge } from "../native/media-controller";
|
||||
import { nightscoutBridge } from "../native/nightscout-bridge";
|
||||
import { EventSourceType, OsEventTypeList } from "../g2/events";
|
||||
import { getDashboardPlugin, type DashboardPluginCardBounds, type DashboardPluginState } from "./dashboard-plugins";
|
||||
import { isNightscoutSettingsConfigured, screenTimeoutSettingToMs, screenTimeoutSetting, type DashboardSlotId, DashboardPluginId, bottomRightSlotSetting, bottomLeftSlotSetting, dashboardSlotIds } from "./dashboard-settings";
|
||||
import { EditTextSettingLayer, isNightscoutSettingsConfigured, screenTimeoutSettingToMs, screenTimeoutSetting, type DashboardSlotId, DashboardPluginId, bottomRightSlotSetting, bottomLeftSlotSetting, dashboardSlotIds } from "./dashboard-settings";
|
||||
import { Layer, LayerActions, LayerStack, type DashboardInputEvent, type LayerContext } from "./layers";
|
||||
import { SingleNotificationLayer } from "./notifications";
|
||||
import { TelepromptLayer } from "./apps/teleprompt";
|
||||
@@ -51,7 +51,7 @@ const dashboardActions: LayerActions = {
|
||||
playBuzzerNote: () => {},
|
||||
};
|
||||
const dashboardFont = getDefaultSmallFont();
|
||||
export const TOP_LEFT_MENU_LAYOUT = { x: 8, y: 8, width: 272, height: 128 };
|
||||
export const TOP_LEFT_MENU_LAYOUT = { x: 8, y: 8, width: 272 };
|
||||
|
||||
function rawInputEventToInputEvent(event: RawInputEvent): DashboardInputEvent {
|
||||
if (event.kind === "sys-event") {
|
||||
@@ -136,6 +136,14 @@ export function setDashboardActions(actions: Partial<LayerActions>): void {
|
||||
dashboardLayers.setActions(actions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the glasses-side text-setting edit page, e.g. when the user finishes
|
||||
* typing on the phone. Returns whether the display changed.
|
||||
*/
|
||||
export function closeDashboardTextSettingEditor(): boolean {
|
||||
return dashboardLayers.popIfTop((layer) => layer instanceof EditTextSettingLayer);
|
||||
}
|
||||
|
||||
export function drawDashboard(): GrayImage {
|
||||
if (!dashboardState.screenOn) {
|
||||
return new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0);
|
||||
|
||||
Reference in new issue
Block a user