1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +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;
}
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();
}
});