From 84554063f1740cf6882b040c913adabf41e7262d Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Wed, 3 Mar 2010 18:46:21 +0000 Subject: [PATCH] - MGR: Use theme colors when setting up the color scheme for list items. The previous use of gray just happened to be the same color as the deselected but highlighted list item which caused the 'gray' backgrounded items to display a white background after Windows inverted the color for highlighting. By using theme colors we avoid having to worry about such things. clientgui/ BOINCBaseView.cpp DlgEventLog.cpp svn path=/trunk/boinc/; revision=20780 --- checkin_notes | 12 ++++++++++++ clientgui/BOINCBaseView.cpp | 12 ++++++++++-- clientgui/DlgEventLog.cpp | 24 ++++++++++++++++++++---- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 90c4dd7a6d..cf0c92a57d 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1561,3 +1561,15 @@ Charlie 2 Mar 2010 clientgui/ DlgItemProperties.cpp, .h + +Rom 3 Mar 2010 + - MGR: Use theme colors when setting up the color scheme for list items. + The previous use of gray just happened to be the same color as the + deselected but highlighted list item which caused the 'gray' + backgrounded items to display a white background after Windows + inverted the color for highlighting. By using theme colors we avoid + having to worry about such things. + + clientgui/ + BOINCBaseView.cpp + DlgEventLog.cpp diff --git a/clientgui/BOINCBaseView.cpp b/clientgui/BOINCBaseView.cpp index 60a7742546..b7c18e1098 100644 --- a/clientgui/BOINCBaseView.cpp +++ b/clientgui/BOINCBaseView.cpp @@ -123,8 +123,16 @@ CBOINCBaseView::CBOINCBaseView( m_SortArrows->Add( wxIcon( sortdescending_xpm ) ); m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL); - m_pWhiteBackgroundAttr = new wxListItemAttr(*wxBLACK, *wxWHITE, wxNullFont); - m_pGrayBackgroundAttr = new wxListItemAttr(*wxBLACK, wxColour(240, 240, 240), wxNullFont); + m_pWhiteBackgroundAttr = new wxListItemAttr( + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), + wxNullFont + ); + m_pGrayBackgroundAttr = new wxListItemAttr( + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), + wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), + wxNullFont + ); } diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 6582be18b0..646551ce16 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -168,10 +168,26 @@ bool CDlgEventLog::Create( wxWindow* WXUNUSED(parent), wxWindowID id, const wxSt m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); - m_pMessageInfoAttr = new wxListItemAttr(*wxBLACK, *wxWHITE, wxNullFont); - m_pMessageErrorAttr = new wxListItemAttr(*wxRED, *wxWHITE, wxNullFont); - m_pMessageInfoGrayAttr = new wxListItemAttr(*wxBLACK, wxColour(240, 240, 240), wxNullFont); - m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); + m_pMessageInfoAttr = new wxListItemAttr( + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), + wxNullFont + ); + m_pMessageErrorAttr = new wxListItemAttr( + *wxRED, + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), + wxNullFont + ); + m_pMessageInfoGrayAttr = new wxListItemAttr( + wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), + wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), + wxNullFont + ); + m_pMessageErrorGrayAttr = new wxListItemAttr( + *wxRED, + wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), + wxNullFont + ); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this);