X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/58dbf9d0a22bc3a7d6d90a5fb1d53d2c6a479eaa..68fc5c8025e38b9d827383fbfe7ce509ae331c1f:/wxPython/wx/lib/customtreectrl.py diff --git a/wxPython/wx/lib/customtreectrl.py b/wxPython/wx/lib/customtreectrl.py index 8d6ad6b4d4..d987320ca0 100644 --- a/wxPython/wx/lib/customtreectrl.py +++ b/wxPython/wx/lib/customtreectrl.py @@ -4296,7 +4296,12 @@ class CustomTreeCtrl(wx.PyScrolledWindow): elif self._vistaselection: self.DrawVistaRectangle(dc, itemrect, self._hasFocus) else: - dc.DrawRectangleRect(itemrect) + if wx.Platform in ["__WXGTK2__", "__WXMAC__"]: + flags = wx.CONTROL_SELECTED + if self._hasFocus: flags = flags | wx.CONTROL_FOCUSED + wx.RendererNative.Get().DrawItemSelectionRect(self, dc, itemrect, flags) + else: + dc.DrawRectangleRect(itemrect) else: @@ -4324,7 +4329,12 @@ class CustomTreeCtrl(wx.PyScrolledWindow): elif self._vistaselection: self.DrawVistaRectangle(dc, itemrect, self._hasFocus) else: - dc.DrawRectangleRect(itemrect) + if wx.Platform in ["__WXGTK2__", "__WXMAC__"]: + flags = wx.CONTROL_SELECTED + if self._hasFocus: flags = flags | wx.CONTROL_FOCUSED + wx.RendererNative.Get().DrawItemSelectionRect(self, dc, itemrect, flags) + else: + dc.DrawRectangleRect(itemrect) # On GTK+ 2, drawing a 'normal' background is wrong for themes that # don't allow backgrounds to be customized. Not drawing the background, @@ -4382,6 +4392,8 @@ class CustomTreeCtrl(wx.PyScrolledWindow): dc.DrawLabel(item.GetText(), textrect) dc.SetTextForeground(foreground) else: + if wx.Platform == "__WXMAC__" and item.IsSelected() and self._hasFocus: + dc.SetTextForeground(wx.WHITE) dc.DrawLabel(item.GetText(), textrect) wnd = item.GetWindow()