further work on rich hover vs. hover eval vs. ctx menu arrangements; it's a bit too noisy/annoying when hover eval for breakpoints/threads/etc. is just turned on all the time, and now that we have the ability to hover-eval-style query views, because of tabs, we can just do that with breakpoints etc. too. the old rich hover tooltips / highlights / etc. can then just be used normally. also put in some mechanisms to block rich hover tooltips when it is strictly redundant information.

This commit is contained in:
Ryan Fleury committed 2025-03-20 15:01:40 -07:00
1 parent 43d8fd4886
commit e2bfecc384
6 files changed
+48 -13

No files matched your search

+32 -4
View File
@@ -1388,9 +1388,15 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: interactions
if(ui_hovering(thread_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
}
if(ui_right_clicked(thread_sig))
{
rd_cmd(RD_CmdKind_PushQuery,
.ui_key = thread_box->key,
.off_px = v2f32(0, dim_2f32(thread_box->rect).y),
.expr = ctrl_string_from_handle(scratch.arena, thread->handle));
}
if(ui_dragging(thread_sig) && !contains_2f32(thread_box->rect, ui_mouse()))
{
RD_RegsScope(.thread = thread->handle) rd_drag_begin(RD_RegSlot_Thread);
@@ -1536,9 +1542,15 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: interactions
if(ui_hovering(thread_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(thread_box->rect.x0, thread_box->rect.y1-2.f), ctrl_string_from_handle(scratch.arena, thread->handle), str8_zero());
RD_RegsScope(.ctrl_entity = thread->handle) rd_set_hover_regs(RD_RegSlot_CtrlEntity);
}
if(ui_right_clicked(thread_sig))
{
rd_cmd(RD_CmdKind_PushQuery,
.ui_key = thread_box->key,
.off_px = v2f32(0, dim_2f32(thread_box->rect).y),
.expr = ctrl_string_from_handle(scratch.arena, thread->handle));
}
if(ui_dragging(thread_sig) && !contains_2f32(thread_box->rect, ui_mouse()))
{
RD_RegsScope(.thread = thread->handle) rd_drag_begin(RD_RegSlot_Thread);
@@ -1611,10 +1623,18 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: bp hovering
if(ui_hovering(bp_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(bp_box->rect.x0, bp_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64x", bp->id), str8_zero());
RD_RegsScope(.cfg = bp->id) rd_set_hover_regs(RD_RegSlot_Cfg);
}
// rjf: bp right-click => open query
if(ui_right_clicked(bp_sig))
{
rd_cmd(RD_CmdKind_PushQuery,
.ui_key = bp_box->key,
.off_px = v2f32(0, dim_2f32(bp_box->rect).y),
.expr = push_str8f(scratch.arena, "$%I64x", bp->id));
}
// rjf: shift+click => enable breakpoint
if(ui_clicked(bp_sig) && bp_sig.event_flags & OS_Modifier_Shift)
{
@@ -1662,10 +1682,18 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: watch hovering
if(ui_hovering(pin_sig) && !rd_drag_is_active())
{
rd_set_hover_eval(v2f32(pin_box->rect.x0, pin_box->rect.y1-2.f), push_str8f(scratch.arena, "$%I64x", pin->id), str8_zero());
RD_RegsScope(.cfg = pin->id) rd_set_hover_regs(RD_RegSlot_Cfg);
}
// rjf: pin right-click => open query
if(ui_right_clicked(pin_sig))
{
rd_cmd(RD_CmdKind_PushQuery,
.ui_key = pin_box->key,
.off_px = v2f32(0, dim_2f32(pin_box->rect).y),
.expr = push_str8f(scratch.arena, "$%I64x", pin->id));
}
// rjf: click => remove pin
if(ui_clicked(pin_sig))
{