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 6c1b2b23cf.

Closes #18469.
This commit is contained in:
Vadim Zeitlin
2019-10-25 02:54:50 +02:00
parent 616ad0d92b
commit 288b570e11
2 changed files with 6 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ protected:
// true if the status bar shows the size grip: for this it must have // 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 // 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; bool ShowsSizeGrip() const;
// returns the position and the size of the size grip // returns the position and the size of the size grip

View File

@@ -194,12 +194,17 @@ void wxStatusBarGeneric::DoUpdateFieldWidths()
bool wxStatusBarGeneric::ShowsSizeGrip() const bool wxStatusBarGeneric::ShowsSizeGrip() const
{ {
// Currently drawing size grip is implemented only in wxGTK.
#ifdef __WXGTK20__
if ( !HasFlag(wxSTB_SIZEGRIP) ) if ( !HasFlag(wxSTB_SIZEGRIP) )
return false; return false;
wxTopLevelWindow * const wxTopLevelWindow * const
tlw = wxDynamicCast(wxGetTopLevelParent(GetParent()), wxTopLevelWindow); tlw = wxDynamicCast(wxGetTopLevelParent(GetParent()), wxTopLevelWindow);
return tlw && !tlw->IsMaximized() && tlw->HasFlag(wxRESIZE_BORDER); 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) void wxStatusBarGeneric::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int textHeight)