feat: isolate notification popups and scroll selected menu labels

This commit is contained in:
MasterControl committed 2026-11-10 17:31:13 +00:00
1 parent b4a2b2931b
commit 22df4d76d9
14 files changed
+577 -26

No files matched your search

+6 -4
View File
@@ -4,7 +4,7 @@ import { wrapText } from "../../graphics/textwrap";
import { InputEvent } from "../gestures";
import { Layer, LayerContext, PaintBelow } from "../layers";
import { isMenuItemDisabled, MenuItem, MenuLayer, openModalMenu } from "../menu";
import { Menu } from "../menu-core";
import { Menu, drawMenuLabel } from "../menu-core";
import { LIST_ROW_TEXT_INSET, lineStep, listRowHeight } from "../metrics";
import { shell } from "../shell/shell";
@@ -66,8 +66,9 @@ export class SettingsPanelLayer implements Layer {
rowGap: ROW_GAP,
highlight: { radius: 6 },
getHeight: () => listRowHeight(getDefaultSmallFont()),
draw: ({ image, item, x, y, selected }) => {
image.drawText(getDefaultSmallFont(), x + ROW_TEXT_X, y + LIST_ROW_TEXT_INSET, item.label, selected ? 255 : 200);
draw: ({ image, item, x, y, width, selected }) => {
drawMenuLabel(image, getDefaultSmallFont(), x + ROW_TEXT_X, y + LIST_ROW_TEXT_INSET,
width - ROW_TEXT_X - 8, item.label, selected ? 255 : 200);
},
});
this.rightMenu = new Menu<MenuItem>({
@@ -92,7 +93,8 @@ export class SettingsPanelLayer implements Layer {
ctx: this.paintCtx!,
});
} else {
image.drawText(getDefaultSmallFont(), x + ROW_TEXT_X, y + LIST_ROW_TEXT_INSET, item.label,
drawMenuLabel(image, getDefaultSmallFont(), x + ROW_TEXT_X, y + LIST_ROW_TEXT_INSET,
width - ROW_TEXT_X - 8, item.label,
disabled ? 70 : selected ? 255 : 200);
}
},