mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-16 17:12:23 -07:00
window titles
This commit is contained in:
@@ -136,6 +136,13 @@ os_window_close(OS_Handle handle)
|
||||
if(os_handle_match(handle, os_handle_zero())) {return;}
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_set_title(OS_Handle window, String8 title)
|
||||
{
|
||||
if(os_handle_match(handle, os_handle_zero())) {return;}
|
||||
// TODO(rjf)
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_first_paint(OS_Handle handle)
|
||||
{
|
||||
|
||||
@@ -143,6 +143,7 @@ internal String8 os_get_clipboard_text(Arena *arena);
|
||||
|
||||
internal OS_Handle os_window_open(Rng2F32 rect, OS_WindowFlags flags, String8 title);
|
||||
internal void os_window_close(OS_Handle window);
|
||||
internal void os_window_set_title(OS_Handle window, String8 title);
|
||||
internal void os_window_first_paint(OS_Handle window);
|
||||
internal void os_window_focus(OS_Handle window);
|
||||
internal B32 os_window_is_focused(OS_Handle window);
|
||||
|
||||
@@ -45,6 +45,11 @@ os_window_close(OS_Handle window)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_set_title(OS_Handle window, String8 title)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_first_paint(OS_Handle window)
|
||||
{
|
||||
|
||||
@@ -1084,6 +1084,16 @@ os_window_close(OS_Handle handle)
|
||||
os_w32_window_release(window);
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_set_title(OS_Handle handle, String8 title)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
OS_W32_Window *window = os_w32_window_from_handle(handle);
|
||||
String16 title16 = str16_from_8(scratch.arena, title);
|
||||
SetWindowTextW(window->hwnd, (WCHAR *)title16.str);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
|
||||
internal void
|
||||
os_window_first_paint(OS_Handle window_handle)
|
||||
{
|
||||
|
||||
@@ -5591,6 +5591,13 @@ rd_store_view_paramf(String8 key, char *fmt, ...)
|
||||
////////////////////////////////
|
||||
//~ rjf: Window Functions
|
||||
|
||||
internal String8
|
||||
rd_push_window_title(Arena *arena)
|
||||
{
|
||||
String8 result = push_str8f(arena, "%S - %s", str8_skip_last_slash(rd_state->project_path), BUILD_TITLE " (" BUILD_VERSION_STRING_LITERAL " " BUILD_RELEASE_PHASE_STRING_LITERAL ")");
|
||||
return result;
|
||||
}
|
||||
|
||||
internal RD_Cfg *
|
||||
rd_window_from_cfg(RD_Cfg *cfg)
|
||||
{
|
||||
@@ -5684,7 +5691,7 @@ rd_window_state_from_cfg(RD_Cfg *cfg)
|
||||
ws->cfg_id = id;
|
||||
ws->arena = arena_alloc();
|
||||
{
|
||||
String8 title = str8_lit_comp(BUILD_TITLE_STRING_LITERAL);
|
||||
String8 title = rd_push_window_title(scratch.arena);
|
||||
ws->os = os_window_open(r2f32p(pos.x, pos.y, pos.x+size.x, pos.y+size.y), (!has_pos*OS_WindowFlag_UseDefaultPosition)|OS_WindowFlag_CustomBorder, title);
|
||||
}
|
||||
ws->r = r_window_equip(ws->os);
|
||||
@@ -12605,6 +12612,16 @@ rd_frame(void)
|
||||
rd_cfg_release(recent_projects.last->v);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: update all window titles
|
||||
if(file_is_okay)
|
||||
{
|
||||
String8 window_title = rd_push_window_title(scratch.arena);
|
||||
for(RD_WindowState *ws = rd_state->first_window_state; ws != &rd_nil_window_state; ws = ws->order_next)
|
||||
{
|
||||
os_window_set_title(ws->os, window_title);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: writing config changes
|
||||
|
||||
@@ -944,6 +944,7 @@ internal void rd_store_view_paramf(String8 key, char *fmt, ...);
|
||||
////////////////////////////////
|
||||
//~ rjf: Window Functions
|
||||
|
||||
internal String8 rd_push_window_title(Arena *arena);
|
||||
internal RD_Cfg *rd_window_from_cfg(RD_Cfg *cfg);
|
||||
internal RD_WindowState *rd_window_state_from_cfg(RD_Cfg *cfg);
|
||||
internal RD_WindowState *rd_window_state_from_os_handle(OS_Handle os);
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
// `raddbg_auto_view_rule(DynamicArray<?>, slice)`: declares an
|
||||
// auto-view-rule from source code, rather than from debugger
|
||||
// configuration.
|
||||
// - The debugger now incorporates the loaded project in all window titles.
|
||||
// - Fixed an annoyance where the debugger would open a console window, even
|
||||
// for graphical programs, causing a flicker.
|
||||
// - Fixed substantial unnecessary memory usage with very large output logs.
|
||||
|
||||
Reference in New Issue
Block a user