summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qbc.io>2019-05-31 00:58:50 +0900
committerTasuku Suzuki <tasuku.suzuki@qbc.io>2019-07-02 16:15:43 +0900
commit377ffbd21d372193c8fa0d05dc02d6f606a78a35 (patch)
tree3fd076a1a21e4160e993e65cbac262e864e6642c /src/plugins/styles
parentb727d2f0e152243c1c46e2916dcb3c8481f03ebe (diff)
Fix build without feature.tabbar
Change-Id: I0891f8f6054382407f5ce2fdb3ead0203d255945 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 675f37c4c7..85bf71be3f 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -278,6 +278,7 @@ static const qreal titleBarButtonSpacing = 8;
// hovered: tab is hovered
bool isDarkMode() { return qt_mac_applicationIsInDarkMode(); }
+#if QT_CONFIG(tabbar)
static const QColor lightTabBarTabBackgroundActive(190, 190, 190);
static const QColor darkTabBarTabBackgroundActive(38, 38, 38);
static const QColor tabBarTabBackgroundActive() { return isDarkMode() ? darkTabBarTabBackgroundActive : lightTabBarTabBackgroundActive; }
@@ -323,6 +324,7 @@ static const QColor tabBarCloseButtonCrossSelected(115, 115, 115);
static const int closeButtonSize = 14;
static const qreal closeButtonCornerRadius = 2.0;
+#endif // QT_CONFIG(tabbar)
static const int headerSectionArrowHeight = 6;
static const int headerSectionSeparatorInset = 2;
@@ -467,6 +469,7 @@ static bool isInMacUnifiedToolbarArea(QWindow *window, int windowY)
}
+#if QT_CONFIG(tabbar)
static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pressed, bool documentMode)
{
p->setRenderHints(QPainter::Antialiasing);
@@ -504,7 +507,6 @@ static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pres
p->drawLine(margin, height - margin, width - margin, margin);
}
-#if QT_CONFIG(tabbar)
QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
{
const auto tabDirection = QMacStylePrivate::tabDirection(shape);
@@ -2131,10 +2133,12 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
int ret = 0;
switch (metric) {
+#if QT_CONFIG(tabbar)
case PM_TabCloseIndicatorWidth:
case PM_TabCloseIndicatorHeight:
ret = closeButtonSize;
break;
+#endif
case PM_ToolBarIconSize:
ret = proxy()->pixelMetric(PM_LargeIconSize);
break;
@@ -2291,10 +2295,12 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 16;
break;
case QStyleHelper::SizeDefault:
+#if QT_CONFIG(tabbar)
const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(opt);
if (tb && tb->documentMode)
ret = 30;
else
+#endif
ret = QCommonStyle::pixelMetric(metric, opt, widget);
break;
}
@@ -3319,6 +3325,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
} break;
case PE_FrameStatusBarItem:
break;
+#if QT_CONFIG(tabbar)
case PE_IndicatorTabClose: {
// Make close button visible only on the hovered tab.
QTabBar *tabBar = qobject_cast<QTabBar*>(w->parentWidget());
@@ -3343,6 +3350,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
}
} break;
+#endif // QT_CONFIG(tabbar)
case PE_PanelStatusBar: {
// Fill the status bar with the titlebar gradient.
QLinearGradient linearGrad;