Files
LCUI/docs/examples/button-group-orientation/main.c
T
Liu 029d5c4e22 feat(widgets): add button group widget
- add button-group, button-group-text and button-group-separator
  prototypes with orientation and separator APIs
- mark direct children as geometry items, keep select, popover and
  dropdown wrappers out of the border geometry and clean up on unlink
- theme the group for the nova style, covering nested groups, select,
  input group and first/last edge rules
- add integration tests for factories, marking, geometry, input flex
  and trigger wrappers
- add zh-CN documentation, field tables, sidebar entry and C/XML/TSX
  examples for every section
2026-11-08 00:20:39 +08:00

23 lines
766 B
C

#include <LCUI.h>
static ui_widget_t *create_icon_button(const char *icon)
{
ui_widget_t *button = ui_create_button();
ui_button_set_variant(button, UI_BUTTON_VARIANT_OUTLINE);
ui_button_set_size(button, UI_BUTTON_SIZE_ICON);
ui_widget_append(button, ui_create_fluent_icon(icon));
return button;
}
void button_group_orientation_init(ui_widget_t *parent)
{
ui_widget_t *group = ui_create_button_group();
ui_widget_add_class(group, "button-group-orientation-demo");
ui_button_group_set_orientation(group, UI_BUTTON_GROUP_VERTICAL);
ui_widget_append(group, create_icon_button("add"));
ui_widget_append(group, create_icon_button("subtract"));
ui_widget_append(parent, group);
}