correctly use command titles in native file explorer

This commit is contained in:
Ryan Fleury
2026-06-27 12:07:24 -07:00
parent 0e2b4ac5e7
commit 96cfb441fd
5 changed files with 11 additions and 5 deletions
@@ -757,7 +757,7 @@ wm_graphical_message(B32 error, String8 title, String8 message)
} }
internal String8 internal String8
wm_graphical_pick_file(Arena *arena, String8 initial_path) wm_graphical_pick_file(Arena *arena, String8 title, String8 initial_path)
{ {
return str8_zero(); return str8_zero();
} }
+6 -1
View File
@@ -13106,7 +13106,12 @@ rd_frame(void)
{ {
current_path_string = path_normalized_from_string(scratch.arena, get_current_path(scratch.arena)); current_path_string = path_normalized_from_string(scratch.arena, get_current_path(scratch.arena));
} }
String8 file_path = wm_graphical_pick_file(scratch.arena, current_path_string); String8 cmd_title = rd_display_from_code_name(info->string);
if(cmd_title.size == 0)
{
cmd_title = info->string;
}
String8 file_path = wm_graphical_pick_file(scratch.arena, cmd_title, current_path_string);
file_path = path_normalized_from_string(scratch.arena, file_path); file_path = path_normalized_from_string(scratch.arena, file_path);
if(file_path.size != 0) if(file_path.size != 0)
{ {
@@ -1629,7 +1629,7 @@ wm_graphical_message(B32 error, String8 title, String8 message)
} }
internal String8 internal String8
wm_graphical_pick_file(Arena *arena, String8 initial_path) wm_graphical_pick_file(Arena *arena, String8 title, String8 initial_path)
{ {
String8 result = {0}; String8 result = {0};
{ {
@@ -1638,6 +1638,7 @@ wm_graphical_pick_file(Arena *arena, String8 initial_path)
U16 *buffer = push_array(scratch.arena, U16, buffer_size); U16 *buffer = push_array(scratch.arena, U16, buffer_size);
OPENFILENAMEW params = {sizeof(params)}; OPENFILENAMEW params = {sizeof(params)};
{ {
params.lpstrTitle = (WCHAR *)str16_from_8(scratch.arena, title).str;
params.lpstrFile = (WCHAR *)buffer; params.lpstrFile = (WCHAR *)buffer;
params.nMaxFile = buffer_size; params.nMaxFile = buffer_size;
params.lpstrInitialDir = (WCHAR *)str16_from_8(scratch.arena, initial_path).str; params.lpstrInitialDir = (WCHAR *)str16_from_8(scratch.arena, initial_path).str;
+1 -1
View File
@@ -235,7 +235,7 @@ internal void wm_set_cursor(WM_Cursor cursor);
//~ rjf: @per_os_impl Native User-Facing Graphical Messages (Implemented Per-OS) //~ rjf: @per_os_impl Native User-Facing Graphical Messages (Implemented Per-OS)
internal void wm_graphical_message(B32 error, String8 title, String8 message); internal void wm_graphical_message(B32 error, String8 title, String8 message);
internal String8 wm_graphical_pick_file(Arena *arena, String8 initial_path); internal String8 wm_graphical_pick_file(Arena *arena, String8 title, String8 initial_path);
//////////////////////////////// ////////////////////////////////
//~ rjf: @per_os_impl Shell Operations //~ rjf: @per_os_impl Shell Operations
+1 -1
View File
@@ -259,7 +259,7 @@ wm_graphical_message(B32 error, String8 title, String8 message)
} }
internal String8 internal String8
wm_graphical_pick_file(Arena *arena, String8 initial_path) wm_graphical_pick_file(Arena *arena, String8 title, String8 initial_path)
{ {
return str8_zero(); return str8_zero();
} }