mouse-driven ui path for query completion; show-in-explorer ui for tab ctx menu

This commit is contained in:
Ryan Fleury
2024-06-20 08:02:01 -07:00
parent b76c605eba
commit c60d3aab22
5 changed files with 81 additions and 27 deletions
+6 -1
View File
@@ -170,8 +170,13 @@ internal F32 os_caret_blink_time(void);
internal F32 os_default_refresh_rate(void);
////////////////////////////////
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
internal void os_graphical_message(B32 error, String8 title, String8 message);
////////////////////////////////
//~ rjf: @os_hooks Shell Operations
internal void os_show_in_filesystem_ui(String8 path);
#endif // OS_GRAPHICAL_H
+9 -1
View File
@@ -240,9 +240,17 @@ os_granular_sleep_enabled(void)
}
////////////////////////////////
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
internal void
os_graphical_message(B32 error, String8 title, String8 message)
{
}
////////////////////////////////
//~ rjf: @os_hooks Shell Operations
internal void
os_show_in_filesystem_ui(String8 path)
{
}
+28 -1
View File
@@ -1421,7 +1421,7 @@ os_default_refresh_rate(void)
}
////////////////////////////////
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
//~ rjf: @os_hooks Native User-Facing Graphical Messages (Implemented Per-OS)
internal void
os_graphical_message(B32 error, String8 title, String8 message)
@@ -1432,3 +1432,30 @@ os_graphical_message(B32 error, String8 title, String8 message)
MessageBoxW(0, (WCHAR *)message16.str, (WCHAR *)title16.str, MB_OK|(!!error*MB_ICONERROR));
scratch_end(scratch);
}
////////////////////////////////
//~ rjf: @os_hooks Shell Operations
internal void
os_show_in_filesystem_ui(String8 path)
{
Temp scratch = scratch_begin(0, 0);
String8 path_copy = push_str8_copy(scratch.arena, path);
for(U64 idx = 0; idx < path_copy.size; idx += 1)
{
if(path_copy.str[idx] == '/')
{
path_copy.str[idx] = '\\';
}
}
String16 path16 = str16_from_8(scratch.arena, path_copy);
SFGAOF flags = 0;
PIDLIST_ABSOLUTE list = 0;
if(path16.size != 0 && SUCCEEDED(SHParseDisplayName(path16.str, 0, &list, 0, &flags)))
{
HRESULT hr = SHOpenFolderAndSelectItems(list, 0, 0, 0);
CoTaskMemFree(list);
(void)hr;
}
scratch_end(scratch);
}