From be0d2b4b11ddca09e2222163539bd21430aa30db Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Feb 2008 15:10:13 +0000 Subject: [PATCH] don't hardcode grey/white colours for non-MSW/Mac in InitColours(), use wxSystemSettings for all ports (even if some of them, such as wxGTK, still hardcode white for wxSYS_COLOUR_3DHILIGHT) (replaces patch 1883386) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/statusbr.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index 163c13cab3..9c59dc1ddc 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -81,14 +81,14 @@ bool wxStatusBarGeneric::Create(wxWindow *parent, SetFont(*wxSMALL_FONT); #endif - wxCoord y; - { - // Set the height according to the font and the border size - wxClientDC dc(this); - dc.SetFont(GetFont()); + wxCoord y; + { + // Set the height according to the font and the border size + wxClientDC dc(this); + dc.SetFont(GetFont()); - dc.GetTextExtent(_T("X"), NULL, &y ); - } + dc.GetTextExtent(_T("X"), NULL, &y ); + } int height = (int)( (11*y)/10 + 2*GetBorderY()); SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height); @@ -200,7 +200,7 @@ void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) ) { int width, height; GetClientSize(&width, &height); - + if (GetLayoutDirection() == wxLayout_RightToLeft) { gtk_paint_resize_grip( m_widget->style, @@ -368,23 +368,16 @@ bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const // Initialize colours void wxStatusBarGeneric::InitColours() { - // Shadow colours -#if defined(__WXMSW__) || defined(__WXMAC__) - wxColour mediumShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); - m_mediumShadowPen = wxPen(mediumShadowColour, 1, wxSOLID); - - wxColour hilightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT)); - m_hilightPen = wxPen(hilightColour, 1, wxSOLID); -#elif defined(__WXPM__) +#if defined(__WXPM__) m_mediumShadowPen = wxPen(wxColour(127, 127, 127), 1, wxSOLID); m_hilightPen = *wxWHITE_PEN; SetBackgroundColour(*wxLIGHT_GREY); SetForegroundColour(*wxBLACK); -#else - m_mediumShadowPen = *wxGREY_PEN; - m_hilightPen = *wxWHITE_PEN; -#endif +#else // !__WXPM__ + m_mediumShadowPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); + m_hilightPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT)); +#endif // __WXPM__/!__WXPM__ } // Responds to colour changes, and passes event on to children.