progress on per-view searching operation - will be specialized & used for replacements for finding text, for going to line/address, and filtering in query views

This commit is contained in:
Ryan Fleury committed 2025-02-19 11:33:16 -08:00
1 parent f87dd1be82
commit a8f72dd5f1
10 files changed
+386 -342

No files matched your search

+20 -37
View File
@@ -371,7 +371,7 @@ rd_title_fstrs_from_ctrl_entity(Arena *arena, CTRL_Entity *entity, B32 include_e
Vec4F32 color = rd_color_from_ctrl_entity(entity);
if(color.w == 0)
{
color = ui_top_palette()->text;
color = ui_color_from_name(str8_lit("text"));
}
Vec4F32 secondary_color = ui_top_palette()->text_weak;
String8 name = rd_name_from_ctrl_entity(arena, entity);
@@ -401,8 +401,9 @@ rd_title_fstrs_from_ctrl_entity(Arena *arena, CTRL_Entity *entity, B32 include_e
entity->kind == CTRL_EntityKind_Process ||
entity->kind == CTRL_EntityKind_Thread) &&
ctrl_entity_tree_is_frozen(entity))
UI_TagF("bad")
{
dr_fstrs_push_new(arena, &result, &params, rd_icon_kind_text_table[RD_IconKind_Locked], .font = rd_font_from_slot(RD_FontSlot_Icons), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Icons), .color = ui_top_palette()->background_bad);
dr_fstrs_push_new(arena, &result, &params, rd_icon_kind_text_table[RD_IconKind_Locked], .font = rd_font_from_slot(RD_FontSlot_Icons), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Icons), .color = ui_color_from_name(str8_lit("text")));
dr_fstrs_push_new(arena, &result, &params, str8_lit(" "));
}
@@ -585,19 +586,8 @@ rd_loading_overlay(Rng2F32 rect, F32 loading_t, U64 progress_v, U64 progress_v_t
F32 t = pow_f32(sin_f32((F32)rd_state->time_in_seconds / 1.8f), 2.f);
F64 v = 1.f - abs_f32(0.5f - t);
// rjf: colors
Vec4F32 bg_color = rd_rgba_from_theme_color(RD_ThemeColor_BaseBackground);
Vec4F32 bd_color = rd_rgba_from_theme_color(RD_ThemeColor_BaseBorder);
Vec4F32 hl_color = rd_rgba_from_theme_color(RD_ThemeColor_BaseBackgroundPop);
bg_color.w *= loading_t;
bd_color.w *= loading_t;
hl_color.w *= loading_t;
// rjf: grab animation params
F32 bg_work_indicator_t = 1.f;
// rjf: build indicator
UI_CornerRadius(height/3.f)
UI_CornerRadius(height/3.f) UI_Transparency(1-loading_t)
{
// rjf: rects
Rng2F32 indicator_region_rect =
@@ -615,42 +605,35 @@ rd_loading_overlay(Rng2F32 rect, F32 loading_t, U64 progress_v, U64 progress_v_t
indicator_rect = pad_2f32(indicator_rect, -1.f);
// rjf: does the view have loading *progress* info? -> draw extra progress layer
if(progress_v != progress_v_target)
if(progress_v != progress_v_target) UI_TagF("drop_site")
{
F64 pct_done_f64 = ((F64)progress_v/(F64)progress_v_target);
F32 pct_done = (F32)pct_done_f64;
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = v4f32(1, 1, 1, 0.2f*loading_t)));
ui_set_next_fixed_x(indicator_region_rect.x0);
ui_set_next_fixed_y(indicator_region_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x*pct_done);
ui_set_next_fixed_height(dim_2f32(indicator_region_rect).y);
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero());
Rng2F32 pct_rect = r2f32p(indicator_region_rect.x0,
indicator_region_rect.y0,
indicator_region_rect.x0 + (indicator_region_rect.x1 - indicator_region_rect.x0)*pct_done,
indicator_region_rect.y1);
UI_Rect(pct_rect)
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_Floating, ui_key_zero());
}
// rjf: fill
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = hl_color));
ui_set_next_fixed_x(indicator_rect.x0);
ui_set_next_fixed_y(indicator_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_rect).x);
ui_set_next_fixed_height(dim_2f32(indicator_rect).y);
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero());
UI_TagF("pop") UI_Rect(indicator_rect)
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_Floating, ui_key_zero());
// rjf: animated bar
ui_set_next_palette(ui_build_palette(ui_top_palette(), .border = bd_color, .background = bg_color));
ui_set_next_fixed_x(indicator_region_rect.x0);
ui_set_next_fixed_y(indicator_region_rect.y0);
ui_set_next_fixed_width(dim_2f32(indicator_region_rect).x);
ui_set_next_fixed_height(dim_2f32(indicator_region_rect).y);
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY|UI_BoxFlag_Clickable, "bg_system_status");
UI_Signal sig = ui_signal_from_box(box);
UI_Rect(indicator_region_rect)
{
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBorder|UI_BoxFlag_Floating|UI_BoxFlag_Clickable, "bg_system_status");
UI_Signal sig = ui_signal_from_box(box);
}
}
// rjf: build background
UI_WidthFill UI_HeightFill
UI_WidthFill UI_HeightFill UI_Transparency(1-loading_t) UI_BlurSize(10.f*loading_t)
{
ui_set_next_palette(ui_build_palette(ui_top_palette(), .background = bg_color));
ui_set_next_blur_size(10.f*loading_t);
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_FloatingX|UI_BoxFlag_FloatingY, ui_key_zero());
ui_build_box_from_key(UI_BoxFlag_DrawBackground|UI_BoxFlag_DrawBackgroundBlur|UI_BoxFlag_Floating, ui_key_zero());
}
}
}