Lefted text box test to its own widget proc, fixed overlapping widget interaction!

This commit is contained in:
2024-03-09 13:55:47 -05:00
parent 635ce91a9d
commit 4a53a158e0
8 changed files with 146 additions and 98 deletions

View File

@ -20,3 +20,20 @@ ui_button :: proc( label : string, flags : UI_BoxFlags = {} ) -> (btn : UI_Widge
return
}
ui_text :: proc( label : string, content : StringCached, font_size : f32 = 24, font := Font_Default, flags : UI_BoxFlags ) -> UI_Widget
{
state := get_state(); using state
font := font
if font == Font_Default {
font = default_font
}
text_size := measure_text_size( content.str, font, font_size, 0 )
box := ui_box_make( flags, "TEXT BOX!" )
signal := ui_signal_from_box( box )
box.text = content
box.style.layout.size = text_size
return { box, signal }
}