X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cac09ce8b7f519ef9c9b414359716a472ba3ef4c..ac16633fdcfbd3f00d8bf1601a878819d6c20546:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 4c0d7d69fe..5baa32ad7f 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -877,10 +877,6 @@ wxGenericTreeItem::DoCalculateSize(wxGenericTreeCtrl* control, else state_w += MARGIN_BETWEEN_IMAGE_AND_TEXT; } - else - { - state = wxTREE_ITEMSTATE_NONE; - } } m_height = (image_h > text_h) ? image_h : text_h; @@ -2465,6 +2461,7 @@ int wxGenericTreeCtrl::GetLineHeight(wxGenericTreeItem *item) const void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) { item->SetFont(this, dc); + item->CalculateSize(this, dc); wxCoord text_h = item->GetTextHeight(); @@ -2535,9 +2532,6 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) x=0; GetVirtualSize(&w, &h); wxRect rect( x, item->GetY()+offset, w, total_h-offset); -#if !defined(__WXGTK20__) && !defined(__WXMAC__) - dc.DrawRectangle(rect); -#else if (!item->IsSelected()) { dc.DrawRectangle(rect); @@ -2557,9 +2551,8 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) wxRendererNative::Get(). DrawItemSelectionRect(this, dc, rect, flags); } -#endif } - else + else // no full row highlight { if ( item->IsSelected() && (state != wxTREE_ITEMSTATE_NONE || image != NO_IMAGE) ) @@ -2593,14 +2586,11 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) { wxRect rect( item->GetX()-2, item->GetY()+offset, item->GetWidth()+2, total_h-offset ); -#if !defined(__WXGTK20__) && !defined(__WXMAC__) - dc.DrawRectangle( rect ); -#else if ( hasBgColour ) { dc.DrawRectangle( rect ); } - else + else // no specific background colour { rect.x -= 1; rect.width += 2; @@ -2613,7 +2603,6 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) wxRendererNative::Get(). DrawItemSelectionRect(this, dc, rect, flags); } -#endif } } @@ -3945,7 +3934,7 @@ wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) return wxListBox::GetClassDefaultAttributes(variant); #else wxVisualAttributes attr; - attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); + attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT); attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX); attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); return attr;