forked from Blendman974/faceclaw
UI tweaks
This commit is contained in:
1 parent
c199dc2369
commit
cc4b69fb80
9 files changed
+19
-12
No files matched your search
@@ -324,7 +324,7 @@ export const voiceProviderSetting = new ConfigSettingEnum<VoiceProvider>({
|
||||
|
||||
const wakeWordActionLabels: Record<WakeWordAction, string> = {
|
||||
"voice-input": "Voice Input",
|
||||
off: "Off",
|
||||
off: "Ignore",
|
||||
"turn-screen-on": "Turn Screen On",
|
||||
};
|
||||
|
||||
|
||||
@@ -142,7 +142,6 @@ export class FontPickerLayer implements Layer {
|
||||
const info = `Line height: ${preview.lineHeight}px`;
|
||||
image.drawText(font, rowX - 4, previewTop + 8 + preview.lineHeight + 6, info, 110);
|
||||
|
||||
image.drawText(font, rowX - 4, height - font.lineHeight - 8, `scroll select click change ${GESTURE_DOUBLE_CLICK} cancel`, 90);
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -215,7 +214,7 @@ export class FontPickerLayer implements Layer {
|
||||
this.draft.kind === "bitmap"
|
||||
? Math.max(0, this.options.bitmapFaces.findIndex((b) => b.face === (this.draft as { face: BitmapFace }).face))
|
||||
: this.options.bitmapFaces.length + this.families.indexOf(this.draft.family);
|
||||
openModalMenu(ctx, "Font", items, Math.max(0, currentIndex));
|
||||
openModalMenu(ctx, "Font Face", items, Math.max(0, currentIndex));
|
||||
}
|
||||
|
||||
/** Switch families, carrying the weight (nearest available) and size over. */
|
||||
|
||||
+9
-2
@@ -26,6 +26,12 @@ export type MenuLayout = {
|
||||
minHeight?: number;
|
||||
/** Height cap before the menu starts scrolling. Default: the full screen. */
|
||||
maxHeight?: number;
|
||||
/**
|
||||
* Paint as a standalone page: the layers below stay in the stack for back
|
||||
* navigation but are not composited underneath. Default: false — the menu
|
||||
* renders over whatever is below it (modal/window menus).
|
||||
*/
|
||||
opaque?: boolean;
|
||||
};
|
||||
|
||||
export type MenuItemRenderArgs = {
|
||||
@@ -192,7 +198,8 @@ export class MenuLayer implements Layer {
|
||||
paint(ctx: LayerContext, paintBelow: PaintBelow): GrayImage {
|
||||
const font = getDefaultSmallFont();
|
||||
const rowHeight = listRowHeight(font);
|
||||
const image = paintBelow();
|
||||
const base = ctx.stack.getBaseSize();
|
||||
const image = this.layout.opaque ? new GrayImage(base.width, base.height, 0) : paintBelow();
|
||||
const { x, y, width } = this.layout;
|
||||
const chromeTop = (this.title ? menuTitleHeight(font) : 0) + MENU_BODY_PADDING;
|
||||
const minHeight = this.layout.minHeight ?? DEFAULT_MENU_MIN_HEIGHT;
|
||||
@@ -333,7 +340,7 @@ export class TextPageLayer implements Layer {
|
||||
private readonly body: string,
|
||||
) {}
|
||||
|
||||
paint(ctx: LayerContext): GrayImage {
|
||||
paint(_ctx: LayerContext): GrayImage {
|
||||
const font = getDefaultSmallFont();
|
||||
const image = new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0);
|
||||
image.drawText(font, 18, 14, this.title, 220);
|
||||
|
||||
@@ -129,7 +129,7 @@ export class AssistantLayer implements Layer {
|
||||
image.drawText(font, left + 4, rowY + 2, rows[i]!, selected ? 255 : 200);
|
||||
}
|
||||
} else {
|
||||
image.drawText(font, left, top + DIALOG_H - 14, `${GESTURE_DOUBLE_CLICK} cancel`, 110);
|
||||
image.drawText(font, left, top + DIALOG_H - 14, `${GESTURE_DOUBLE_CLICK} cancel`, 110 - font.lineHeight);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ export class VoiceInputLayer implements Layer {
|
||||
image.drawText(font, left + 4, rowY + 2, row.label, row.dim ? 90 : selected ? 255 : 200);
|
||||
}
|
||||
} else {
|
||||
image.drawText(font, left, top + DIALOG_H - 14, this.hintText(), 110);
|
||||
image.drawText(font, left, top + DIALOG_H - 14, this.hintText(), 110-font.lineHeight);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user