diff --git a/src/widgets/text_input.zig b/src/widgets/text_input.zig index e8740b3..176f362 100644 --- a/src/widgets/text_input.zig +++ b/src/widgets/text_input.zig @@ -211,10 +211,14 @@ pub const TextInputConfig = struct { password: bool = false, /// Padding inside the input padding: u32 = 4, + /// Override background color. If null, uses theme default. + bg_color: ?Style.Color = null, /// Override text color (for validation feedback). If null, uses theme default. text_color: ?Style.Color = null, /// Override border color (for validation feedback). If null, uses theme default. border_color: ?Style.Color = null, + /// Override placeholder color. If null, uses theme default. + placeholder_color: ?Style.Color = null, /// Corner radius (default 3 for fancy mode) corner_radius: u8 = 3, }; @@ -278,13 +282,13 @@ pub fn textInputRect( // Sync state.focused for backwards compatibility state.focused = has_focus; - // Theme colors (Z-Design: usar theme dinĂ¡mico) + // Theme colors (Z-Design: usar theme dinĂ¡mico, con overrides del panel) const theme = Style.currentTheme().*; - const bg_color = if (has_focus) theme.input_bg.lighten(5) else theme.input_bg; // Use override colors if provided, otherwise use theme defaults + const bg_color = config.bg_color orelse (if (has_focus) theme.input_bg.lighten(5) else theme.input_bg); const border_color = config.border_color orelse (if (has_focus) theme.primary else theme.input_border); const text_color = config.text_color orelse theme.input_fg; - const placeholder_color = theme.secondary; + const placeholder_color = config.placeholder_color orelse theme.secondary; // Draw background and border based on render mode if (Style.isFancy() and config.corner_radius > 0) {