From a87e596be79cdca74dd440207f3b102dca60f3e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Aug 2019 17:09:58 +0200 Subject: [PATCH] Replace hardcoded number with a constant in generic wxListCtrl Use ICON_OFFSET_X instead of hardcoded 2. --- src/generic/listctrl.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index fdf2cd43a1..aa3da04f48 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -83,6 +83,15 @@ static const int EXTRA_HEIGHT = 4; static const int EXTRA_BORDER_X = 2; static const int EXTRA_BORDER_Y = 2; +#ifdef __WXGTK__ + // This probably needs to be done + // on all platforms as the icons + // otherwise nearly touch the border + static const int ICON_OFFSET_X = 2; +#else + static const int ICON_OFFSET_X = 0; +#endif + // offset for the header window static const int HEADER_OFFSET_X = 0; static const int HEADER_OFFSET_Y = 0; @@ -802,14 +811,8 @@ void wxListLineData::DrawInReportMode( wxDC *dc, ApplyAttributes(dc, rectHL, highlighted, current); - wxCoord x = rect.x + HEADER_OFFSET_X, + wxCoord x = rect.x + HEADER_OFFSET_X + ICON_OFFSET_X, yMid = rect.y + rect.height/2; -#ifdef __WXGTK__ - // This probably needs to be done - // on all platforms as the icons - // otherwise nearly touch the border - x += 2; -#endif if ( m_owner->HasCheckBoxes() ) {