Use client size when ellipsizing wxStaticText label
The full size includes the borders and the return value of this function might not actually be fully visible if we use it, as it can fit into the full width but not the client width. And at least under MSW this resulted in the ellipsized label being wrapped, which was completely unexpected, especially if the second line of the control was not visible at all as it seemed that the last word simply disappeared. Closes #18573.
This commit is contained in:
@@ -261,7 +261,7 @@ wxString wxStaticTextBase::GetEllipsizedLabel() const
|
||||
|
||||
wxString wxStaticTextBase::Ellipsize(const wxString& label) const
|
||||
{
|
||||
wxSize sz(GetSize());
|
||||
wxSize sz(GetClientSize());
|
||||
if (sz.GetWidth() < 2 || sz.GetHeight() < 2)
|
||||
{
|
||||
// the size of this window is not valid (yet)
|
||||
|
Reference in New Issue
Block a user