refactor: allow palettes to override widget style
This commit is contained in:
parent
9a5c634ea7
commit
8866e27da7
1 changed files with 2 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ const ModalBackground = @import("../../ModalBackground.zig");
|
||||||
pub const Menu = @import("../../Menu.zig");
|
pub const Menu = @import("../../Menu.zig");
|
||||||
|
|
||||||
const max_menu_width = 80;
|
const max_menu_width = 80;
|
||||||
const widget_type: Widget.Type = .palette;
|
const default_widget_type: Widget.Type = .palette;
|
||||||
|
|
||||||
pub const Placement = enum {
|
pub const Placement = enum {
|
||||||
top_center,
|
top_center,
|
||||||
|
|
@ -54,6 +54,7 @@ pub fn Create(options: type) type {
|
||||||
const Entry = options.Entry;
|
const Entry = options.Entry;
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
const ValueType = if (@hasDecl(options, "ValueType")) options.ValueType else void;
|
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 MenuType = Menu.Options(*Self).MenuType;
|
||||||
pub const ButtonType = MenuType.ButtonType;
|
pub const ButtonType = MenuType.ButtonType;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue