forked from Blendman974/faceclaw
Various UI tweaks
Fix missing submenu indicators and change their appearance. Clean up styling in the Terminal app and move Settings to the top-level menu. Remove right padding from the bottom bar.
This commit is contained in:
1 parent
eff32d4a5a
commit
295922effd
12 files changed
+95
-96
No files matched your search
@@ -1,11 +1,14 @@
|
||||
import { wrapText, type WrapFont } from '../../graphics/textwrap';
|
||||
|
||||
/** Left edge of the hub's title line (and of a wrapped status block under it). */
|
||||
export const HUB_TITLE_X = 12;
|
||||
|
||||
/** Keep short status on the title row; give long errors their full width. */
|
||||
export function layoutHubHeader(font: WrapFont, title: string, status: string, width: number, step: number) {
|
||||
const inlineX = 18 + font.measureText(title) + 16;
|
||||
const inlineX = HUB_TITLE_X + font.measureText(title) + 16;
|
||||
const inline = !/[\r\n]/.test(status) && font.measureText(status) <= Math.max(0, width - inlineX - 12);
|
||||
const lines = inline ? [status] : wrapText(font, status, Math.max(1, width - 30));
|
||||
const x = inline ? inlineX : 18;
|
||||
const lines = inline ? [status] : wrapText(font, status, Math.max(1, width - HUB_TITLE_X - 12));
|
||||
const x = inline ? inlineX : HUB_TITLE_X;
|
||||
const y = inline ? 10 : 10 + step;
|
||||
return { x, y, lines, listTop: inline ? 16 + step : 16 + step * (1 + lines.length) };
|
||||
}
|
||||
Reference in new issue
Block a user