Fix the checkbox cell size in generic wxDataViewToggleRenderer.
r62940 fixed an appearance problem with the checkboxes in wxDataViewCtrl but introduced another one: as the checkbox was now always drawn in the entire cell rectangle, the cell alignment was not taken into account any more. Fix this by only increasing the checkbox rectangle up to the required minimal size but not any more. Closes #14504. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c0feacc829
commit
45a04dd31a
@ -1007,11 +1007,13 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state
|
||||
GetEnabled() == false)
|
||||
flags |= wxCONTROL_DISABLED;
|
||||
|
||||
// check boxes we draw must always have the same, standard size (if it's
|
||||
// bigger than the cell size the checkbox will be truncated because the
|
||||
// caller had set the clipping rectangle to prevent us from drawing outside
|
||||
// the cell)
|
||||
cell.SetSize(GetSize());
|
||||
// Ensure that the check boxes always have at least the minimal required
|
||||
// size, otherwise DrawCheckBox() doesn't really work well. If this size is
|
||||
// greater than the cell size, the checkbox will be truncated but this is a
|
||||
// lesser evil.
|
||||
wxSize size = cell.GetSize();
|
||||
size.IncTo(GetSize());
|
||||
cell.SetSize(size);
|
||||
|
||||
wxRendererNative::Get().DrawCheckBox(
|
||||
GetOwner()->GetOwner(),
|
||||
|
Loading…
Reference in New Issue
Block a user