X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/254a3429530c72810c6e713f15c15b0420175b54..7749035c4edc84ff7ad722c0de8ff1679b68976f:/src/aui/dockart.cpp diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index 44c84e3b49..f2bfb08188 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -103,7 +103,7 @@ wxColor wxAuiStepColour(const wxColor& c, int ialpha) g = wxAuiBlendColour(g, bg, alpha); b = wxAuiBlendColour(b, bg, alpha); - return wxColour((int)r, (int)g, (int)b); + return wxColour((unsigned char)r, (unsigned char)g, (unsigned char)b); } @@ -153,9 +153,9 @@ static void DrawGradientRectangle(wxDC& dc, 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; + r = start_color.Red() + (high <= 0 ? 0 : (((i*rd*100)/high)/100)); + g = start_color.Green() + (high <= 0 ? 0 : (((i*gd*100)/high)/100)); + b = start_color.Blue() + (high <= 0 ? 0 : (((i*bd*100)/high)/100)); wxPen p(wxColor((unsigned char)r, (unsigned char)g, @@ -207,6 +207,15 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt() wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif + // the base_colour is too pale to use as our base colour, + // so darken it a bit -- + if ((255-base_colour.Red()) + + (255-base_colour.Green()) + + (255-base_colour.Blue()) < 60) + { + base_colour = wxAuiStepColour(base_colour, 92); + } + m_base_colour = base_colour; wxColor darker1_colour = wxAuiStepColour(base_colour, 85); wxColor darker2_colour = wxAuiStepColour(base_colour, 75);