FIX: use StaticBox for background

Change-Id: I2bba259c53eaf987662a97dd93eac4fb8f73d47b
This commit is contained in:
chunmao.guo 2022-08-02 16:32:09 +08:00 committed by Lane.Wei
parent c4ec127b3a
commit a35ecc4fba
8 changed files with 54 additions and 154 deletions

View file

@ -31,6 +31,7 @@ TabCtrl::TabCtrl(wxWindow * parent,
#else
radius = 1;
#endif
border_width = 1;
SetBorderColor(0xcecece);
sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->AddSpacer(10);
@ -251,9 +252,6 @@ void TabCtrl::doRender(wxDC& dc)
{
wxSize size = GetSize();
int states = state_handler.states();
dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
if (sel < 0) { return; }
auto x1 = btns[sel]->GetPosition().x;
@ -262,6 +260,8 @@ void TabCtrl::doRender(wxDC& dc)
const int BS2 = (1 + border_width) / 2;
#if 0
x1 -= TAB_BUTTON_SPACE; x2 += TAB_BUTTON_SPACE;
dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawLine(0, size.y - BS2, x1 - radius + BS2, size.y - BS2);
dc.DrawArc(x1 - radius, size.y, x1, size.y - radius, x1 - radius, size.y - radius);
dc.DrawLine(x1, size.y - radius, x1, radius);
@ -272,6 +272,7 @@ void TabCtrl::doRender(wxDC& dc)
dc.DrawArc(x2, size.y - radius, x2 + radius, size.y, x2 + radius, size.y - radius);
dc.DrawLine(x2 + radius - BS2, size.y - BS2, size.x, size.y - BS2);
#else
dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
dc.DrawLine(0, size.y - BS2, size.x, size.y - BS2);
wxColor c(0x42AE00);
dc.SetPen(wxPen(c, 0));