3 days ago
add separator widget (GTK)
ui/gtk/widget.c | file | annotate | diff | comparison | revisions | |
ui/ui/widget.h | file | annotate | diff | comparison | revisions |
--- a/ui/gtk/widget.c Sat Mar 29 20:03:25 2025 +0100 +++ b/ui/gtk/widget.c Sun Mar 30 10:14:27 2025 +0200 @@ -41,3 +41,16 @@ return widget; } + +UIWIDGET ui_separator_create(UiObject *obj, UiWidgetArgs *args) { + UiObject* current = uic_current_obj(obj); + GtkWidget *widget = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); + ui_set_name_and_style(widget, args.name, args.style_class); + UI_APPLY_LAYOUT1(current, args); + current->container->add(current->container, widget, FALSE); + return widget; +} + +void ui_widget_set_size(UIWIDGET w, int width, int height) { + gtk_widget_set_size_request(w, width, height); +}
--- a/ui/ui/widget.h Sat Mar 29 20:03:25 2025 +0100 +++ b/ui/ui/widget.h Sun Mar 30 10:14:27 2025 +0200 @@ -69,6 +69,8 @@ #define ui_separator(obj, ...) ui_separator_create(obj, &(UiWidgetArgs){ __VA_ARGS__ } ) +UIEXPORT void ui_widget_set_size(UIWIDGET w, int width, int height); + #ifdef __cplusplus }