def darkMode(self, normalPanelColor):
"""
Toggles dark mode
"""
widgets = getWidgets(self)
panel = widgets[0]
if normalPanelColor == panel.GetBackgroundColour():
dark_mode = True
else:
dark_mode = False
for widget in widgets:
if dark_mode:
if isinstance(widget, ObjectListView) or isinstance(widget, wx.ListCtrl):
darkRowFormatter(widget, dark=True)
widget.SetBackgroundColour("Dark Grey")
widget.SetForegroundColour("White")
else:
if isinstance(widget, ObjectListView) or isinstance(widget, wx.ListCtrl):
darkRowFormatter(widget)
widget.SetBackgroundColour("White")
widget.SetForegroundColour("Black")
continue
widget.SetBackgroundColour(wx.NullColour)
widget.SetForegroundColour("Black")
self.Refresh()
return dark_mode
评论列表
文章目录