Fold best size and ellipsis handling in AutoResizeIfNecessary()
Refactor wxStaticText code to use AutoResizeIfNecessary() for all the updates done after the label extent changes (whether it's due to the change of the label itself or the font used for rendering it). There should be no changes in behaviour after this commit except for a small bug fix in wxGenericStaticText when setting label with markup: this didn't invalidate the best size before, but does now.
This commit is contained in:
@@ -102,10 +102,7 @@ void wxGenericStaticText::SetLabel(const wxString& label)
|
||||
wxControl::SetLabel(label);
|
||||
DoSetLabel(GetEllipsizedLabel());
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
if ( !IsEllipsized() )
|
||||
AutoResizeIfNecessary();
|
||||
AutoResizeIfNecessary();
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
if ( m_markupText )
|
||||
|
||||
Reference in New Issue
Block a user