Commit 6349dbdc authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Tweaks to widgetgrid/list colouring

parent 09e2c3d7
......@@ -153,7 +153,7 @@ class WidgetGrid(wx.ScrolledWindow):
border = wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVEBORDER)
odd = wx.SystemSettings.GetColour(wx.SYS_COLOUR_LISTBOX)
even = wx.SystemSettings.GetColour(wx.SYS_COLOUR_LISTBOX)\
.ChangeLightness(75)
.ChangeLightness(90)
label = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
select = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
drag = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHT)
......@@ -167,7 +167,7 @@ class WidgetGrid(wx.ScrolledWindow):
if WidgetGrid._defaultLabelColour is None:
WidgetGrid._defaultLabelColour = label
if WidgetGrid._defaultSelectedColour is None:
WidgetGrid._defaultSelecteddColour = select
WidgetGrid._defaultSelectedColour = select
if WidgetGrid._defaultDragColour is None:
WidgetGrid._defaultDragColour = drag
......@@ -1274,6 +1274,7 @@ class WidgetGrid(wx.ScrolledWindow):
container = self.__widgets[ row][col]
widget = self.__widgetRefs[row][col]
self.__setBackgroundColour(container, colour)
self.__setBackgroundColour(widget, colour)
widget .Refresh()
container.Refresh()
......
......@@ -9,8 +9,6 @@ of widgets.
"""
from collections import OrderedDict
import wx
import wx.lib.newevent as wxevent
import wx.lib.scrolledpanel as scrolledpanel
......@@ -77,7 +75,7 @@ class WidgetList(scrolledpanel.ScrolledPanel):
"""
odd = wx.SystemSettings.GetColour(wx.SYS_COLOUR_LISTBOX)
even = odd.ChangeLightness(75)
even = odd.ChangeLightness(90)
group = odd
if WidgetList._defaultOddColour is None:
......@@ -92,8 +90,8 @@ class WidgetList(scrolledpanel.ScrolledPanel):
self.__sizer = wx.BoxSizer(wx.VERTICAL)
self.__groupSizer = wx.BoxSizer(wx.VERTICAL)
self.__widgets = OrderedDict()
self.__groups = OrderedDict()
self.__widgets = {}
self.__groups = {}
self.__oddColour = WidgetList._defaultOddColour
self.__evenColour = WidgetList._defaultEvenColour
......@@ -564,12 +562,6 @@ class _Widget:
self.panel.SetBackgroundColour(colour)
self.label.SetBackgroundColour(colour)
if isinstance(self.widget, wx.Sizer):
for c in self.widget.GetChildren():
c.GetWindow().SetBackgroundColour(colour)
else:
self.widget.SetBackgroundColour(colour)
def SetTooltip(self, tooltip):
......@@ -620,7 +612,7 @@ class _Group:
self.colPanel = colPanel
self.widgPanel = widgPanel
self.sizer = sizer
self.widgets = OrderedDict()
self.widgets = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment