X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2593f033843619e5a295b42fc927de6eb77f67ed..b916f809336755620b010293637b12763f01455d:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index edfa111639..2a2e7c814d 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -670,12 +670,16 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, wxGetOsVersion( &major, &minor ); if (style & wxTR_HAS_BUTTONS) style |= wxTR_MAC_BUTTONS; + if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS; style &= ~wxTR_LINES_AT_ROOT; style |= wxTR_NO_LINES; if (major < 10) style |= wxTR_ROW_LINES; + if (major >= 10) + style |= wxTR_AQUA_BUTTONS; #endif + wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name ); @@ -1988,28 +1992,55 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level else if (HasFlag(wxTR_TWIST_BUTTONS)) { // draw the twisty button here - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*m_hilightBrush); - + wxPoint button[3]; - - if (item->IsExpanded()) + dc.SetBrush(*m_hilightBrush); + + if (HasFlag(wxTR_AQUA_BUTTONS)) { - button[0].x = x-5; - button[0].y = y_mid-2; - button[1].x = x+5; - button[1].y = y_mid-2; - button[2].x = x; - button[2].y = y_mid+3; + dc.SetPen(*wxTRANSPARENT_PEN); + + if (item->IsExpanded()) + { + button[0].x = x-6; + button[0].y = y_mid-2; + button[1].x = x+6; + button[1].y = y_mid-2; + button[2].x = x; + button[2].y = y_mid+7; + } + else + { + button[0].y = y_mid-6; + button[0].x = x-2; + button[1].y = y_mid+6; + button[1].x = x-2; + button[2].y = y_mid; + button[2].x = x+7; + } } else { - button[0].y = y_mid-5; - button[0].x = x-2; - button[1].y = y_mid+5; - button[1].x = x-2; - button[2].y = y_mid; - button[2].x = x+3; + dc.SetPen(*wxBLACK_PEN); + + if (item->IsExpanded()) + { + button[0].x = x-5; + button[0].y = y_mid-2; + button[1].x = x+5; + button[1].y = y_mid-2; + button[2].x = x; + button[2].y = y_mid+3; + } + else + { + button[0].y = y_mid-5; + button[0].x = x-2; + button[1].y = y_mid+5; + button[1].x = x-2; + button[2].y = y_mid; + button[2].x = x+3; + } } dc.DrawPolygon(3, button);