From 488cbb7848abf4c874938fe5021f1f9d4d192d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 9 Jan 2019 15:38:28 +0100 Subject: [PATCH] Fix flicker when reducing wxDVC width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 841c14c37c878dff35a552626c77c7d7a44ff558, reducing width of a generic wxDataViewCtrl caused flickering (horizontal scrollbar appearing and disappearing immediately) when the columns were resized by user code to fix exactly. Fixed by calling AdjustScrollbars() after determining column sizes. It doesn’t make sense to call it before, because UpdateColumnSizes() may change required width. See #18295. --- src/generic/datavgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 2ea515ae00..8f3ebf7cd8 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5183,13 +5183,13 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) Layout(); - AdjustScrollbars(); - // Update the last column size to take all the available space. Note that // this must be done after calling Layout() to update m_clientArea size. if ( m_clientArea && GetColumnCount() ) m_clientArea->UpdateColumnSizes(); + AdjustScrollbars(); + // We must redraw the headers if their height changed. Normally this // shouldn't happen as the control shouldn't let itself be resized beneath // its minimal height but avoid the display artefacts that appear if it