From 88774498d73b982d477bf5cefce94e08c0c8e16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 4 Dec 2013 12:36:24 +0000 Subject: [PATCH] Fix fixed-width progress columns in generic wxDataViewCtrl. Both native wxDVC implementations grow the progress column, the generic one didn't. This change fixes it and _seems_ not to break other things. As a consequence, progress columns no longer have a 40px minimal width, but that should be OK. Fixes #15745. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index afba6111df..103e95776a 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1195,7 +1195,11 @@ wxDataViewProgressRenderer::Render(wxRect rect, wxDC *dc, int WXUNUSED(state)) wxSize wxDataViewProgressRenderer::GetSize() const { - return wxSize(40,12); + // Return -1 width because a progress bar fits any width; unlike most + // renderers, it doesn't have a "good" width for the content. This makes it + // grow to the whole column, which is pretty much always the desired + // behaviour. Keep the height fixed so that the progress bar isn't too fat. + return wxSize(-1, 12); } // ---------------------------------------------------------