Fix Windows paint on resize issue. Automatically resize to fit tabs and button content

This commit is contained in:
Lam Wei Lun
2026-08-25 15:18:38 +08:00
parent d4cb739b8b
commit 795514900d
6 changed files with 58 additions and 4 deletions
+9
View File
@@ -295,6 +295,15 @@ void TabCtrl::relayout()
Layout();
}
int TabCtrl::buttons_best_width() const
{
// Mirrors relayout(): a 10px leading spacer plus every button's min width and spacing.
int width = 10;
for (const Button *btn : btns)
width += btn->GetMinSize().x + TAB_BUTTON_SPACE * 2;
return width;
}
void TabCtrl::buttonClicked(wxCommandEvent &event)
{
SetFocus();