fix issue 1389

This commit is contained in:
Pappenreiter.Thomas
2019-10-09 17:26:12 +02:00
parent 2fa74f64d3
commit a359f487ab

View File

@@ -2974,10 +2974,12 @@ class TreeListMainWindow(CustomTreeCtrl):
# except for custom item backgrounds, works for both kinds of theme.
elif drawItemBackground:
"""
itemrect = wx.Rect(0, item.GetY() + off_h, total_w-1, total_h - off_h)
dc.SetBrush(wx.Brush(colBg))
dc.DrawRectangle(itemrect)
dc.SetTextForeground(colText)
"""
else:
dc.SetTextForeground(colText)
@@ -3110,6 +3112,22 @@ class TreeListMainWindow(CustomTreeCtrl):
dc.SetTextForeground(colText)
else:
if not item.IsSelected():
if self.HasAGWFlag(TR_FILL_WHOLE_COLUMN_BACKGROUND):
itemrect = wx.Rect(text_x-2, item.GetY() + off_h, col_w-2*_MARGIN, total_h - off_h)
else:
itemrect = wx.Rect(text_x-2, item.GetY() + off_h, text_w+2*_MARGIN, total_h - off_h)
colBgX = item.GetBackgroundColour(i)
if colBgX != None:
dc.SetBrush(wx.Brush(colBgX, wx.SOLID))
dc.SetPen(wx.TRANSPARENT_PEN)
dc.DrawRectangle(itemrect)
if self.HasAGWFlag(TR_COLUMN_LINES): # vertical lines between columns
pen = wx.Pen(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DLIGHT), 1, wx.PENSTYLE_SOLID)
dc.SetPen((self.GetBackgroundColour() == wx.WHITE and [pen] or [wx.WHITE_PEN])[0])