trying to fix the generic tree appearance problems

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-08-11 00:38:32 +00:00
parent bc51e42e8b
commit 0e7761fade
2 changed files with 9 additions and 5 deletions

View File

@@ -209,18 +209,22 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win),
// white background // white background
dc.SetPen(*wxGREY_PEN); dc.SetPen(*wxGREY_PEN);
dc.SetBrush(*wxWHITE_BRUSH); dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(rect.Deflate(1, 2)); dc.DrawRectangle(rect);
// black lines // black lines
const wxCoord xMiddle = rect.x + rect.width/2; const wxCoord xMiddle = rect.x + rect.width/2;
const wxCoord yMiddle = rect.y + rect.height/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.SetPen(*wxBLACK_PEN);
dc.DrawLine(xMiddle - 2, yMiddle, xMiddle + 3, yMiddle); dc.DrawLine(xMiddle - halfWidth, yMiddle, xMiddle + halfWidth, yMiddle);
if ( !(flags & wxCONTROL_EXPANDED) ) if ( !(flags & wxCONTROL_EXPANDED) )
{ {
// turn "-" into "+" // 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);
} }
} }

View File

@@ -2317,8 +2317,8 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
} }
else // no custom buttons else // no custom buttons
{ {
static const int wImage = 10; static const int wImage = 9;
static const int hImage = 12; static const int hImage = 9;
wxRendererNative::Get().DrawTreeItemButton wxRendererNative::Get().DrawTreeItemButton
( (