refactor: allow palettes to override widget style

This commit is contained in:
CJ van den Berg 2025-12-18 15:23:59 +01:00
parent 9a5c634ea7
commit 8866e27da7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -20,7 +20,7 @@ const ModalBackground = @import("../../ModalBackground.zig");
pub const Menu = @import("../../Menu.zig");
const max_menu_width = 80;
const widget_type: Widget.Type = .palette;
const default_widget_type: Widget.Type = .palette;
pub const Placement = enum {
top_center,
@ -54,6 +54,7 @@ pub fn Create(options: type) type {
const Entry = options.Entry;
const Self = @This();
const ValueType = if (@hasDecl(options, "ValueType")) options.ValueType else void;
const widget_type: Widget.Type = if (@hasDecl(options, "widget_type")) options.widget_type else default_widget_type;
pub const MenuType = Menu.Options(*Self).MenuType;
pub const ButtonType = MenuType.ButtonType;