Update static box label size after font change

This commit is contained in:
Noisyfox 2025-10-05 21:55:37 +08:00
parent 687286ccac
commit 38f51bd77f

View file

@ -101,6 +101,13 @@ void LabeledStaticBox::SetBorderColor(StateColor const &color)
void LabeledStaticBox::SetFont(wxFont set_font)
{
m_font = set_font;
int tW,tH,descent,externalLeading;
// empty label sets m_label_height as 0 that causes extra spacing at top
GetTextExtent(m_label.IsEmpty() ? "Orca" : m_label, &tW, &tH, &descent, &externalLeading, &m_font);
m_label_height = tH - externalLeading;
m_label_width = tW;
Refresh();
}