1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

TabBar: Fix calculating pinned tab width

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

For the last time now hopefully.
This commit is contained in:
David Rosca 2018-02-06 17:33:18 +01:00
parent c506283534
commit 2283b41fdc
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

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