move over to new rich hover system for all entity tooltips

This commit is contained in:
Ryan Fleury
2024-10-03 09:34:47 -07:00
parent 8b8acf64d6
commit 71ff183dc4
2 changed files with 19 additions and 18 deletions
+17 -16
View File
@@ -3313,6 +3313,23 @@ rd_window_frame(RD_Window *ws)
{
default:{}break;
////////////////////////
//- rjf: frontend entity tooltips
//
case RD_RegSlot_Entity:
{
// rjf: unpack
RD_Entity *entity = rd_entity_from_handle(regs->entity);
DR_FancyStringList fstrs = rd_title_fstrs_from_entity(scratch.arena, entity, rd_rgba_from_theme_color(RD_ThemeColor_TextWeak), ui_top_font_size());
// rjf: title
UI_PrefWidth(ui_children_sum(1)) UI_Row UI_PrefWidth(ui_text_dim(5, 1))
{
UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
ui_box_equip_display_fancy_strings(box, &fstrs);
}
}break;
////////////////////////
//- rjf: control entity tooltips
//
@@ -3492,22 +3509,6 @@ rd_window_frame(RD_Window *ws)
}
}
}
//- rjf: entity dragging
else if(rd_state->drag_drop_regs_slot == RD_RegSlot_Entity && !rd_entity_is_nil(entity)) UI_Tooltip
{
ui_set_next_pref_width(ui_children_sum(1));
UI_Row UI_HeightFill
{
String8 display_name = rd_display_string_from_entity(scratch.arena, entity);
RD_IconKind icon_kind = rd_entity_kind_icon_kind_table[entity->kind];
RD_Font(RD_FontSlot_Icons)
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Icons))
UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
ui_label(rd_icon_kind_text_table[icon_kind]);
ui_label(display_name);
}
}
}
scratch_end(scratch);
}
+2 -2
View File
@@ -1380,7 +1380,7 @@ 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_entity_tooltips(bp);
RD_RegsScope(.entity = rd_handle_from_entity(bp)) rd_set_hover_regs(RD_RegSlot_Entity);
}
// rjf: click => remove breakpoint
@@ -1433,7 +1433,7 @@ 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_entity_tooltips(pin);
RD_RegsScope(.entity = rd_handle_from_entity(pin)) rd_set_hover_regs(RD_RegSlot_Entity);
}
// rjf: click => remove pin