ui truncated string hovering -> display full string as a tooltip

This commit is contained in:
Ryan Fleury
2024-01-26 09:04:29 -08:00
parent 33f5d4f5b1
commit 89af8124c7
8 changed files with 139 additions and 4 deletions
+13
View File
@@ -2886,6 +2886,19 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
Rng2F32 bottom_bar_rect = r2f32p(window_rect.x0, window_rect_dim.y - ui_top_pref_height().value, window_rect.x0+window_rect_dim.x, window_rect.y0+window_rect_dim.y);
Rng2F32 content_rect = r2f32p(window_rect.x0, top_bar_rect.y1, window_rect.x0+window_rect_dim.x, bottom_bar_rect.y0);
////////////////////////////
//- rjf: truncated string hover
//
if(ui_string_hover_active()) UI_Tooltip
{
Temp scratch = scratch_begin(&arena, 1);
String8 string = ui_string_hover_string(scratch.arena);
D_FancyRunList runs = ui_string_hover_runs(scratch.arena);
UI_Box *box = ui_build_box_from_key(UI_BoxFlag_DrawText, ui_key_zero());
ui_box_equip_display_string_fancy_runs(box, string, &runs);
scratch_end(scratch);
}
////////////////////////////
//- rjf: drag/drop visualization tooltips
//