From 768c417c8e874ca92ac1d0f76033e2736eed8a5b Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Wed, 21 Feb 2024 00:00:44 +0600 Subject: [PATCH] Add alternate colors for fitting pane (for dark mode on macos) --- config.py | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/config.py b/config.py index 23c0e6fdc..90744a329 100644 --- a/config.py +++ b/config.py @@ -58,13 +58,32 @@ LOGLEVEL_MAP = { CATALOG = 'lang' -slotColourMap = { - FittingSlot.LOW: wx.Colour(250, 235, 204), # yellow = low slots - FittingSlot.MED: wx.Colour(188, 215, 241), # blue = mid slots - FittingSlot.HIGH: wx.Colour(235, 204, 209), # red = high slots - FittingSlot.RIG: '', - FittingSlot.SUBSYSTEM: '' -} +isDark = False +try: + isDark = wx.SystemAppearance().IsDark() +except (KeyboardInterrupt, SystemExit): + raise +except: + pass + + +if isDark: + slotColourMap = { + FittingSlot.LOW: wx.Colour(44, 36, 19), # yellow = low slots 24/13 + FittingSlot.MED: wx.Colour(28, 39, 51), # blue = mid slots 8.1/9.5 + FittingSlot.HIGH: wx.Colour(53, 31, 34), # red = high slots 6.5/11.5 + FittingSlot.RIG: '', + FittingSlot.SUBSYSTEM: ''} + errColor = wx.Colour(70, 20, 20) +else: + slotColourMap = { + FittingSlot.LOW: wx.Colour(250, 235, 204), # yellow = low slots + FittingSlot.MED: wx.Colour(188, 215, 241), # blue = mid slots + FittingSlot.HIGH: wx.Colour(235, 204, 209), # red = high slots + FittingSlot.RIG: '', + FittingSlot.SUBSYSTEM: ''} + errColor = wx.Colour(204, 51, 51) + def getClientSecret(): return clientHash