Lay out the overlay panels in a fixed 3-column scheme

Panels used to Begin at cascade positions, so they overlapped and clipped. A new
apply_panel_layout() in app_chrome positions/sizes each panel from the main
viewport work area (ImGuiCond_FirstUseEver, still movable): Injection left column
full height (room for hook diagnostics), Controllers/Video/Audio stacked in the
center column, Log right edge full height (max room for the log stream). Added a
"View -> Reset layout" menu item (request_layout_reset / apply_layout_end_frame
re-apply the defaults once via ImGuiCond_Always). Each panel now calls
apply_panel_layout(Panel::X) instead of its own ad-hoc SetNextWindowPos/Size.

Verified live: captured the host overlay -- Injection (left, full height),
Controllers/Video/Audio (center stack), Log (right, full height), no overlap among
the panels. x64 build + ctest green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 01:19:45 +02:00
parent 80cc5e72bd
commit 37d0f64e23
9 changed files with 105 additions and 21 deletions

View File

@@ -22,6 +22,27 @@ struct UiState
bool debug_details = false; // off = general status; on = full diagnostics
};
// The overlay panels, for the shared default layout below.
enum class Panel
{
Injection, // left column, full height (room for hook diagnostics)
Controllers, // center column, top
Video, // center column, below Controllers
Audio, // center column, below Video
Log, // right column, full height (max room for the log stream)
};
// Position + size the next ImGui window per the default 3-column layout, so panels
// open without overlapping or needing a manual resize. First-use only, unless a
// layout reset was just requested (then it re-applies once). Call right before the
// panel's ImGui::Begin.
void apply_panel_layout(Panel panel);
// "View -> Reset layout" sets this; it forces apply_panel_layout to re-place every
// panel on the next frame. apply_layout_end_frame() clears it after the panels draw.
void request_layout_reset();
void apply_layout_end_frame();
// Rolling frame-timing over a ~1 s window, recomputed each window so the status
// bar can show a stable FPS plus the min/max frame time (jitter) underneath it.
class FrameStats