ui: group key, for menu-bar-style interactions, where you have several distinct boxes, but want one interaction to continuously flow between them

This commit is contained in:
Ryan Fleury
2024-06-24 15:23:56 -07:00
parent ff32449ba2
commit 0a5cc5df6f
7 changed files with 54 additions and 7 deletions
+2 -1
View File
@@ -4707,6 +4707,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
UI_WidthFill UI_Row
UI_Focus(UI_FocusKind_Null)
{
UI_Key menu_bar_group_key = ui_key_from_string(ui_key_zero(), str8_lit("###top_bar_group"));
MemoryZeroArray(ui_top_parent()->parent->corner_radii);
//- rjf: left column
@@ -4729,7 +4730,7 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
//- rjf: menu items
ui_set_next_flags(UI_BoxFlag_DrawBackground);
UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(20, 1))
UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(20, 1)) UI_GroupKey(menu_bar_group_key)
{
// rjf: file menu
UI_Key file_menu_key = ui_key_from_string(ui_key_zero(), str8_lit("_file_menu_key_"));