summaryrefslogtreecommitdiff
path: root/src/widget/button.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/button.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/button.c')
-rw-r--r--src/widget/button.c9
1 files changed, 6 insertions, 3 deletions
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 @@
2 2
3#include "widget.h" 3#include "widget.h"
4 4
5uiButton* uiMakeButton(const char* text) { 5uiButton* uiMakeButton(uiPtr parent, const char* text, const uiParams* params) {
6 assert(text); 6 assert(text);
7 assert(params);
7 8
8 uiButton* button = UI_NEW(uiButton); 9 uiButton* button = UI_NEW(uiButton);
9 10
10 *button = (uiButton){ 11 *button = (uiButton){
11 .widget = 12 .widget =
12 (uiWidget){ 13 (uiWidget){
13 .type = uiTypeButton, 14 .type = uiTypeButton,
14 .rect = {0}, 15 .rect = {0},
16 .stretch = params->stretch,
15 }, 17 },
16 .text = string_new(text), 18 .text = string_new(text),
17 }; 19 };
20 WidgetSetParent(uiMakeButtonPtr(button), parent);
18 return button; 21 return button;
19} 22}