]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/renderer.cpp
Forward port of my recent changes in the 2.8 branch:
[wxWidgets.git] / src / mac / carbon / renderer.cpp
index 849f287b025c2f6f4a99197db6257db66dab3cbe..abac02650a74843c33d285c41f62961969841814 100644 (file)
@@ -370,16 +370,16 @@ wxRendererMac::DrawItemSelectionRect(wxWindow *win,
                                      const wxRect& rect,
                                      int flags )
 {
+    if ( !(flags & wxCONTROL_SELECTED) )
+        return;
+
     RGBColor selColor;
-    if (flags & wxCONTROL_SELECTED)
-    {
-        if (flags & wxCONTROL_FOCUSED)
-            GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &selColor);
-        else
-            GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &selColor);
-    }
+    GetThemeBrushAsColor(flags & wxCONTROL_FOCUSED
+                            ? kThemeBrushAlternatePrimaryHighlightColor
+                            : kThemeBrushSecondaryHighlightColor,
+                         32, true, &selColor);
 
-    wxBrush selBrush = wxBrush( wxColour( selColor.red, selColor.green, selColor.blue ), wxSOLID );
+    wxBrush selBrush(selColor);
 
     dc.SetPen( *wxTRANSPARENT_PEN );
     dc.SetBrush( selBrush );