mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-08 14:58:08 +00:00
fix keyboard input delegation between meta-interfaces (query lister line edit) and watch window controls; always accept single-visible-button presses, if multiline logic does not consume an event
This commit is contained in:
+40
-29
@@ -2644,7 +2644,8 @@ rd_eval_blob_from_entity(Arena *arena, CTRL_Entity *entity)
|
||||
if(0){}
|
||||
else if(str8_match(member_name, str8_lit("frozen"), 0))
|
||||
{
|
||||
str8_list_push(scratch.arena, &fixed_width_parts, str8((U8 *)&entity->is_frozen, 1));
|
||||
B32 is_frozen = ctrl_entity_tree_is_frozen(entity);
|
||||
str8_list_push(scratch.arena, &fixed_width_parts, str8((U8 *)&is_frozen, 1));
|
||||
}
|
||||
else if(str8_match(member_name, str8_lit("vaddr_range"), 0))
|
||||
{
|
||||
@@ -3402,25 +3403,6 @@ rd_view_ui(Rng2F32 rect)
|
||||
{
|
||||
vs->is_searching = 1;
|
||||
}
|
||||
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
vs->is_searching = 0;
|
||||
vs->search_string_size = 0;
|
||||
}
|
||||
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept))
|
||||
{
|
||||
RD_RegsScope()
|
||||
{
|
||||
rd_regs_copy_contents(vs->search_arena, rd_regs(), vs->search_regs);
|
||||
rd_regs_fill_slot_from_string(cmd_kind_info->query.slot, str8(vs->search_buffer, vs->search_string_size));
|
||||
rd_push_cmd(cmd_name, rd_regs());
|
||||
}
|
||||
if(!(cmd_kind_info->query.flags & RD_QueryFlag_KeepOldInput))
|
||||
{
|
||||
vs->is_searching = 0;
|
||||
vs->search_string_size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: commit string to view
|
||||
@@ -3944,7 +3926,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
evt->flags & UI_EventFlag_Paste ||
|
||||
(evt->kind == UI_EventKind_Press && evt->slot == UI_EventActionSlot_Edit)) &&
|
||||
selection_tbl.min.x == selection_tbl.max.x &&
|
||||
(selection_tbl.min.y != 0 || selection_tbl.min.y != 0))
|
||||
(selection_tbl.min.y != 0 || selection_tbl.max.y != 0))
|
||||
{
|
||||
Vec2S64 selection_dim = dim_2s64(selection_tbl);
|
||||
arena_clear(ewv->text_edit_arena);
|
||||
@@ -3993,11 +3975,15 @@ rd_view_ui(Rng2F32 rect)
|
||||
//- rjf: [table] do cell-granularity multi-cursor 'accept' operations (expansions / etc.); if
|
||||
// cannot apply to multi-cursor, then just don't take the event
|
||||
//
|
||||
if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept)
|
||||
if(!ewv->text_editing && evt->slot == UI_EventActionSlot_Accept &&
|
||||
(selection_tbl.min.y != 0 || selection_tbl.max.y != 0) &&
|
||||
(selection_tbl.max.y - selection_tbl.min.y > 0))
|
||||
{
|
||||
taken = 1;
|
||||
EV_WindowedRowList rows = ev_rows_from_num_range(scratch.arena, eval_view, filter, &block_ranges, r1u64(selection_tbl.min.y, selection_tbl.max.y+1));
|
||||
EV_WindowedRowNode *row_node = rows.first;
|
||||
if(row_node != 0)
|
||||
{
|
||||
taken = 1;
|
||||
for(S64 y = selection_tbl.min.y; y <= selection_tbl.max.y && row_node != 0; y += 1, row_node = row_node->next)
|
||||
{
|
||||
// rjf: unpack row info
|
||||
@@ -4050,6 +4036,7 @@ rd_view_ui(Rng2F32 rect)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: [text] apply textual edits
|
||||
@@ -5278,7 +5265,8 @@ rd_view_ui(Rng2F32 rect)
|
||||
|
||||
// rjf: activation (double-click normally, or single-clicks with special buttons)
|
||||
if((!(cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick) && ui_double_clicked(sig)) ||
|
||||
((cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick) && ui_clicked(sig)))
|
||||
((cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick) && ui_clicked(sig)) ||
|
||||
sig.f & UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
// rjf: kill if a double-clickable cell
|
||||
if(!(cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick))
|
||||
@@ -5556,6 +5544,34 @@ rd_view_ui(Rng2F32 rect)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: catchall query completion controls
|
||||
//
|
||||
if(vs->is_searching) UI_Focus(UI_FocusKind_On)
|
||||
{
|
||||
String8 cmd_name = vs->search_cmd_name;
|
||||
RD_CmdKindInfo *cmd_kind_info = rd_cmd_kind_info_from_string(cmd_name);
|
||||
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Cancel))
|
||||
{
|
||||
vs->is_searching = 0;
|
||||
vs->search_string_size = 0;
|
||||
}
|
||||
if(ui_is_focus_active() && ui_slot_press(UI_EventActionSlot_Accept))
|
||||
{
|
||||
RD_RegsScope()
|
||||
{
|
||||
rd_regs_copy_contents(vs->search_arena, rd_regs(), vs->search_regs);
|
||||
rd_regs_fill_slot_from_string(cmd_kind_info->query.slot, str8(vs->search_buffer, vs->search_string_size));
|
||||
rd_push_cmd(cmd_name, rd_regs());
|
||||
}
|
||||
if(!(cmd_kind_info->query.flags & RD_QueryFlag_KeepOldInput))
|
||||
{
|
||||
vs->is_searching = 0;
|
||||
vs->search_string_size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
@@ -7200,11 +7216,6 @@ rd_window_frame(void)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: accept
|
||||
if(ui_slot_press(UI_EventActionSlot_Accept))
|
||||
{
|
||||
}
|
||||
|
||||
//- rjf: build darkening rectangle over rest of screen
|
||||
UI_Rect(window_rect) UI_TagF("inactive")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user