forked from Blendman974/faceclaw
Merge branch 'main' of https://github.com/jimrandomh/faceclaw
This commit is contained in:
commit
51edaee883
27 files changed
+634
-127
No files matched your search
@@ -52,11 +52,19 @@ export class ShellModalLayer implements Layer {
|
||||
this.stack.setBaseSize(interior);
|
||||
// Flattening bakes the inner stack's planes (glyphs included) so the blit
|
||||
// below transplants the finished modal content into this layer's plane.
|
||||
const inner = flattenPlanes(this.stack.paint(), interior);
|
||||
// The top plane's retained presentations (a menu's selection highlight
|
||||
// and scroll strip) stay unbaked: they are display lists the glasses
|
||||
// animate, and baking one freezes it on its first frame. Lower planes'
|
||||
// are baked so the top plane's raster still covers them.
|
||||
const planes = this.stack.paint();
|
||||
const top = planes[planes.length - 1]!;
|
||||
const inner = flattenPlanes(planes.map((plane) => plane === top ? { ...plane, image: plane.image.withDrawsBaked(false) } : plane), interior);
|
||||
const rect = modalRect();
|
||||
const innerX = rect.x + MODAL_PADDING, innerY = rect.y + MODAL_PADDING;
|
||||
image.fillRect(rect.x, rect.y, rect.width, rect.height, SHELL_OPAQUE_BLACK);
|
||||
image.drawRect(rect.x, rect.y, rect.width, rect.height, 110);
|
||||
image.bitBlt(inner, rect.x + MODAL_PADDING, rect.y + MODAL_PADDING, { transparentZero: true });
|
||||
image.bitBlt(inner, innerX, innerY, { transparentZero: true });
|
||||
top.image.copyPresentationsInto(image, innerX + top.x, innerY + top.y);
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,10 +92,10 @@ export class WindowMenu {
|
||||
|
||||
/**
|
||||
* Open the menu, or the shell's system menu when this window has no
|
||||
* entries. `items` overrides the window's own entries for an app that
|
||||
* reuses this host for another list (a per-row action menu).
|
||||
* entries. `items` (and optionally `title`) override the window's own for
|
||||
* an app that reuses this host for another list (a per-row action menu).
|
||||
*/
|
||||
open(items: MenuItem[] = this.options.items()): void {
|
||||
open(items: MenuItem[] = this.options.items(), title: string = this.options.title()): void {
|
||||
if (this.stack) return;
|
||||
if (!items.length) {
|
||||
this.options.post({ type: "open-system-menu", windowId: this.options.windowId });
|
||||
@@ -106,7 +106,7 @@ export class WindowMenu {
|
||||
handleInput: () => {},
|
||||
};
|
||||
const stack = new LayerStack(base, { ...noopLayerActions }, this.options.size, this.options.isFocused);
|
||||
stack.push(new WindowMenuLayer(this.options.title(), items));
|
||||
stack.push(new WindowMenuLayer(title, items));
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user