Tab improvements (#5210)
* Update selected tab underline color * Disable using bold font for Selected tab * Revert changes * Calculate tab width from bold font to fix tab position changes
This commit is contained in:
parent
423f557c34
commit
872f729d75
1 changed files with 5 additions and 1 deletions
|
@ -106,6 +106,10 @@ int TabCtrl::AppendItem(const wxString &item,
|
|||
btn->SetBackgroundColor(StateColor());
|
||||
btn->SetCornerRadius(0);
|
||||
btn->SetPaddingSize({TAB_BUTTON_PADDING});
|
||||
wxClientDC dc(this); // ORCA calculate tab width from bold font to prevent tab movements on tab change
|
||||
dc.SetFont(this->bold);
|
||||
btn->SetMinSize(wxSize(dc.GetTextExtent(item).x + TAB_BUTTON_PADDING_X * 2, btn->GetSize().GetHeight()));
|
||||
dc.Clear();
|
||||
btns.push_back(btn);
|
||||
if (btns.size() > 1)
|
||||
sizer->GetItem(sizer->GetItemCount() - 1)->SetMinSize({0, 0});
|
||||
|
@ -304,7 +308,7 @@ void TabCtrl::doRender(wxDC& dc)
|
|||
#else
|
||||
dc.SetPen(wxPen(border_color.colorForStates(states), border_width));
|
||||
dc.DrawLine(0, size.y - BS2, size.x, size.y - BS2);
|
||||
wxColour c(0xf2, 0x75, 0x4e, 0xff);
|
||||
wxColour c = wxColour("#009688"); // ORCA: Controls under line color on selected tab
|
||||
dc.SetPen(wxPen(c, 1));
|
||||
dc.SetBrush(c);
|
||||
dc.DrawRoundedRectangle(x1 - radius, size.y - BS2 - border_width * 3, x2 + radius * 2 - x1, border_width * 3, radius);
|
||||
|
|
Loading…
Reference in a new issue