X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..75d9e502238df95fa53c0030b1fac0d4f43e4025:/wxPython/wx/lib/stattext.py diff --git a/wxPython/wx/lib/stattext.py b/wxPython/wx/lib/stattext.py index fddbf4e60e..f69d9b6160 100644 --- a/wxPython/wx/lib/stattext.py +++ b/wxPython/wx/lib/stattext.py @@ -56,7 +56,7 @@ class GenStaticText(wx.PyControl): style = self.GetWindowStyleFlag() self.InvalidateBestSize() if not style & wx.ST_NO_AUTORESIZE: - self.SetInitialSize(self.GetBestSize()) + self.SetSize(self.GetBestSize()) self.Refresh() @@ -69,7 +69,7 @@ class GenStaticText(wx.PyControl): style = self.GetWindowStyleFlag() self.InvalidateBestSize() if not style & wx.ST_NO_AUTORESIZE: - self.SetInitialSize(self.GetBestSize()) + self.SetSize(self.GetBestSize()) self.Refresh() @@ -137,7 +137,11 @@ class GenStaticText(wx.PyControl): dc.SetBackground(backBrush) dc.Clear() - dc.SetTextForeground(self.GetForegroundColour()) + if self.IsEnabled(): + dc.SetTextForeground(self.GetForegroundColour()) + else: + dc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT)) + dc.SetFont(self.GetFont()) label = self.GetLabel() style = self.GetWindowStyleFlag()