From 6c1b2b23cf5e707b9971e37eb14715836d9e63e3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Sep 2018 16:36:05 +0200 Subject: [PATCH] Fix field widths in wxStatusBar showing a size grip in wxGTK Account for the size grip in DoUpdateFieldWidths(), otherwise the last field overlapped it. --- docs/changes.txt | 1 + src/generic/statusbr.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index a57f7068a1..cbf1c9cf12 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -134,6 +134,7 @@ wxGTK: - Implement wxDataViewColumn::UnsetAsSortKey(). - Fix not showing wxInfoBar with GTK+ 3 < 3.22.29. - Fix the build with glib < 2.32 (e.g. CentOS 6). +- Fix field widths in wxStatusBar showing a size grip. wxMSW: diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index c0581dd679..eecc549de6 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -184,8 +184,12 @@ void wxStatusBarGeneric::DoUpdateFieldWidths() { m_lastClientSize = GetClientSize(); + int width = m_lastClientSize.x; + if ( ShowsSizeGrip() ) + width -= GetSizeGripRect().width; + // recompute the cache of the field widths if the status bar width has changed - m_widthsAbs = CalculateAbsWidths(m_lastClientSize.x); + m_widthsAbs = CalculateAbsWidths(width); } bool wxStatusBarGeneric::ShowsSizeGrip() const