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.
This commit is contained in:
Vadim Zeitlin 2020-05-01 03:23:52 +02:00
parent 9ed122b31f
commit ecc58e5211

View File

@ -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;
}