@@ -174,7 +174,14 @@ def SetValue(self, row, col, value):
174
174
value = "None"
175
175
self .data [row ][colname ] = value
176
176
177
- def ResetView (self , grid : wx .grid .Grid ):
177
+ def setCellTheme (self , row , col , grid ):
178
+ system_appearance = wx .SystemSettings .GetAppearance ()
179
+ background_colour = wx .SystemSettings .GetColour (wx .SYS_COLOUR_WINDOW )
180
+ text_colour = wx .WHITE if system_appearance .IsDark () else wx .BLACK
181
+ grid .SetCellBackgroundColour (row , col , background_colour )
182
+ grid .SetCellTextColour (row , col , text_colour )
183
+
184
+ def ResetView (self , grid ):
178
185
"""
179
186
(wx.grid.Grid) -> Reset the grid view. Call this to
180
187
update the grid if rows and columns have been added or deleted
@@ -289,8 +296,7 @@ def _updateColAttrs(self, grid: wx.grid.Grid):
289
296
290
297
grid .SetCellEditor (row , col , editor )
291
298
grid .SetCellRenderer (row , col , renderer )
292
-
293
- grid .SetCellBackgroundColour (row , col , wx .WHITE )
299
+ self .setCellTheme (row , col , grid )
294
300
295
301
def SetData (self , data ):
296
302
self .data = data
0 commit comments