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

ComboTabBar: Force close button on right side

This mainly applies to macOS where close buttons are normally on left side,
but native macOS tabbar doesn't use icons and it looks wrong with icons.
This commit is contained in:
David Rosca 2018-02-16 11:44:19 +01:00
parent ec84df81e0
commit e4c2194177
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 10 additions and 2 deletions

View File

@ -36,9 +36,17 @@ int ProxyStyle::styleHint(StyleHint hint, const QStyleOption* option, const QWid
case QStyle::SH_TabBar_Alignment:
return Qt::AlignLeft;
default:
return QProxyStyle::styleHint(hint, option, widget, returnData);
case QStyle::SH_TabBar_CloseButtonPosition:
if (qobject_cast<const TabBarHelper*>(widget)) {
return QTabBar::RightSide;
}
break;
default:
break;
}
return QProxyStyle::styleHint(hint, option, widget, returnData);
}
int ProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget) const

View File

@ -760,7 +760,7 @@ QTabBar::ButtonPosition ComboTabBar::iconButtonPosition() const
QTabBar::ButtonPosition ComboTabBar::closeButtonPosition() const
{
return (QTabBar::ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, this);
return (QTabBar::ButtonPosition)style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, 0, m_mainTabBar);
}
QSize ComboTabBar::iconButtonSize() const