diff options
Diffstat (limited to 'src/gui/widgets/qtabbar.cpp')
-rw-r--r-- | src/gui/widgets/qtabbar.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index d03a2f4..8aaaade 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE + inline static bool verticalTabs(QTabBar::Shape shape) { return shape == QTabBar::RoundedWest @@ -95,9 +96,20 @@ void QTabBarPrivate::updateMacBorderMetrics() metrics.left = 0; metrics.right = 0; qt_mac_updateContentBorderMetricts(window, metrics); - - // hide the base line separator if the tabs have docuemnt mode enabled (Cocoa) - qt_mac_showBaseLineSeparator(window, !documentMode); +#if QT_MAC_USE_COCOA + // In Cocoa we need to keep track of the drawRect method. + // If documentMode is enabled we need to change it, unless + // a toolbar is present. + // Notice that all the information is kept in the window, + // that's why we get the private widget for it instead of + // the private widget for this widget. + QWidgetPrivate *privateWidget = qt_widget_private(q->window()); + if(privateWidget) + privateWidget->changeMethods = documentMode; + // Since in Cocoa there is no simple way to remove the baseline, so we just ask the + // top level to do the magic for us. + privateWidget->syncUnifiedMode(); +#endif // QT_MAC_USE_COCOA } #endif } @@ -2193,6 +2205,7 @@ bool QTabBar::documentMode() const void QTabBar::setDocumentMode(bool enabled) { Q_D(QTabBar); + d->documentMode = enabled; d->updateMacBorderMetrics(); } |