Skip to content

Commit 28673bb

Browse files
authored
Fix the white on white on windows (#14)
Dark mode doesn't work with wxpython and must be excluded from the dark mode grid color selector.
1 parent 9044c00 commit 28673bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/objdictgen/ui/subindextable.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# USA
1919

2020
import codecs
21+
import os
2122

2223
import wx
2324
import wx.grid
@@ -160,7 +161,8 @@ def SetValue(self, row, col, value):
160161
def setCellTheme(self, row, col, grid):
161162
system_appearance = wx.SystemSettings.GetAppearance()
162163
background_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
163-
text_colour = wx.WHITE if system_appearance.IsDark() else wx.BLACK
164+
# Windows widgets are white on dark mode, so we need to exclude win
165+
text_colour = wx.WHITE if system_appearance.IsDark() and os.name != "nt" else wx.BLACK
164166
grid.SetCellBackgroundColour(row, col, background_colour)
165167
grid.SetCellTextColour(row, col, text_colour)
166168

0 commit comments

Comments
 (0)