TabBar: Fix calculating pinned tab width

It takes into account cornerWidth and calculates correct value with RTL.

For the last time now hopefully.
remotes/origin/Falkon/3.0
David Rosca 8 years ago
parent c506283534
commit 2283b41fdc
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
  1. 8
      src/lib/tabwidget/tabbar.cpp

@ -464,10 +464,10 @@ void TabBar::tabInserted(int index)
return;
}
QWidget *w = tabButton(0, iconButtonPosition());
const QRect r = tabRect(0);
if (w && r.isValid()) {
const int padding = w->geometry().x() - r.x();
tabMetrics()->setPinnedWidth(iconButtonSize().width() + padding * 2);
if (w && w->parentWidget()) {
const QRect wg = w->parentWidget()->geometry();
const QRect wr = QStyle::visualRect(layoutDirection(), wg, w->geometry());
tabMetrics()->setPinnedWidth(iconButtonSize().width() + wr.x() * 2);
setUpLayout();
}
});

Loading…
Cancel
Save