Skip to content

Commit 5ef529c

Browse files
committed
feat(theme): convert dialogs to ThemedDialog
Convert PreferenceDialog, CopySelectDialog, UpdateDialog, SsoLogin, FitBrowserLiteDialog, SecStatusDialog, WaitDialog, and context menu dialogs to use ThemedDialog base class for dark mode support.
1 parent e16ecb8 commit 5ef529c

File tree

12 files changed

+46
-17
lines changed

12 files changed

+46
-17
lines changed

gui/builtinContextMenus/droneSplitStack.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import gui.fitCommands as cmd
77
import gui.mainFrame
88
from gui.contextMenu import ContextMenuSingle
9+
from gui.utils.colors import ThemedDialog, Colors
910
from service.fit import Fit
1011

1112
_t = wx.GetTranslation
@@ -49,7 +50,7 @@ def activate(self, callingWindow, fullContext, mainItem, i):
4950
DroneSplitStack.register()
5051

5152

52-
class DroneStackSplit(wx.Dialog):
53+
class DroneStackSplit(ThemedDialog):
5354

5455
def __init__(self, parent, value):
5556
super().__init__(parent, title="Split Drone Stack", style=wx.DEFAULT_DIALOG_STYLE)
@@ -64,6 +65,7 @@ def __init__(self, parent, value):
6465
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
6566

6667
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
68+
Colors.styleInput(self.input)
6769
self.input.SetValue(str(value))
6870

6971
bSizer1.Add(self.input, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 15)

gui/builtinContextMenus/fitPilotSecurity.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import gui.fitCommands as cmd
66
import gui.mainFrame
77
from gui.contextMenu import ContextMenuUnconditional
8+
from gui.utils.colors import ThemedDialog, Colors
89
from service.fit import Fit
910

1011
_t = wx.GetTranslation
@@ -101,7 +102,7 @@ def handleModeCustom(self, event):
101102
FitPilotSecurityMenu.register()
102103

103104

104-
class SecStatusChanger(wx.Dialog):
105+
class SecStatusChanger(ThemedDialog):
105106

106107
def __init__(self, parent, value):
107108
super().__init__(parent, title=_t('Change Security Status'), style=wx.DEFAULT_DIALOG_STYLE)
@@ -116,6 +117,7 @@ def __init__(self, parent, value):
116117
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
117118

118119
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
120+
Colors.styleInput(self.input)
119121
if value is None:
120122
value = '0.0'
121123
else:

gui/builtinContextMenus/implantSetSave.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import gui.mainFrame
44
from gui.contextMenu import ContextMenuUnconditional
5+
from gui.utils.colors import ThemedDialog, Colors
56
from service.fit import Fit
67

78
_t = wx.GetTranslation
@@ -39,7 +40,7 @@ def activate(self, callingWindow, fullContext, i):
3940
ImplantSetSave.register()
4041

4142

42-
class NameDialog(wx.Dialog):
43+
class NameDialog(ThemedDialog):
4344

4445
def __init__(self, parent, value):
4546
super().__init__(parent, title=_t('New Implant Set'), style=wx.DEFAULT_DIALOG_STYLE)
@@ -54,6 +55,7 @@ def __init__(self, parent, value):
5455
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
5556

5657
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
58+
Colors.styleInput(self.input)
5759
if value is None:
5860
value = ''
5961
else:

gui/builtinContextMenus/itemAmountChange.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from eos.saveddata.fighter import Fighter as es_Fighter
1010
from eos.saveddata.fit import Fit as es_Fit
1111
from gui.contextMenu import ContextMenuCombined
12+
from gui.utils.colors import ThemedDialog, Colors
1213
from service.fit import Fit
1314

1415
# noinspection PyPackageRequirements
@@ -92,7 +93,7 @@ def activate(self, callingWindow, fullContext, mainItem, selection, i):
9293
ChangeItemAmount.register()
9394

9495

95-
class AmountChanger(wx.Dialog):
96+
class AmountChanger(ThemedDialog):
9697

