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:
parent
ec84df81e0
commit
e4c2194177
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user