From 4152fbecb6ee8360575aa4c24e9cedf822f159dc Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Wed, 25 Mar 2026 19:59:14 -0700 Subject: Implement vertical and horizontal layouts. Use widget position properly when rendering. Toolbar, buttons and edit bars WIP --- src/widget/button.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/widget/button.c') diff --git a/src/widget/button.c b/src/widget/button.c index f2313fd..d8de266 100644 --- a/src/widget/button.c +++ b/src/widget/button.c @@ -2,18 +2,21 @@ #include "widget.h" -uiButton* uiMakeButton(const char* text) { +uiButton* uiMakeButton(uiPtr parent, const char* text, const uiParams* params) { assert(text); + assert(params); uiButton* button = UI_NEW(uiButton); *button = (uiButton){ .widget = (uiWidget){ - .type = uiTypeButton, - .rect = {0}, + .type = uiTypeButton, + .rect = {0}, + .stretch = params->stretch, }, .text = string_new(text), }; + WidgetSetParent(uiMakeButtonPtr(button), parent); return button; } -- cgit v1.2.3