Skip to content

Commit

Permalink
Fix the white on white on windows (#14)
Browse files Browse the repository at this point in the history
Dark mode doesn't work with wxpython and must be excluded from the dark mode grid color selector.
  • Loading branch information
sveinse authored Apr 9, 2024
1 parent 9044c00 commit 28673bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/objdictgen/ui/subindextable.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# USA

import codecs
import os

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

Expand Down

0 comments on commit 28673bb

Please sign in to comment.