display folder in title fstr generation for file evaluations, but only if not inside a folder context

This commit is contained in:
Ryan Fleury
2026-05-18 20:06:05 -07:00
parent 40885a3f59
commit a75cb2c32d
3 changed files with 15 additions and 3 deletions
+2 -1
View File
@@ -1636,7 +1636,8 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
//- rjf: files -> button for file //- rjf: files -> button for file
else if(result.file_path.size != 0) else if(result.file_path.size != 0)
{ {
result.expr_fstrs = rd_title_fstrs_from_file_path(arena, result.file_path); B32 need_folder = !str8_match(row_info->group_cfg_name, str8_lit("folder"), 0);
result.expr_fstrs = rd_title_fstrs_from_file_path(arena, result.file_path, need_folder);
result.flags |= RD_WatchCellFlag_Button; result.flags |= RD_WatchCellFlag_Button;
} }
+12 -1
View File
@@ -659,7 +659,7 @@ rd_title_fstrs_from_code_name(Arena *arena, String8 code_name)
} }
internal DR_FStrList internal DR_FStrList
rd_title_fstrs_from_file_path(Arena *arena, String8 file_path) rd_title_fstrs_from_file_path(Arena *arena, String8 file_path, B32 include_folder)
{ {
DR_FStrList fstrs = {0}; DR_FStrList fstrs = {0};
String8 file_name = str8_skip_last_slash(file_path); String8 file_name = str8_skip_last_slash(file_path);
@@ -685,6 +685,17 @@ rd_title_fstrs_from_file_path(Arena *arena, String8 file_path)
} }
dr_fstrs_push_new(arena, &fstrs, &params, str8_lit(" ")); dr_fstrs_push_new(arena, &fstrs, &params, str8_lit(" "));
dr_fstrs_push_new(arena, &fstrs, &params, file_name); dr_fstrs_push_new(arena, &fstrs, &params, file_name);
if(include_folder)
{
dr_fstrs_push_new(arena, &fstrs, &params, str8_lit(" "));
UI_TagF("weak")
{
dr_fstrs_push_new(arena, &fstrs, &params,
str8_chop_last_slash(file_path),
.size = params.size*0.9f,
.color = ui_color_from_name(str8_lit("text")));
}
}
return fstrs; return fstrs;
} }
+1 -1
View File
@@ -142,7 +142,7 @@ struct RD_CodeSliceSignal
internal DR_FStrList rd_title_fstrs_from_cfg(Arena *arena, CFG_Node *cfg, B32 include_extras); internal DR_FStrList rd_title_fstrs_from_cfg(Arena *arena, CFG_Node *cfg, B32 include_extras);
internal DR_FStrList rd_title_fstrs_from_ctrl_entity(Arena *arena, D_Entity *entity, B32 include_extras); internal DR_FStrList rd_title_fstrs_from_ctrl_entity(Arena *arena, D_Entity *entity, B32 include_extras);
internal DR_FStrList rd_title_fstrs_from_code_name(Arena *arena, String8 code_name); internal DR_FStrList rd_title_fstrs_from_code_name(Arena *arena, String8 code_name);
internal DR_FStrList rd_title_fstrs_from_file_path(Arena *arena, String8 file_path); internal DR_FStrList rd_title_fstrs_from_file_path(Arena *arena, String8 file_path, B32 include_folder);
//////////////////////////////// ////////////////////////////////
//~ rjf: UI Widgets: Loading Overlay //~ rjf: UI Widgets: Loading Overlay