forked from Blendman974/faceclaw
Send a single large image rather than 4 tiles
This commit is contained in:
1 parent
401cf6d4c1
commit
8f28ede647
10 files changed
+150
-430
No files matched your search
@@ -22,7 +22,6 @@ export type SystemCardSettings = {
|
||||
};
|
||||
export type SystemCardSettingKey = keyof SystemCardSettings;
|
||||
export type ScreenTimeoutSetting = "15s" | "30s" | "1m" | "never";
|
||||
export type WakeModeSetting = "tiled" | "synchronized";
|
||||
|
||||
type ConfigSettingOptions<TValue, TId extends string> = {
|
||||
id: TId;
|
||||
@@ -221,15 +220,6 @@ export const screenTimeoutSetting = new ConfigSettingEnum<ScreenTimeoutSetting>(
|
||||
formatValue: screenTimeoutLabel,
|
||||
});
|
||||
|
||||
export const wakeModeSetting = new ConfigSettingEnum<WakeModeSetting>({
|
||||
id: "wake-mode",
|
||||
label: "Wake mode",
|
||||
storageKey: "display.wakeMode",
|
||||
defaultValue: "tiled",
|
||||
values: ["tiled", "synchronized"],
|
||||
formatValue: (value) => value === "tiled" ? "Tiled" : "Synchronized",
|
||||
});
|
||||
|
||||
export const voiceControlEnabledSetting = new ConfigSettingBoolean({
|
||||
id: "voice-control-enabled",
|
||||
label: "Enable",
|
||||
@@ -237,13 +227,6 @@ export const voiceControlEnabledSetting = new ConfigSettingBoolean({
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
export const estimateCompressionRatiosSetting = new ConfigSettingBoolean({
|
||||
id: "estimate-compression-ratios",
|
||||
label: "Estimate compression ratios",
|
||||
storageKey: "debug.estimateCompressionRatios",
|
||||
defaultValue: false,
|
||||
});
|
||||
|
||||
export const nightscoutSiteUrlSetting = new ConfigSettingString({
|
||||
id: "nightscout-site-url",
|
||||
label: "Nightscout site URL",
|
||||
|
||||
+1
-13
@@ -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, wakeModeSetting, type DashboardSlotId, DashboardPluginId, bottomRightSlotSetting, bottomLeftSlotSetting, dashboardSlotIds } from "./dashboard-settings";
|
||||
import { 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";
|
||||
@@ -23,7 +23,6 @@ type DashboardState = {
|
||||
logLines: string[];
|
||||
screenOn: boolean;
|
||||
lastInputAtMs: number;
|
||||
tiledWakePaintPending: boolean;
|
||||
telepromptDocumentText: string | null;
|
||||
battery: DashboardBatteryLevels;
|
||||
};
|
||||
@@ -32,7 +31,6 @@ export let dashboardState: DashboardState = {
|
||||
logLines: [] as string[],
|
||||
screenOn: true,
|
||||
lastInputAtMs: Date.now(),
|
||||
tiledWakePaintPending: false,
|
||||
telepromptDocumentText: null as string | null,
|
||||
battery: {
|
||||
headset: null,
|
||||
@@ -104,7 +102,6 @@ export async function receiveInput(event: RawInputEvent): Promise<void> {
|
||||
if (!dashboardState.screenOn) {
|
||||
if (inputEvent.type === "double-click") {
|
||||
dashboardState.screenOn = true;
|
||||
dashboardState.tiledWakePaintPending = wakeModeSetting.get() === "tiled";
|
||||
if (dashboardLayers.isAtBase()) {
|
||||
dashboardLayers.push(createRootMenuLayer());
|
||||
}
|
||||
@@ -145,12 +142,6 @@ export function drawDashboard(): GrayImage {
|
||||
return dashboardLayers.paint();
|
||||
}
|
||||
|
||||
export function consumeDashboardTiledWakePaint(): boolean {
|
||||
const value = dashboardState.tiledWakePaintPending;
|
||||
dashboardState.tiledWakePaintPending = false;
|
||||
return value;
|
||||
}
|
||||
|
||||
export function applyDashboardScreenTimeout(nowMs = Date.now()): boolean {
|
||||
const timeoutMs = screenTimeoutSettingToMs(screenTimeoutSetting.get());
|
||||
if (timeoutMs === null || !dashboardState.screenOn) return false;
|
||||
@@ -179,7 +170,6 @@ export function openAndroidNotificationFromSleep(notificationKey: string, nowMs
|
||||
|
||||
dashboardState.lastInputAtMs = nowMs;
|
||||
dashboardState.screenOn = true;
|
||||
dashboardState.tiledWakePaintPending = wakeModeSetting.get() === "tiled";
|
||||
dashboardLayers.clearToBase();
|
||||
dashboardLayers.push(createRootMenuLayer());
|
||||
dashboardLayers.push(new SingleNotificationLayer(notificationKey, {
|
||||
@@ -191,7 +181,6 @@ export function openAndroidNotificationFromSleep(notificationKey: string, nowMs
|
||||
|
||||
function closeNewNotificationTrigger(ctx: LayerContext): void {
|
||||
dashboardState.screenOn = false;
|
||||
dashboardState.tiledWakePaintPending = false;
|
||||
ctx.stack.clearToBase();
|
||||
}
|
||||
|
||||
@@ -200,7 +189,6 @@ export function resetDashboardSleepTimerAndWake(nowMs = Date.now()): boolean {
|
||||
if (dashboardState.screenOn) return false;
|
||||
|
||||
dashboardState.screenOn = true;
|
||||
dashboardState.tiledWakePaintPending = wakeModeSetting.get() === "tiled";
|
||||
dashboardLayers.clearToBase();
|
||||
dashboardLayers.push(createRootMenuLayer());
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { dashboardState, TOP_LEFT_MENU_LAYOUT } from "../dashboard";
|
||||
import { dashboardSlotIds, enumSettingMenuItem, estimateCompressionRatiosSetting, showSignalStrengthSetting, showAndroidNotificationsSetting, showBatteryIndicatorsSetting, showFaceclawLogoSetting, systemCardNameSetting, textSettingMenuItem, toggleSettingMenuItem, voiceControlEnabledSetting, wakeModeSetting, dashboardSlotSettings, nightscoutSiteUrlSetting, nightscoutApiTokenSetting, screenTimeoutSetting } from "../dashboard-settings";
|
||||
import { dashboardSlotIds, enumSettingMenuItem, showSignalStrengthSetting, showAndroidNotificationsSetting, showBatteryIndicatorsSetting, showFaceclawLogoSetting, systemCardNameSetting, textSettingMenuItem, toggleSettingMenuItem, voiceControlEnabledSetting, dashboardSlotSettings, nightscoutSiteUrlSetting, nightscoutApiTokenSetting, screenTimeoutSetting } from "../dashboard-settings";
|
||||
import { MenuLayer } from "../menu";
|
||||
|
||||
export function createSettingsMenuLayer(): MenuLayer {
|
||||
@@ -44,8 +44,6 @@ function createDisplaySettingsMenuLayer(): MenuLayer {
|
||||
dashboardState.lastInputAtMs = Date.now();
|
||||
},
|
||||
}),
|
||||
enumSettingMenuItem(wakeModeSetting),
|
||||
toggleSettingMenuItem(estimateCompressionRatiosSetting),
|
||||
],
|
||||
TOP_LEFT_MENU_LAYOUT,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user