mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-18 18:12:23 -07:00
frontend cleanups, cmd running from watch
This commit is contained in:
@@ -724,6 +724,7 @@ e_expr_copy(Arena *arena, E_Expr *src)
|
||||
{
|
||||
E_Expr *result = &e_expr_nil;
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
if(src != &e_expr_nil)
|
||||
{
|
||||
typedef struct Task Task;
|
||||
struct Task
|
||||
|
||||
+10
-14
@@ -3815,10 +3815,9 @@ rd_window_frame(void)
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
//- rjf: rich hover, drag/drop tooltips
|
||||
//- rjf: drag/drop tooltips
|
||||
//
|
||||
if(rd_state->hover_regs_slot != RD_RegSlot_Null ||
|
||||
(rd_state->drag_drop_regs_slot != RD_RegSlot_Null && rd_drag_is_active()))
|
||||
if(rd_state->drag_drop_regs_slot != RD_RegSlot_Null && rd_drag_is_active())
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
RD_RegSlot slot = ((rd_state->drag_drop_regs_slot != RD_RegSlot_Null && rd_drag_is_active()) ? rd_state->drag_drop_regs_slot : rd_state->hover_regs_slot);
|
||||
@@ -5608,10 +5607,10 @@ rd_window_frame(void)
|
||||
UI_TextAlignment(UI_TextAlign_Center)
|
||||
UI_Padding(ui_pct(1, 0))
|
||||
{
|
||||
ui_labelf("Search for commands by pressing ");
|
||||
ui_labelf("Search for commands and options by pressing ");
|
||||
UI_Flags(UI_BoxFlag_DrawBorder)
|
||||
UI_TextAlignment(UI_TextAlign_Center)
|
||||
rd_cmd_binding_buttons(rd_cmd_kind_info_table[RD_CmdKind_RunCommand].string);
|
||||
rd_cmd_binding_buttons(rd_cmd_kind_info_table[RD_CmdKind_OpenLister].string);
|
||||
}
|
||||
ui_spacer(ui_em(1.f, 1.f));
|
||||
RD_Palette(RD_PaletteCode_NeutralPopButton)
|
||||
@@ -7846,16 +7845,13 @@ rd_window_frame(void)
|
||||
}
|
||||
|
||||
// rjf: soft circle around mouse
|
||||
if(ui_key_match(ui_hot_key(), box->key))
|
||||
if(ui_key_match(ui_hot_key(), box->key)) DR_ClipScope(box->rect)
|
||||
{
|
||||
DR_ClipScope(box->rect)
|
||||
{
|
||||
Vec2F32 center = ui_mouse();
|
||||
F32 radius = box->font_size*12.f;
|
||||
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Hover);
|
||||
color.w *= 0.1f*t;
|
||||
dr_rect(pad_2f32(r2f32p(center.x, center.y, center.x, center.y), radius), color, radius, 0, radius/3.f);
|
||||
}
|
||||
Vec2F32 center = ui_mouse();
|
||||
F32 radius = box->font_size*12.f;
|
||||
Vec4F32 color = rd_rgba_from_theme_color(RD_ThemeColor_Hover);
|
||||
color.w *= 0.1f*t;
|
||||
dr_rect(pad_2f32(r2f32(center, center), radius), color, radius, 0, radius/3.f);
|
||||
}
|
||||
|
||||
// rjf: slight emboss fadeoff
|
||||
|
||||
@@ -1310,6 +1310,12 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
||||
result.cfg = cfg;
|
||||
}
|
||||
}
|
||||
else if(result.eval.space.kind == RD_EvalSpaceKind_MetaCmd)
|
||||
{
|
||||
RD_CmdKind cmd_kind = (RD_CmdKind)result.eval.value.u64;
|
||||
String8 cmd_name = rd_cmd_kind_info_table[cmd_kind].string;
|
||||
result.cmd_name = cmd_name;
|
||||
}
|
||||
}break;
|
||||
case RD_WatchCellKind_Eval:
|
||||
{
|
||||
@@ -1339,6 +1345,7 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
||||
result.fstrs = rd_title_fstrs_from_code_name(arena, cmd_name, ui_top_palette()->text_weak, ui_top_font_size());
|
||||
}
|
||||
result.flags |= RD_WatchCellFlag_Button;
|
||||
result.cmd_name = cmd_name;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
@@ -2869,24 +2876,32 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
|
||||
RD_RegsScope(.cfg = cell_info.cfg->id) rd_set_hover_regs(RD_RegSlot_Cfg);
|
||||
}
|
||||
|
||||
// rjf: single-click -> move selection here
|
||||
// rjf: (normally) single-click -> move selection here
|
||||
if(!(cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick) && ui_pressed(sig))
|
||||
{
|
||||
ewv->next_cursor = ewv->next_mark = cell_pt;
|
||||
pressed = 1;
|
||||
}
|
||||
|
||||
// rjf: double-click actions
|
||||
// rjf: activation (double-click normally, or single-clicks with special buttons)
|
||||
if(ui_double_clicked(sig) ||
|
||||
((cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick) && ui_clicked(sig)))
|
||||
{
|
||||
// rjf: kill if a double-clickable cell
|
||||
if(!(cell_info.flags & RD_WatchCellFlag_ActivateWithSingleClick))
|
||||
{
|
||||
ui_kill_action();
|
||||
}
|
||||
|
||||
// rjf: has callstack info? -> select unwind
|
||||
if(row_info->callstack_thread != &ctrl_entity_nil)
|
||||
// rjf: has a command name? -> push command
|
||||
if(cell_info.cmd_name.size != 0)
|
||||
{
|
||||
RD_CmdKind kind = rd_cmd_kind_from_string(cell_info.cmd_name);
|
||||
rd_cmd(kind, .cfg = row_info->group_cfg_child->id);
|
||||
}
|
||||
|
||||
// rjf: row has callstack info? -> select unwind
|
||||
else if(row_info->callstack_thread != &ctrl_entity_nil)
|
||||
{
|
||||
rd_cmd(RD_CmdKind_SelectThread, .thread = row_info->callstack_thread->handle);
|
||||
rd_cmd(RD_CmdKind_SelectUnwind,
|
||||
|
||||
@@ -109,6 +109,7 @@ struct RD_WatchRowCellInfo
|
||||
E_Eval eval;
|
||||
RD_Cfg *cfg;
|
||||
CTRL_Entity *entity;
|
||||
String8 cmd_name;
|
||||
String8 string;
|
||||
DR_FStrList fstrs;
|
||||
String8 error_tooltip;
|
||||
|
||||
Reference in New Issue
Block a user