From 6223f67ccc8cb9784e6bf9351ae82e37c4ea04b8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Nov 2019 23:18:35 +0100 Subject: [PATCH] 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. --- src/common/stattextcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/stattextcmn.cpp b/src/common/stattextcmn.cpp index 553c607647..daf2488296 100644 --- a/src/common/stattextcmn.cpp +++ b/src/common/stattextcmn.cpp @@ -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)