Fix expanding last wxDataViewCtrl column in the generic version
The code added in 4156e1a5c9
didn't quite
work correctly because it used the old size of the window, before it was
resized, and not the new size. This was almost unnoticeable when
drag-resizing the window, but very noticeable when maximizing the
containing TLW, as could be seen on the 3rd page of the dataview sample,
for example, where the last column kept its size instead of expanding.
See #13904, #18295.
This commit is contained in:
@@ -5172,9 +5172,6 @@ wxSize wxDataViewCtrl::GetSizeAvailableForScrollTarget(const wxSize& size)
|
||||
|
||||
void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
{
|
||||
if ( m_clientArea && GetColumnCount() )
|
||||
m_clientArea->UpdateColumnSizes();
|
||||
|
||||
// We need to override OnSize so that our scrolled
|
||||
// window a) does call Layout() to use sizers for
|
||||
// positioning the controls but b) does not query
|
||||
@@ -5186,6 +5183,11 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
|
||||
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();
|
||||
|
||||
// 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
|
||||
|
Reference in New Issue
Block a user