From c657583e06a1689443f47548abd62be96fc68f41 Mon Sep 17 00:00:00 2001 From: "R.Eugenio" Date: Tue, 30 Dec 2025 15:31:16 +0100 Subject: [PATCH] style(ui): Padding +20% en tablas, botones, inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El Lujo del Espacio (Acabado Espectacular mejora #3): - table_core/rendering.zig: padding celdas 4px → 5px - button.zig: padding botones 8px → 10px - text_input.zig: padding inputs 4px → 5px UI más "respirada" y profesional estilo Laravel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/widgets/button.zig | 2 +- src/widgets/table_core/rendering.zig | 12 ++++++------ src/widgets/text_input.zig | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/widgets/button.zig b/src/widgets/button.zig index a4c2eb2..4b23d49 100644 --- a/src/widgets/button.zig +++ b/src/widgets/button.zig @@ -42,7 +42,7 @@ pub const ButtonConfig = struct { /// Disabled state disabled: bool = false, /// Padding around text - padding: u32 = 8, + padding: u32 = 10, /// Corner radius (0 = square, default 4 for fancy mode) corner_radius: u8 = 4, }; diff --git a/src/widgets/table_core/rendering.zig b/src/widgets/table_core/rendering.zig index 7d044ad..3afd563 100644 --- a/src/widgets/table_core/rendering.zig +++ b/src/widgets/table_core/rendering.zig @@ -83,19 +83,19 @@ pub fn drawEditingOverlay( if (selection_start != selection_end) { const sel_min = @min(selection_start, selection_end); const sel_max = @max(selection_start, selection_end); - const sel_x = x + 4 + @as(i32, @intCast(sel_min * 8)); // 8px por caracter (monospace) + const sel_x = x + 5 + @as(i32, @intCast(sel_min * 8)); // 8px por caracter (monospace) const sel_width = @as(u32, @intCast((sel_max - sel_min) * 8)); // Color azul semitransparente para selección ctx.pushCommand(Command.rect(sel_x, text_y, sel_width, 16, colors.cell_selection_bg)); } // Texto (encima de la selección) - ctx.pushCommand(Command.text(x + 4, text_y, text_to_show, colors.cell_editing_text)); + ctx.pushCommand(Command.text(x + 5, text_y, text_to_show, colors.cell_editing_text)); // Cursor parpadeante (simplificado: siempre visible) // Solo mostrar cursor si NO hay selección completa if (selection_start == selection_end) { - const cursor_x = x + 4 + @as(i32, @intCast(cursor_pos * 8)); // Asumiendo fuente monospace 8px + const cursor_x = x + 5 + @as(i32, @intCast(cursor_pos * 8)); // Asumiendo fuente monospace 8px ctx.pushCommand(Command.rect(cursor_x, text_y, 2, 16, colors.cell_editing_border)); } } @@ -114,10 +114,10 @@ pub fn drawCellText( const text_y = y + @as(i32, @intCast((height -| 16) / 2)); const text_x = switch (text_align) { - 0 => x + 4, // Left + 0 => x + 5, // Left 1 => x + @as(i32, @intCast(width / 2)) - @as(i32, @intCast(text.len * 4)), // Center (aprox) - 2 => x + @as(i32, @intCast(width)) - @as(i32, @intCast(text.len * 8 + 4)), // Right - 3 => x + 4, // Default left + 2 => x + @as(i32, @intCast(width)) - @as(i32, @intCast(text.len * 8 + 5)), // Right + 3 => x + 5, // Default left }; ctx.pushCommand(Command.text(text_x, text_y, text, color)); diff --git a/src/widgets/text_input.zig b/src/widgets/text_input.zig index 176f362..70764cb 100644 --- a/src/widgets/text_input.zig +++ b/src/widgets/text_input.zig @@ -210,7 +210,7 @@ pub const TextInputConfig = struct { /// Password mode (show dots instead of text) password: bool = false, /// Padding inside the input - padding: u32 = 4, + padding: u32 = 5, /// Override background color. If null, uses theme default. bg_color: ?Style.Color = null, /// Override text color (for validation feedback). If null, uses theme default.