9798
def __init__(self, parent, value, limits=None):
9899
super().__init__(parent, title=_t("Change Amount"), style=wx.DEFAULT_DIALOG_STYLE)
@@ -107,6 +108,7 @@ def __init__(self, parent, value, limits=None):
107108
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
108109

109110
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
111+
Colors.styleInput(self.input)
110112
self.input.SetValue(str(value))
111113

112114
bSizer1.Add(self.input, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 15)

gui/builtinContextMenus/itemProjectionRange.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from eos.saveddata.module import Module as EosModule
1010
from gui.contextMenu import ContextMenuCombined
1111
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
12+
from gui.utils.colors import ThemedDialog, Colors
1213
from service.fit import Fit
1314

1415
# noinspection PyPackageRequirements
@@ -72,7 +73,7 @@ def activate(self, callingWindow, fullContext, mainItem, selection, i):
7273
ChangeItemProjectionRange.register()
7374

7475

75-
class RangeChanger(wx.Dialog):
76+
class RangeChanger(ThemedDialog):
7677

7778
def __init__(self, parent, value):
7879
super().__init__(parent, title='Change Projection Range', style=wx.DEFAULT_DIALOG_STYLE)
@@ -87,6 +88,7 @@ def __init__(self, parent, value):
8788
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
8889

8990
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
91+
Colors.styleInput(self.input)
9092
if value is None:
9193
value = ''
9294
else:

gui/characterEditor.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from gui.builtinViews.implantEditor import BaseImplantEditorView
4141
from gui.contextMenu import ContextMenu
4242
from gui.utils.clipboard import fromClipboard, toClipboard
43+
from gui.utils.colors import Colors, ThemedDialog
4344
from service.character import Character
4445
from service.esi import Esi
4546
from service.esiAccess import APIException
@@ -297,13 +298,15 @@ def __init__(self, parent):
297298
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
298299
style=wx.TAB_TRAVERSAL)
299300
self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor
300-
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
301+
self.SetBackgroundColour(Colors.windowBackground())
302+
self.SetForegroundColour(Colors.text())
301303

302304
pmainSizer = wx.BoxSizer(wx.VERTICAL)
303305

304306
hSizer = wx.BoxSizer(wx.HORIZONTAL)
305307

306308
self.clonesChoice = wx.Choice(self, wx.ID_ANY, style=0)
309+
Colors.styleInput(self.clonesChoice)
307310
i = self.clonesChoice.Append("Omega Clone", None)
308311
self.clonesChoice.SetSelection(i)
309312
hSizer.Add(self.clonesChoice, 5, wx.ALL | wx.EXPAND, 5)
@@ -780,7 +783,8 @@ def __init__(self, parent):
780783
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 300),
781784
style=wx.TAB_TRAVERSAL)
782785
self.charEditor = self.Parent.Parent # first parent is Notebook, second is Character Editor
783-
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
786+
self.SetBackgroundColour(Colors.windowBackground())
787+
self.SetForegroundColour(Colors.text())
784788

785789
pmainSizer = wx.BoxSizer(wx.VERTICAL)
786790

@@ -806,6 +810,7 @@ def __init__(self, parent):
806810
fgSizerInput.Add(self.m_staticCharText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
807811

808812
self.charChoice = wx.Choice(self, wx.ID_ANY, style=0)
813+
Colors.styleInput(self.charChoice)
809814
fgSizerInput.Add(self.charChoice, 1, wx.TOP | wx.BOTTOM | wx.EXPAND, 10)
810815

811816
self.fetchButton = wx.Button(self, wx.ID_ANY, _t("Get Skills"), wx.DefaultPosition, wx.DefaultSize, 0)
@@ -932,7 +937,7 @@ def fetchCallback(e=None):
932937
_t("Successfully fetched skills"), _t("Success"), wx.ICON_INFORMATION | wx.STAY_ON_TOP)
933938

934939

935-
class SecStatusDialog(wx.Dialog):
940+
class SecStatusDialog(ThemedDialog):
936941

937942
def __init__(self, parent, sec):
938943
super().__init__(parent, title=_t("Set Security Status"), size=(300, 175), style=wx.DEFAULT_DIALOG_STYLE)

gui/copySelectDialog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525

