From ecc58e521102d9b7d2f84d55978bfc05870f5473 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 May 2020 03:23:52 +0200 Subject: [PATCH] Allow shrinking last column down to its minimal size Not doing this when the last column size should have been exactly equal to its manually set size resulted in showing the horizontal scrollbar unnecessarily. --- src/generic/datavgen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 26407f5e66..9a290ab86c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5112,9 +5112,11 @@ void wxDataViewMainWindow::UpdateColumnSizes() const int availableWidth = fullWinWidth - lastColX; // Never make the column automatically smaller than the last width it - // was explicitly given nor its minimum width. - if ( availableWidth <= wxMax(lastCol->GetMinWidth(), - lastCol->WXGetManuallySetWidth()) ) + // was explicitly given nor its minimum width (however we do need to + // reduce it until this size if it's currently wider, so this + // comparison needs to be strict). + if ( availableWidth < wxMax(lastCol->GetMinWidth(), + lastCol->WXGetManuallySetWidth()) ) { return; }