corrected wrong tab colors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -308,19 +308,16 @@ void wxAuiDefaultTabArt::DrawBackground(wxDC& dc,
|
|||||||
{
|
{
|
||||||
// draw background
|
// draw background
|
||||||
wxRect r(rect.x, rect.y, rect.width+2, rect.height-3);
|
wxRect r(rect.x, rect.y, rect.width+2, rect.height-3);
|
||||||
wxColor start_colour = StepColour(m_base_colour, 90);
|
wxColor top_color = StepColour(m_base_colour, 90);
|
||||||
wxColor end_colour = StepColour(m_base_colour, 110);
|
wxColor bottom_color = StepColour(m_base_colour, 110);
|
||||||
dc.GradientFillLinear(r, start_colour, end_colour, wxSOUTH);
|
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
|
||||||
|
|
||||||
// draw base lines
|
// draw base lines
|
||||||
int y = rect.GetHeight();
|
int y = rect.GetHeight();
|
||||||
int w = rect.GetWidth();
|
int w = rect.GetWidth();
|
||||||
dc.SetPen(m_border_pen);
|
dc.SetPen(m_border_pen);
|
||||||
dc.DrawLine(0, y-4, w, y-4);
|
dc.SetBrush(m_base_colour_brush);
|
||||||
dc.DrawLine(0, y-1, w, y-1);
|
dc.DrawRectangle(-1, y-4, w+2, 4);
|
||||||
dc.SetPen(wxPen(start_colour));
|
|
||||||
dc.DrawLine(0, y-3, w, y-3);
|
|
||||||
dc.DrawLine(0, y-2, w, y-2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -440,23 +437,24 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
// this white helps fill out the gradient at the top of the tab
|
// this white helps fill out the gradient at the top of the tab
|
||||||
dc.SetPen(*wxWHITE_PEN);
|
dc.SetPen(*wxWHITE_PEN);
|
||||||
dc.SetBrush(*wxWHITE_BRUSH);
|
dc.SetBrush(*wxWHITE_BRUSH);
|
||||||
dc.DrawRectangle(r.x+2, r.y+2, r.width-3, r.height);
|
dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height);
|
||||||
|
|
||||||
// these two points help the rounded corners appear more antialiased
|
// these two points help the rounded corners appear more antialiased
|
||||||
dc.SetPen(m_base_colour_pen);
|
dc.SetPen(m_base_colour_pen);
|
||||||
dc.DrawPoint(r.x+2, r.y+2);
|
dc.DrawPoint(r.x+2, r.y+1);
|
||||||
dc.DrawPoint(r.x+r.width-2, r.y+2);
|
dc.DrawPoint(r.x+r.width-2, r.y+1);
|
||||||
|
|
||||||
// set rectangle down a bit for gradient drawing
|
// set rectangle down a bit for gradient drawing
|
||||||
r.SetHeight(r.GetHeight()/2);
|
r.SetHeight(r.GetHeight()/2);
|
||||||
r.x += 2;
|
r.x += 2;
|
||||||
r.width -= 2;
|
r.width -= 2;
|
||||||
r.y += r.height;
|
r.y += r.height;
|
||||||
|
r.y -= 2;
|
||||||
|
|
||||||
// draw gradient background
|
// draw gradient background
|
||||||
wxColor start_color = StepColour(m_base_colour, 95);
|
wxColor top_color = *wxWHITE;
|
||||||
wxColor end_color = *wxWHITE;
|
wxColor bottom_color = m_base_colour;
|
||||||
dc.GradientFillLinear(r, start_color, end_color, wxNORTH);
|
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -464,22 +462,27 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
|
|
||||||
wxRect r(tab_x, tab_y+1, tab_width, tab_height-3);
|
wxRect r(tab_x, tab_y+1, tab_width, tab_height-3);
|
||||||
|
|
||||||
// draw base background color for inactive tabs
|
|
||||||
dc.SetPen(m_base_colour_pen);
|
|
||||||
dc.SetBrush(m_base_colour_brush);
|
|
||||||
dc.DrawRectangle(r.x, r.y, r.width, r.height);
|
|
||||||
|
|
||||||
// start the gradent up a bit and leave the inside border inset
|
// start the gradent up a bit and leave the inside border inset
|
||||||
// by a pixel for a 3D look. Only the top half of the inactive
|
// by a pixel for a 3D look. Only the top half of the inactive
|
||||||
// tab will have a slight gradient
|
// tab will have a slight gradient
|
||||||
r.x += 2;
|
r.x += 3;
|
||||||
r.width -= 2;
|
r.y++;
|
||||||
|
r.width -= 4;
|
||||||
r.height /= 2;
|
r.height /= 2;
|
||||||
|
r.height--;
|
||||||
// -- draw bottom gradient fill for glossy look
|
|
||||||
|
// -- draw top gradient fill for glossy look
|
||||||
wxColor top_color = m_base_colour;
|
wxColor top_color = m_base_colour;
|
||||||
wxColor bottom_color = StepColour(top_color, 106);
|
wxColor bottom_color = StepColour(top_color, 106);
|
||||||
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
||||||
|
|
||||||
|
r.y += r.height;
|
||||||
|
r.y--;
|
||||||
|
|
||||||
|
// -- draw bottom fill for glossy look
|
||||||
|
top_color = m_base_colour;
|
||||||
|
bottom_color = m_base_colour;
|
||||||
|
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw tab outline
|
// draw tab outline
|
||||||
@@ -491,11 +494,11 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
// this gets rid of the top one of those lines in the tab control
|
// this gets rid of the top one of those lines in the tab control
|
||||||
if (active)
|
if (active)
|
||||||
{
|
{
|
||||||
wxColor start_color = StepColour(m_base_colour, 93);
|
wxColor start_color = m_base_colour;
|
||||||
dc.SetPen(wxPen(start_color));
|
dc.SetPen(m_base_colour_pen);
|
||||||
dc.DrawLine(border_points[0].x,
|
dc.DrawLine(border_points[0].x+1,
|
||||||
border_points[0].y,
|
border_points[0].y,
|
||||||
border_points[5].x+1,
|
border_points[5].x,
|
||||||
border_points[5].y);
|
border_points[5].y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user