wx: fix layout — log adapts and stays at the bottom on resize
The frame had no sizer; it relied on the implicit single-child fill, which didn't reliably resize the panel, so the panel's vertical sizer never redistributed and the log kept its size when the window grew. Add a frame sizer holding the panel at proportion 1 + wxEXPAND, so a resize re-lays-out the panel and the log (1/3) tracks the window. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -170,6 +170,13 @@ EssimFrame::EssimFrame(WxFrontend &fe)
|
||||
root->Add(log_, 1, wxEXPAND | wxALL, 4);
|
||||
panel->SetSizer(root);
|
||||
|
||||
// Drive the panel from a frame sizer so it fills the client area and
|
||||
// re-lays-out on every resize (the implicit single-child fill is not
|
||||
// reliable here — without this the log keeps its size when the window grows).
|
||||
auto *frame_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
frame_sizer->Add(panel, 1, wxEXPAND);
|
||||
SetSizer(frame_sizer);
|
||||
|
||||
Bind(wxEVT_MENU, &EssimFrame::OnLoad, this, ID_LOAD);
|
||||
Bind(wxEVT_MENU, &EssimFrame::OnRestore, this, ID_RESTORE);
|
||||
Bind(wxEVT_MENU, &EssimFrame::OnSave, this, ID_SAVE);
|
||||
|
||||
Reference in New Issue
Block a user