refactor: allow palettes to disable dimming

This commit is contained in:
CJ van den Berg 2025-11-18 18:00:01 +01:00
parent e4fdc5b5dc
commit f7134df47c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -64,6 +64,13 @@ pub fn Create(options: type) type {
.modal = try ModalBackground.create(*Self, allocator, tui.mainview_widget(), .{ .modal = try ModalBackground.create(*Self, allocator, tui.mainview_widget(), .{
.ctx = self, .ctx = self,
.on_click = mouse_palette_menu_cancel, .on_click = mouse_palette_menu_cancel,
.on_render = if (@hasDecl(options, "modal_dim"))
if (options.modal_dim)
ModalBackground.Options(*Self).on_render_dim
else
ModalBackground.Options(*Self).on_render_default
else
ModalBackground.Options(*Self).on_render_default,
}), }),
.menu = try Menu.create(*Self, allocator, tui.plane(), .{ .menu = try Menu.create(*Self, allocator, tui.plane(), .{
.ctx = self, .ctx = self,