summaryrefslogtreecommitdiff
path: root/src/widget/label.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-03-25 19:59:14 -0700
committer3gg <3gg@shellblade.net>2026-03-25 19:59:14 -0700
commit4152fbecb6ee8360575aa4c24e9cedf822f159dc (patch)
tree9e9b9db0216a37c5867d472a65289502c459691f /src/widget/label.c
parent7778755c20e779554cd654ecdf7404d37b723fcc (diff)
Implement vertical and horizontal layouts. Use widget position properly when rendering. Toolbar, buttons and edit bars WIPmain
Diffstat (limited to 'src/widget/label.c')
-rw-r--r--src/widget/label.c13
1 files changed, 6 insertions, 7 deletions
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 @@
3#include "uiLibrary.h" 3#include "uiLibrary.h"
4#include "widget.h" 4#include "widget.h"
5 5
6uiLabel* uiMakeLabel(const char* text) { 6uiLabel* uiMakeLabel(uiPtr parent, const char* text) {
7 assert(text); 7 assert(text);
8 8
9 uiLabel* label = UI_NEW(uiLabel); 9 uiLabel* label = UI_NEW(uiLabel);
10 10
11 *label = (uiLabel){ 11 *label = (uiLabel){
12 .widget = 12 .widget =
13 (uiWidget){ 13 (uiWidget){.type = uiTypeLabel,
14 .type = uiTypeLabel,
15 .rect = 14 .rect =
16 (uiRect){ 15 (uiRect){.width = (int)strlen(text) *
17 .width = 16 g_ui.font->header.glyph_width,
18 (int)strlen(text) * g_ui.font->header.glyph_width, 17 .height = g_ui.font->header.glyph_height}},
19 .height = g_ui.font->header.glyph_height}},
20 .text = string_new(text), 18 .text = string_new(text),
21 }; 19 };
20 WidgetSetParent(uiMakeLabelPtr(label), parent);
22 return label; 21 return label;
23} 22}
24 23