Skip to content

Commit 4cf3492

Browse files
Skytriasmartinfouilleul
authored andcommitted
Add frame and textBox box to orca_ui_text_box_result
1 parent b2385a7 commit 4cf3492

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ui/ui.c

+2
Original file line numberDiff line numberDiff line change
@@ -3903,6 +3903,7 @@ oc_ui_text_box_result oc_ui_text_box_str8(oc_str8 name, oc_arena* arena, oc_str8
39033903
| OC_UI_FLAG_DRAW_BACKGROUND
39043904
| OC_UI_FLAG_DRAW_BORDER;
39053905
oc_ui_box* frame = oc_ui_box_begin_str8(name, frameFlags);
3906+
result.frame = frame;
39063907
oc_ui_tag_box(frame, "frame");
39073908
oc_font font = frame->style.font;
39083909
f32 fontSize = frame->style.fontSize;
@@ -3912,6 +3913,7 @@ oc_ui_text_box_result oc_ui_text_box_str8(oc_str8 name, oc_arena* arena, oc_str8
39123913
oc_ui_style_next(&textStyle, OC_UI_STYLE_SIZE);
39133914

39143915
oc_ui_box* textBox = oc_ui_box_make("text", OC_UI_FLAG_CLIP | OC_UI_FLAG_DRAW_PROC);
3916+
result.textBox = textBox;
39153917
oc_ui_tag_box(textBox, "text");
39163918

39173919
oc_font_metrics extents = oc_font_get_metrics(font, fontSize);

src/ui/ui.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,8 @@ typedef struct oc_ui_text_box_result
756756
bool changed;
757757
bool accepted;
758758
oc_str8 text;
759-
759+
oc_ui_box* frame;
760+
oc_ui_box* textBox;
760761
} oc_ui_text_box_result;
761762

762763
ORCA_API oc_ui_text_box_result oc_ui_text_box(const char* name, oc_arena* arena, oc_str8 text);

0 commit comments

Comments
 (0)