minor tab drawing improvements
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -85,7 +85,7 @@ static void DrawButtons(wxDC& dc,
|
|||||||
button_state == wxAUI_BUTTON_STATE_PRESSED)
|
button_state == wxAUI_BUTTON_STATE_PRESSED)
|
||||||
{
|
{
|
||||||
dc.SetBrush(wxBrush(wxAuiStepColour(bkcolour, 120)));
|
dc.SetBrush(wxBrush(wxAuiStepColour(bkcolour, 120)));
|
||||||
dc.SetPen(wxPen(wxAuiStepColour(bkcolour, 70)));
|
dc.SetPen(wxPen(wxAuiStepColour(bkcolour, 75)));
|
||||||
|
|
||||||
// draw the background behind the button
|
// draw the background behind the button
|
||||||
dc.DrawRectangle(rect.x, rect.y, 15, 15);
|
dc.DrawRectangle(rect.x, rect.y, 15, 15);
|
||||||
@@ -194,9 +194,9 @@ wxAuiDefaultTabArt::wxAuiDefaultTabArt()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_base_colour = base_colour;
|
m_base_colour = base_colour;
|
||||||
wxColor darker2_colour = wxAuiStepColour(base_colour, 70);
|
wxColor border_colour = wxAuiStepColour(base_colour, 75);
|
||||||
|
|
||||||
m_border_pen = wxPen(darker2_colour);
|
m_border_pen = wxPen(border_colour);
|
||||||
m_base_colour_pen = wxPen(m_base_colour);
|
m_base_colour_pen = wxPen(m_base_colour);
|
||||||
m_base_colour_brush = wxBrush(m_base_colour);
|
m_base_colour_brush = wxBrush(m_base_colour);
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ 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 top_color = wxAuiStepColour(m_base_colour, 90);
|
wxColor top_color = wxAuiStepColour(m_base_colour, 90);
|
||||||
wxColor bottom_color = wxAuiStepColour(m_base_colour, 110);
|
wxColor bottom_color = wxAuiStepColour(m_base_colour, 170);
|
||||||
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
|
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
|
||||||
|
|
||||||
// draw base lines
|
// draw base lines
|
||||||
@@ -354,6 +354,7 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
if (tab_x + clip_width > in_rect.x + in_rect.width)
|
if (tab_x + clip_width > in_rect.x + in_rect.width)
|
||||||
clip_width = (in_rect.x + in_rect.width) - tab_x;
|
clip_width = (in_rect.x + in_rect.width) - tab_x;
|
||||||
|
|
||||||
|
/*
|
||||||
wxPoint clip_points[6];
|
wxPoint clip_points[6];
|
||||||
clip_points[0] = wxPoint(tab_x, tab_y+tab_height-3);
|
clip_points[0] = wxPoint(tab_x, tab_y+tab_height-3);
|
||||||
clip_points[1] = wxPoint(tab_x, tab_y+2);
|
clip_points[1] = wxPoint(tab_x, tab_y+2);
|
||||||
@@ -368,7 +369,12 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
wxRegion clipping_region(WXSIZEOF(clip_points), clip_points);
|
wxRegion clipping_region(WXSIZEOF(clip_points), clip_points);
|
||||||
dc.SetClippingRegion(clipping_region);
|
dc.SetClippingRegion(clipping_region);
|
||||||
#endif // !wxDFB && !wxCocoa
|
#endif // !wxDFB && !wxCocoa
|
||||||
|
*/
|
||||||
|
// since the above code above doesn't play well with WXDFB or WXCOCOA,
|
||||||
|
// we'll just use a rectangle for the clipping region for now --
|
||||||
|
dc.SetClippingRegion(tab_x, tab_y, clip_width+1, tab_height-3);
|
||||||
|
|
||||||
|
|
||||||
wxPoint border_points[6];
|
wxPoint border_points[6];
|
||||||
border_points[0] = wxPoint(tab_x, tab_y+tab_height-4);
|
border_points[0] = wxPoint(tab_x, tab_y+tab_height-4);
|
||||||
border_points[1] = wxPoint(tab_x, tab_y+2);
|
border_points[1] = wxPoint(tab_x, tab_y+2);
|
||||||
@@ -390,12 +396,12 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
wxRect r(tab_x, tab_y, tab_width, tab_height);
|
wxRect r(tab_x, tab_y, tab_width, tab_height);
|
||||||
dc.SetPen(m_base_colour_pen);
|
dc.SetPen(m_base_colour_pen);
|
||||||
dc.SetBrush(m_base_colour_brush);
|
dc.SetBrush(m_base_colour_brush);
|
||||||
dc.DrawRectangle(r.x, r.y, r.width, r.height);
|
dc.DrawRectangle(r.x+1, r.y+1, r.width-1, r.height-4);
|
||||||
|
|
||||||
// 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+1, r.width-3, r.height);
|
dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height-4);
|
||||||
|
|
||||||
// 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);
|
||||||
@@ -431,7 +437,7 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
|
|
||||||
// -- draw top 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 = wxAuiStepColour(top_color, 106);
|
wxColor bottom_color = wxAuiStepColour(top_color, 160);
|
||||||
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
|
||||||
|
|
||||||
r.y += r.height;
|
r.y += r.height;
|
||||||
@@ -476,7 +482,7 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
|
|||||||
// draw bitmap
|
// draw bitmap
|
||||||
dc.DrawBitmap(bitmap,
|
dc.DrawBitmap(bitmap,
|
||||||
bitmap_offset,
|
bitmap_offset,
|
||||||
drawn_tab_yoff + (drawn_tab_height/2) - (bitmap.GetHeight()/2) + 1,
|
drawn_tab_yoff + (drawn_tab_height/2) - (bitmap.GetHeight()/2),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
text_offset = bitmap_offset + bitmap.GetWidth();
|
text_offset = bitmap_offset + bitmap.GetWidth();
|
||||||
@@ -772,7 +778,7 @@ wxAuiSimpleTabArt::wxAuiSimpleTabArt()
|
|||||||
|
|
||||||
wxColour base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
wxColour base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
||||||
|
|
||||||
wxColour background_colour = wxAuiStepColour(base_colour, 95);
|
wxColour background_colour = base_colour;
|
||||||
wxColour normaltab_colour = base_colour;
|
wxColour normaltab_colour = base_colour;
|
||||||
wxColour selectedtab_colour = *wxWHITE;
|
wxColour selectedtab_colour = *wxWHITE;
|
||||||
|
|
||||||
|
@@ -209,7 +209,7 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
|
|||||||
|
|
||||||
m_base_colour = base_colour;
|
m_base_colour = base_colour;
|
||||||
wxColor darker1_colour = wxAuiStepColour(base_colour, 85);
|
wxColor darker1_colour = wxAuiStepColour(base_colour, 85);
|
||||||
wxColor darker2_colour = wxAuiStepColour(base_colour, 70);
|
wxColor darker2_colour = wxAuiStepColour(base_colour, 75);
|
||||||
wxColor darker3_colour = wxAuiStepColour(base_colour, 60);
|
wxColor darker3_colour = wxAuiStepColour(base_colour, 60);
|
||||||
wxColor darker4_colour = wxAuiStepColour(base_colour, 50);
|
wxColor darker4_colour = wxAuiStepColour(base_colour, 50);
|
||||||
wxColor darker5_colour = wxAuiStepColour(base_colour, 40);
|
wxColor darker5_colour = wxAuiStepColour(base_colour, 40);
|
||||||
|
Reference in New Issue
Block a user