X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e23d84992fa067d769a3b976a284a2175ed0fc9..68fc5c8025e38b9d827383fbfe7ce509ae331c1f:/wxPython/wx/lib/stattext.py?ds=sidebyside diff --git a/wxPython/wx/lib/stattext.py b/wxPython/wx/lib/stattext.py index 1f47005e36..3bc9a4c483 100644 --- a/wxPython/wx/lib/stattext.py +++ b/wxPython/wx/lib/stattext.py @@ -36,7 +36,7 @@ class GenStaticText(wx.PyControl): wx.PyControl.SetLabel(self, label) # don't check wx.ST_NO_AUTORESIZE yet self.InheritAttributes() - self.SetBestFittingSize(size) + self.SetInitialSize(size) self.Bind(wx.EVT_PAINT, self.OnPaint) if BUFFERED: @@ -56,7 +56,7 @@ class GenStaticText(wx.PyControl): style = self.GetWindowStyleFlag() self.InvalidateBestSize() if not style & wx.ST_NO_AUTORESIZE: - self.SetBestFittingSize(self.GetBestSize()) + self.SetInitialSize(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.SetBestFittingSize(self.GetBestSize()) + self.SetInitialSize(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()