3699a2554d
20 funciones C++ pasan de tested:false a tested:true con sus tests correspondientes y test_file_path apuntando a cpp/tests/. Cubre 4 tests reales (tween_curves, pie/kpi/bar math) y 16 placeholders (componentes UI con tests visuales pendientes para 0048). Coverage cpp pasa de 4% (3/81) a 28% (23/81).
2.0 KiB
2.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| button | component | cpp | core | 1.0.0 | pure | bool fn_ui::button(const char* label, fn_ui::ButtonVariant variant = Secondary, fn_ui::ButtonSize size = Md) | Boton ImGui con variantes (primary/secondary/subtle/danger) y tamanos (sm/md/lg) usando fn_tokens. Replica Mantine Button / fn_library Button. |
|
|
false |
|
true |
|
cpp/tests/test_button.cpp | cpp/functions/core/button.cpp | imgui |
|
true el frame en que se hace click, false en caso contrario |
button
Boton con variantes semanticas y tamanos fijos. Usa tokens (primary, surface, error, border, text) y padding/radius consistentes — mismo estilo visual en cualquier app C++ que lo use.
Variantes
| Variant | Uso | Colores |
|---|---|---|
Primary |
Accion principal (Save, Submit) | colors::primary + hover |
Secondary |
Accion neutra (Cancel) | surface + border |
Subtle |
Accion discreta (ver mas) | transparente + hover surface |
Danger |
Accion destructiva (Delete) | colors::error |
Ejemplo
#include "core/button.h"
using fn_ui::button;
using V = fn_ui::ButtonVariant;
if (button("Reindex", V::Primary)) { ... }
if (button("Cancel", V::Subtle)) { ... }
if (button("Delete", V::Danger)) { ... }
Notas
- No gestiona layout: usar
ImGui::SameLine()otoolbarpara alinear varios. - Para botones solo-icono sin texto, usar
icon_button.