From dadacb5ec792bfdd5402824c042e8b5b5786dbd1 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 7 Nov 2006 10:28:06 +0000 Subject: [PATCH] streamlined gradients git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/dockart.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index a36a14b4b7..7ce4ba7e1a 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -109,9 +109,12 @@ static void DrawGradientRectangle(wxDC& dc, for (int i = 0; i <= high; ++i) { - int r = start_color.Red() + ((i*rd*100)/high)/100; - int g = start_color.Green() + ((i*gd*100)/high)/100; - int b = start_color.Blue() + ((i*bd*100)/high)/100; + int r,g,b; + + + r = start_color.Red() + ((i*rd*100)/high)/100; + g = start_color.Green() + ((i*gd*100)/high)/100; + b = start_color.Blue() + ((i*bd*100)/high)/100; wxPen p(wxColor((unsigned char)r, (unsigned char)g, @@ -143,11 +146,11 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt() wxColor darker4_colour = StepColour(base_colour, 50); wxColor darker5_colour = StepColour(base_colour, 40); - m_active_caption_colour = LightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); - m_active_caption_gradient_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); + m_active_caption_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); + m_active_caption_gradient_colour = LightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - m_inactive_caption_colour = StepColour(darker1_colour, 80); - m_inactive_caption_gradient_colour = darker1_colour; + m_inactive_caption_colour = darker1_colour; + m_inactive_caption_gradient_colour = StepColour(base_colour, 97); m_inactive_caption_text_colour = *wxBLACK; #ifdef __WXMAC__ @@ -473,25 +476,27 @@ void wxAuiDefaultDockArt::DrawCaptionBackground(wxDC& dc, const wxRect& rect, bo // on mac the gradients are expected to become darker from the top #ifdef __WXMAC__ DrawGradientRectangle(dc, rect, - m_active_caption_gradient_colour, m_active_caption_colour, + m_active_caption_gradient_colour, m_gradient_type); #else + // on other platforms, active gradients become lighter at the top DrawGradientRectangle(dc, rect, - m_active_caption_colour, m_active_caption_gradient_colour, + m_active_caption_colour, m_gradient_type); #endif } else { - // on mac the gradients are expected to become darker from the top #ifdef __WXMAC__ + // on mac the gradients are expected to become darker from the top DrawGradientRectangle(dc, rect, m_inactive_caption_gradient_colour, m_inactive_caption_colour, m_gradient_type); #else + // on other platforms, inactive gradients become lighter at the bottom DrawGradientRectangle(dc, rect, m_inactive_caption_colour, m_inactive_caption_gradient_colour,