Use the same selection highlight and text colors as native list/tree controls (i.e. Finder) do. Also, for wxTreeCtrl, enable wxTR_FULL_ROW_HIGHLIGHT when the default style is used, again to match OS LNF.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2006-10-24 00:23:37 +00:00
parent 2f483a69c2
commit 4b8fa6349a
2 changed files with 52 additions and 23 deletions

View File

@@ -1380,7 +1380,11 @@ bool wxListLineData::SetAttributes(wxDC *dc,
// arithmetics on wxColour, unfortunately)
wxColour colText;
if ( highlighted )
#ifdef __WXMAC__
colText = *wxWHITE;
#else
colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
#endif
else if ( attr && attr->HasTextColour() )
colText = attr->GetTextColour();
else
@@ -2182,23 +2186,39 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent,
{
Init();
#ifdef __WXMAC__
// OS X sel item highlight color differs from text highlight color, which is
// what wxSYS_COLOUR_HIGHLIGHT returns.
RGBColor hilight;
GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &hilight);
m_highlightBrush = new wxBrush( wxColour(hilight.red, hilight.green, hilight.blue ), wxSOLID );
#else
m_highlightBrush = new wxBrush
(
(
wxSystemSettings::GetColour
(
wxSYS_COLOUR_HIGHLIGHT
),
wxSOLID
);
);
#endif
#ifdef __WXMAC__
// on Mac, this color also differs from the wxSYS_COLOUR_BTNSHADOW, enough to be noticable.
// I don't know if BTNSHADOW is appropriate in other contexts, so I'm just changing it here.
GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &hilight);
m_highlightUnfocusedBrush = new wxBrush( wxColour(hilight.red, hilight.green, hilight.blue ), wxSOLID );
#else
m_highlightUnfocusedBrush = new wxBrush
(
wxSystemSettings::GetColour
(
wxSYS_COLOUR_BTNSHADOW
),
wxSOLID
);
(
wxSystemSettings::GetColour
(
wxSYS_COLOUR_BTNSHADOW
),
wxSOLID
);
#endif
SetScrollbars( 0, 0, 0, 0, 0, 0 );