]> git.saurik.com Git - wxWidgets.git/commitdiff
trying to fix the generic tree appearance problems
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Aug 2003 00:38:32 +0000 (00:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Aug 2003 00:38:32 +0000 (00:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/renderg.cpp
src/generic/treectlg.cpp

index 9f409c3e9898d2273142869d6a148b83d8547b2a..9e44ad6c5a77b851ba48609971785c21f57ec758 100644 (file)
@@ -209,18 +209,22 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win),
     // white background
     dc.SetPen(*wxGREY_PEN);
     dc.SetBrush(*wxWHITE_BRUSH);
-    dc.DrawRectangle(rect.Deflate(1, 2));
+    dc.DrawRectangle(rect);
 
     // black lines
     const wxCoord xMiddle = rect.x + rect.width/2;
     const wxCoord yMiddle = rect.y + rect.height/2;
 
+    // half of the length of the horz lines in "-" and "+"
+    const wxCoord halfWidth = rect.width/2 - 2;
     dc.SetPen(*wxBLACK_PEN);
-    dc.DrawLine(xMiddle - 2, yMiddle, xMiddle + 3, yMiddle);
+    dc.DrawLine(xMiddle - halfWidth, yMiddle, xMiddle + halfWidth, yMiddle);
     if ( !(flags & wxCONTROL_EXPANDED) )
     {
         // turn "-" into "+"
-        dc.DrawLine(xMiddle, yMiddle - 2, xMiddle, yMiddle + 3);
+        const wxCoord halfHeight = rect.height/2 - 2;
+        dc.DrawLine(xMiddle, yMiddle - halfHeight,
+                    xMiddle, yMiddle + halfHeight);
     }
 }
 
index 11236650e4180964f4194d761a88ca14eb44edc8..6354c38bfe827335b3f922aed0c523df17dbafce 100644 (file)
@@ -2317,8 +2317,8 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
             }
             else // no custom buttons
             {
-                static const int wImage = 10;
-                static const int hImage = 12;
+                static const int wImage = 9;
+                static const int hImage = 9;
 
                 wxRendererNative::Get().DrawTreeItemButton
                                         (