Revert "Tab improvements (#5210)"

Causing regression bugs in high DPI

This reverts commit 872f729d75.
This commit is contained in:
SoftFever 2024-06-16 09:47:12 +08:00
parent 54653ea316
commit 4590c765c6

View file

@ -106,10 +106,6 @@ 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});
@ -308,7 +304,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 = wxColour("#009688"); // ORCA: Controls under line color on selected tab
wxColour c(0xf2, 0x75, 0x4e, 0xff);
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);