From 377ffbd21d372193c8fa0d05dc02d6f606a78a35 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Fri, 31 May 2019 00:58:50 +0900 Subject: Fix build without feature.tabbar Change-Id: I0891f8f6054382407f5ce2fdb3ead0203d255945 Reviewed-by: Richard Moe Gustavsen --- src/plugins/styles/mac/qmacstyle_mac.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/plugins') 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(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(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; -- cgit v1.2.3