FIX: TabCtrl new style of page indicator

Change-Id: I5d6b088a8161e4373ec3dcff3fac17933861b155
This commit is contained in:
chunmao.guo 2022-08-01 15:30:48 +08:00 committed by Lane.Wei
parent e850f83030
commit 90b745c4d5
1 changed files with 13 additions and 1 deletions

View File

@ -26,7 +26,11 @@ TabCtrl::TabCtrl(wxWindow * parent,
long style)
: StaticBox(parent, id, pos, size, style)
{
#if 0
radius = 5;
#else
radius = 1;
#endif
SetBorderColor(0xcecece);
sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->AddSpacer(10);
@ -254,9 +258,10 @@ void TabCtrl::doRender(wxDC& dc)
auto x1 = btns[sel]->GetPosition().x;
auto x2 = x1 + btns[sel]->GetSize().x;
x1 -= TAB_BUTTON_SPACE; x2 += TAB_BUTTON_SPACE;
const int BS = border_width / 2;
const int BS2 = (1 + border_width) / 2;
#if 0
x1 -= TAB_BUTTON_SPACE; x2 += TAB_BUTTON_SPACE;
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);
@ -266,6 +271,13 @@ void TabCtrl::doRender(wxDC& dc)
dc.DrawLine(x2, radius, x2, size.y - radius);
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.DrawLine(0, size.y - BS2, size.x, size.y - BS2);
wxColor c(0x42AE00);
dc.SetPen(wxPen(c, 0));
dc.SetBrush(c);
dc.DrawRoundedRectangle(x1 - radius, size.y - BS2 - border_width * 3, x2 + radius * 2 - x1, border_width * 3, radius);
#endif
}
bool TabCtrl::sendTabCtrlEvent(bool changing)