mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
TabBar: Don't use ProxyStyle directly
This commit is contained in:
parent
0723deb2fc
commit
a0b84a5cd3
|
@ -25,7 +25,6 @@
|
|||
#include "tabbedwebview.h"
|
||||
#include "mainapplication.h"
|
||||
#include "pluginproxy.h"
|
||||
#include "proxystyle.h"
|
||||
#include "iconprovider.h"
|
||||
|
||||
#include <QMenu>
|
||||
|
@ -150,11 +149,9 @@ void TabBar::closeAllButCurrent()
|
|||
|
||||
QSize TabBar::tabSizeHint(int index, bool fast) const
|
||||
{
|
||||
if (!isVisible() || !mApp->proxyStyle()) {
|
||||
if (!isVisible()) {
|
||||
// Don't calculate it when tabbar is not visible
|
||||
// It produces invalid size anyway
|
||||
//
|
||||
// We also need ProxyStyle to be set before calculating minimum sizes for tabs
|
||||
return QSize(-1, -1);
|
||||
}
|
||||
|
||||
|
@ -266,13 +263,12 @@ QSize TabBar::tabSizeHint(int index, bool fast) const
|
|||
|
||||
int TabBar::comboTabBarPixelMetric(ComboTabBar::SizeType sizeType) const
|
||||
{
|
||||
if (!mApp->proxyStyle() || !isVisible()) {
|
||||
if (!isVisible())
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (sizeType) {
|
||||
case ComboTabBar::PinnedTabWidth:
|
||||
return 16 + mApp->proxyStyle()->pixelMetric(QStyle::PM_TabBarTabHSpace, 0, this);
|
||||
return 16 + style()->pixelMetric(QStyle::PM_TabBarTabHSpace, 0, this);
|
||||
|
||||
case ComboTabBar::ActiveTabMinimumWidth:
|
||||
case ComboTabBar::NormalTabMinimumWidth:
|
||||
|
|
Loading…
Reference in New Issue
Block a user