2626
from eos.db import getFit
2727
from gui.utils.clipboard import toClipboard
28+
from gui.utils.colors import ThemedDialog
2829
from service.const import PortDnaOptions, PortEftOptions, PortMultiBuyOptions
2930
from service.port import EfsPort, Port
3031
from service.settings import SettingsProvider
3132

3233
_t = wx.GetTranslation
3334

3435

35-
class CopySelectDialog(wx.Dialog):
36+
class CopySelectDialog(ThemedDialog):
3637
copyFormatEft = 0
3738
copyFormatXml = 1
3839
copyFormatDna = 2

gui/fitBrowserLite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import wx
55

66
import gui.display as d
7+
from gui.utils.colors import ThemedDialog, Colors
78
from service.fit import Fit
89

910
_t = wx.GetTranslation
@@ -12,7 +13,7 @@ def fitSorter(fit):
1213
return fit.shipName, fit.name
1314

1415

15-
class FitBrowserLiteDialog(wx.Dialog):
16+
class FitBrowserLiteDialog(ThemedDialog):
1617

1718
def __init__(self, parent, title=_t('Add Fits'), excludedFitIDs=()):
1819
super().__init__(parent, title=title, style=wx.DEFAULT_DIALOG_STYLE)
@@ -29,6 +30,7 @@ def __init__(self, parent, title=_t('Add Fits'), excludedFitIDs=()):
2930

3031
searchSizer = wx.BoxSizer(wx.HORIZONTAL)
3132
self.searchBox = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
33+
Colors.styleInput(self.searchBox)
3234
searchSizer.Add(self.searchBox, 1, wx.EXPAND | wx.ALL, 5)
3335
mainSizer.Add(searchSizer, 0, wx.EXPAND | wx.ALL, 0)
3436

gui/preferenceDialog.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
import wx
2222
from gui.preferenceView import PreferenceView
2323
from gui.bitmap_loader import BitmapLoader
24+
from gui.utils.colors import Colors, ThemedDialog
2425

2526
_t = wx.GetTranslation
2627

27-
class PreferenceDialog(wx.Dialog):
28+
class PreferenceDialog(ThemedDialog):
2829

2930
def __init__(self, parent):
3031
super().__init__(parent, id=wx.ID_ANY, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)
@@ -36,6 +37,9 @@ def __init__(self, parent):
3637
self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT)
3738

3839
self.listview = self.listbook.GetListView()
40+
# Apply theme colors to the listview
41+
self.listview.SetBackgroundColour(Colors.listBackground())
42+
self.listview.SetForegroundColour(Colors.text())
3943
# self.listview.SetMinSize((500, -1))
4044
# self.listview.SetSize((500, -1))
4145

@@ -60,6 +64,9 @@ def __init__(self, parent):
6064
for prefView in PreferenceView.views:
6165
page = wx.ScrolledWindow(self.listbook)
6266
page.SetScrollRate(15, 15)
67+
# Apply theme colors to the page
68+
page.SetBackgroundColour(Colors.buttonFace())
69+
page.SetForegroundColour(Colors.text())
6370
bmp = prefView.getImage()
6471
if bmp:
6572
imgID = self.imageList.Add(bmp)

gui/ssoLogin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
import config
66
import time
77

8+
from gui.utils.colors import ThemedDialog, Colors
89
from service.settings import EsiSettings
910

1011
_t = wx.GetTranslation
1112

1213

13-
class SsoLogin(wx.Dialog):
14+
class SsoLogin(ThemedDialog):
1415

1516
def __init__(self, server: config.ApiServer, start_local_server=True):
1617
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
@@ -37,6 +38,7 @@ def __init__(self, server: config.ApiServer, start_local_server=True):
3738

3839
self.ssoInfoCtrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (-1, -1), style=wx.TE_MULTILINE)
3940
self.ssoInfoCtrl.SetFont(wx.Font(8, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL))
41+
Colors.styleInput(self.ssoInfoCtrl)
4042
self.ssoInfoCtrl.Layout()
4143
self.ssoInfoCtrl.Bind(wx.EVT_TEXT, self.OnTextEnter)
4244

0 commit comments

Comments
 (0)