add extra bit that views can use to disable query bar - use in the case of watch window (and thus lister) editing

This commit is contained in:
Ryan Fleury
2025-04-26 11:04:54 -07:00
parent 6749f30b6b
commit 05b52cfaca
2 changed files with 9 additions and 1 deletions
+6 -1
View File
@@ -2402,7 +2402,7 @@ rd_view_ui(Rng2F32 rect)
}
//- rjf: build contents
UI_Parent(search_row) UI_WidthFill UI_HeightFill UI_Focus(vs->query_is_selected ? UI_FocusKind_On : UI_FocusKind_Off)
UI_Parent(search_row) UI_WidthFill UI_HeightFill UI_Focus(vs->query_is_selected && !vs->contents_are_focused ? UI_FocusKind_On : UI_FocusKind_Off)
RD_Font(cmd_kind_info->query.flags & RD_QueryFlag_CodeInput ? RD_FontSlot_Code : RD_FontSlot_Main)
{
if(cmd_name.size != 0)
@@ -4861,6 +4861,11 @@ rd_view_ui(Rng2F32 rect)
rd_cmd(RD_CmdKind_FocusPanel);
}
//////////////////////////////
//- rjf: disable query if text editing is occurring
//
vs->contents_are_focused = ewv->text_editing;
rd_store_view_scroll_pos(scroll_pos);
}
scratch_end(scratch);
+3
View File
@@ -214,6 +214,9 @@ struct RD_ViewState
TxtPt query_mark;
U8 query_buffer[KB(1)];
U64 query_string_size;
// rjf: contents are focused (disables query focus)
B32 contents_are_focused;
};
typedef struct RD_ViewStateSlot RD_ViewStateSlot;