From: hgn Date: Tue, 2 May 2023 14:27:09 +0000 (+0100) Subject: textbox improvements X-Git-Url: https://skaterift.com/git/?a=commitdiff_plain;h=2628c75509ab49115259d0927b8926c9ca0218ae;p=carveJwlIkooP6JGAAIwe30JlM.git textbox improvements --- diff --git a/skaterift_imgui_dev.c b/skaterift_imgui_dev.c index b23f04d..7684b50 100644 --- a/skaterift_imgui_dev.c +++ b/skaterift_imgui_dev.c @@ -164,13 +164,26 @@ VG_STATIC void vg_gui(void) ui_rect title_entry, null, label; ui_split_px( content, k_ui_axis_h, 8, 0, null, content ); - ui_split_px( content, k_ui_axis_h, 28, 0, title_entry, content ); + + const char *str_title = "Title:", *str_desc = "Description:"; ui_split_px( title_entry, k_ui_axis_v, - ui_text_line_width("Title:")+8, 0, label, title_entry ); + ui_text_line_width(str_title)+8, 0, label, title_entry ); - ui_text( label, "Title:", 1, k_ui_align_middle_left, 0 ); - ui_textbox( title_entry, form_test.title, vg_list_size(form_test.title) ); + ui_text( label, str_title, 1, k_ui_align_middle_left, 0 ); + ui_textbox( title_entry, form_test.title, + vg_list_size(form_test.title), 0 ); + + /* description box */ + ui_rect desc_entry; + ui_split_px( content, k_ui_axis_h, 8, 0, null, content ); + ui_split_px( content, k_ui_axis_h, 28*4, 0, desc_entry, content ); + ui_split_px( desc_entry, k_ui_axis_v, + ui_text_line_width(str_desc)+8, 0, label, desc_entry ); + ui_text( label, str_desc, 1, k_ui_align_middle_left, 0 ); + ui_textbox( desc_entry, form_test.description, + vg_list_size(form_test.description), + UI_TEXTBOX_MULTILINE|UI_TEXTBOX_WRAP ); } ui_dev_colourview();