mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 06:33:59 +08:00
Compute wxStaticText best size ourselves if GTK does it wrongly
GTK doesn't take into account changes to the font of a hidden wxStaticText and returns wrong preferred (i.e. best) size for it which still uses the old font in this case, which results in all sorts of problems when this wrong best size is used for the layout. Work around it by computing the best size ourselves in this case using the correct font. This seems to return exactly the same results as GTK returns as long as the font is not changed, but also works correctly when it is. This commit is best viewed ignoring whitespace-only changes. See #16088.
This commit is contained in:
@@ -61,6 +61,9 @@ private:
|
||||
|
||||
void GTKDoSetLabel(GTKLabelSetter setter, const wxString& label);
|
||||
|
||||
// If our font has been changed, we compute the best size ourselves because
|
||||
// GTK doesn't always do it correctly, see DoGetBestSize().
|
||||
bool m_computeOurOwnBestSize = false;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStaticText);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user