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/label.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/widget/label.c') diff --git a/src/widget/label.c b/src/widget/label.c index 30ca0ec..5c0c00a 100644 --- a/src/widget/label.c +++ b/src/widget/label.c @@ -3,22 +3,21 @@ #include "uiLibrary.h" #include "widget.h" -uiLabel* uiMakeLabel(const char* text) { +uiLabel* uiMakeLabel(uiPtr parent, const char* text) { assert(text); uiLabel* label = UI_NEW(uiLabel); *label = (uiLabel){ .widget = - (uiWidget){ - .type = uiTypeLabel, + (uiWidget){.type = uiTypeLabel, .rect = - (uiRect){ - .width = - (int)strlen(text) * g_ui.font->header.glyph_width, - .height = g_ui.font->header.glyph_height}}, + (uiRect){.width = (int)strlen(text) * + g_ui.font->header.glyph_width, + .height = g_ui.font->header.glyph_height}}, .text = string_new(text), }; + WidgetSetParent(uiMakeLabelPtr(label), parent); return label; } -- cgit v1.2.3