Skip to content

Commit

Permalink
Fixed Scope and Spectrum GUI dark mode on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
belangeo committed Feb 11, 2023
1 parent 8e7d5aa commit 8c6b2b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyo/lib/_wxwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ def OnPaint(self, evt):
class SpectrumDisplay(wx.Frame):
def __init__(self, parent, obj=None):
wx.Frame.__init__(self, parent, size=(600, 350))
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
self.SetMinSize((400, 240))
self.menubar = wx.MenuBar()
self.fileMenu = wx.Menu()
Expand Down Expand Up @@ -1624,6 +1625,11 @@ def __init__(self, parent, obj=None):
self.mainBox.Add(self.dispBox, 1, wx.EXPAND)
self.panel.SetSizer(self.mainBox)

self.Bind(wx.EVT_SYS_COLOUR_CHANGED, self.OnColourChanged)

def OnColourChanged(self, evt):
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))

def activate(self, evt):
if evt.GetInt() == 1:
self.obj.poll(1)
Expand Down Expand Up @@ -1931,6 +1937,7 @@ def inc(t, floor_t):
class ScopeDisplay(wx.Frame):
def __init__(self, parent, obj=None):
wx.Frame.__init__(self, parent, size=(600, 350))
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
self.SetMinSize((400, 240))
self.menubar = wx.MenuBar()
self.fileMenu = wx.Menu()
Expand Down Expand Up @@ -1977,6 +1984,7 @@ def __init__(self, parent, obj=None):
self.panel.SetSizer(self.mainBox)

def OnColourChanged(self, evt):
self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_MENUTEXT)
self.windowLengthText.SetForegroundColour(colour)

Expand Down

0 comments on commit 8c6b2b8

Please sign in to comment.