From 3901d0cce5cc2316b99a0deea95704b56ba2b02e Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 1 Oct 2025 20:50:32 +0200 Subject: [PATCH] feat: add support for state values in palettes --- src/tui/mode/overlay/palette.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tui/mode/overlay/palette.zig b/src/tui/mode/overlay/palette.zig index d6ad651..df64f59 100644 --- a/src/tui/mode/overlay/palette.zig +++ b/src/tui/mode/overlay/palette.zig @@ -40,8 +40,11 @@ pub fn Create(options: type) type { view_pos: usize = 0, total_items: usize = 0, + value: ValueType = if (@hasDecl(options, "defaultValue")) options.defaultValue else {}, + const Entry = options.Entry; const Self = @This(); + const ValueType = if (@hasDecl(options, "ValueType")) options.ValueType else void; pub const MenuState = Menu.State(*Self); pub const ButtonState = Button.State(*Menu.State(*Self));