style(ui): Padding +20% en tablas, botones, inputs

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 <noreply@anthropic.com>
This commit is contained in:
R.Eugenio 2025-12-30 15:31:16 +01:00
parent 6154cb1080
commit c657583e06
3 changed files with 8 additions and 8 deletions

View file

@ -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,
};

View file

@ -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));

View file

@ -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.