Draw the stripy background on wxMac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,10 +35,10 @@ class wxGenStaticText(wxPyControl):
|
|||||||
font = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT)
|
font = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT)
|
||||||
wxPyControl.SetFont(self, font) # same here
|
wxPyControl.SetFont(self, font) # same here
|
||||||
|
|
||||||
clr = parent.GetBackgroundColour()
|
self.defBackClr = parent.GetBackgroundColour()
|
||||||
if not clr.Ok():
|
if not self.defBackClr.Ok():
|
||||||
clr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE)
|
self.defBackClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_3DFACE)
|
||||||
self.SetBackgroundColour(clr)
|
self.SetBackgroundColour(self.defBackClr)
|
||||||
|
|
||||||
clr = parent.GetForegroundColour()
|
clr = parent.GetForegroundColour()
|
||||||
if not clr.Ok():
|
if not clr.Ok():
|
||||||
@@ -105,7 +105,14 @@ class wxGenStaticText(wxPyControl):
|
|||||||
width, height = self.GetClientSize()
|
width, height = self.GetClientSize()
|
||||||
if not width or not height:
|
if not width or not height:
|
||||||
return
|
return
|
||||||
dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID))
|
|
||||||
|
clr = self.GetBackgroundColour()
|
||||||
|
backBrush = wxBrush(clr, wxSOLID)
|
||||||
|
if wxPlatform == "__WXMAC__" and clr == self.defBackClr:
|
||||||
|
# if colour still the default the use the striped background on Mac
|
||||||
|
backBrush.SetMacTheme(1) # 1 == kThemeBrushDialogBackgroundActive
|
||||||
|
dc.SetBackground(backBrush)
|
||||||
|
|
||||||
dc.SetTextForeground(self.GetForegroundColour())
|
dc.SetTextForeground(self.GetForegroundColour())
|
||||||
dc.Clear()
|
dc.Clear()
|
||||||
dc.SetFont(self.GetFont())
|
dc.SetFont(self.GetFont())
|
||||||
|
Reference in New Issue
Block a user