wx: stop tree/log content from freezing the layout after a script

Real cause of the log not resizing: on GTK a wxTreeCtrl/wxTextCtrl reports a
natural size that grows with its content. Once a script populated the tree with
many pins, the top area's minimum ballooned and consumed the vertical space,
pinning the log at its minimum so it no longer tracked the window (it worked on
an empty tree, hence "only after running a script").

Cap each control's min size (tree/overview 260x120, log 420x90) so content
can't inflate the sizer minimum; the proportions then govern and content
scrolls inside the controls. Keeps the frame sizer from the previous fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 21:59:47 +02:00
parent a9039a8eea
commit 794430e86c

View File

@@ -160,6 +160,15 @@ EssimFrame::EssimFrame(WxFrontend &fe)
overview_->SetFont(mono);
log_->SetFont(mono);
// Cap each control's minimum so its *content* can't inflate the layout's
// minimum size: on GTK a full tree/text reports a large natural size, which
// would otherwise eat all the vertical space and freeze the log at its
// minimum (it stopped resizing once a script populated the tree). With a
// modest min, the sizer proportions govern and content scrolls inside.
tree_->SetMinSize(wxSize(260, 120));
overview_->SetMinSize(wxSize(260, 120));
log_->SetMinSize(wxSize(420, 90));
auto *top = new wxBoxSizer(wxHORIZONTAL);
top->Add(tree_, 1, wxEXPAND | wxALL, 4);
top->Add(overview_, 1, wxEXPAND | wxALL, 4);