forked from Blendman974/faceclaw
Merge notification focus and selected menu-label scrolling
This commit is contained in:
commit
309f05547b
14 files changed
+577
-26
No files matched your search
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user