From 288b570e1139b8d43a33772b6165d1700df3f2dc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Oct 2019 02:54:50 +0200 Subject: [PATCH] Don't account for size grip under platforms not showing it Size grip in generic wxStatusBar is only supported in wxGTK as it's drawn using GTK functions, but this is not really a problem as other platforms either use native implementations (MSW, Qt) or shouldn't show size grip anyhow as it looks non-native (Mac). So just ensure we don't leave space for the grip if it's not shown, correcting the change of 6c1b2b23cf5e707b9971e37eb14715836d9e63e3. Closes #18469. --- include/wx/generic/statusbr.h | 2 +- src/generic/statusbr.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/statusbr.h b/include/wx/generic/statusbr.h index 6d0edd6ec2..996012b07a 100644 --- a/include/wx/generic/statusbr.h +++ b/include/wx/generic/statusbr.h @@ -81,7 +81,7 @@ protected: // true if the status bar shows the size grip: for this it must have // wxSTB_SIZEGRIP style and the window it is attached to must be resizable - // and not maximized + // and not maximized (note that currently size grip is only used in wxGTK) bool ShowsSizeGrip() const; // returns the position and the size of the size grip diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index eecc549de6..53ca7e1a8c 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -194,12 +194,17 @@ void wxStatusBarGeneric::DoUpdateFieldWidths() bool wxStatusBarGeneric::ShowsSizeGrip() const { + // Currently drawing size grip is implemented only in wxGTK. +#ifdef __WXGTK20__ if ( !HasFlag(wxSTB_SIZEGRIP) ) return false; wxTopLevelWindow * const tlw = wxDynamicCast(wxGetTopLevelParent(GetParent()), wxTopLevelWindow); return tlw && !tlw->IsMaximized() && tlw->HasFlag(wxRESIZE_BORDER); +#else // !__WXGTK20__ + return false; +#endif // __WXGTK20__/!__WXGTK20__ } void wxStatusBarGeneric::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int textHeight)