Changeset 846 for trunk/src/gui/widgets/qtabbar.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/widgets/qtabbar.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 74 74 QT_BEGIN_NAMESPACE 75 75 76 76 77 inline static bool verticalTabs(QTabBar::Shape shape) 77 78 { … … 100 101 metrics.right = 0; 101 102 qt_mac_updateContentBorderMetricts(window, metrics); 102 103 // hide the base line separator if the tabs have docuemnt mode enabled (Cocoa) 104 qt_mac_showBaseLineSeparator(window, !documentMode); 103 #if QT_MAC_USE_COCOA 104 // In Cocoa we need to keep track of the drawRect method. 105 // If documentMode is enabled we need to change it, unless 106 // a toolbar is present. 107 // Notice that all the information is kept in the window, 108 // that's why we get the private widget for it instead of 109 // the private widget for this widget. 110 QWidgetPrivate *privateWidget = qt_widget_private(q->window()); 111 if(privateWidget) 112 privateWidget->changeMethods = documentMode; 113 // Since in Cocoa there is no simple way to remove the baseline, so we just ask the 114 // top level to do the magic for us. 115 privateWidget->syncUnifiedMode(); 116 #endif // QT_MAC_USE_COCOA 105 117 } 106 118 #endif … … 620 632 } 621 633 622 void QTabBarPrivate::layoutWidgets(int index)634 void QTabBarPrivate::layoutWidgets(int ) 623 635 { 624 636 Q_Q(QTabBar); 625 int start = 0; 626 int end = q->count(); 627 if (index != -1) { 628 start = qMax(index, 0); 629 end = qMin(end, start + 1); 630 } 631 for (int i = start; i < end; ++i) { 637 for (int i = start; i < q->count(); ++i) { 632 638 layoutTab(i); 633 639 } … … 1211 1217 d->makeVisible(index); 1212 1218 d->tabList[index].lastTab = oldIndex; 1213 d->layoutWidgets(oldIndex); 1214 d->layoutWidgets(index); 1219 if (oldIndex >= 0 && oldIndex < count()) 1220 d->layoutTab(oldIndex); 1221 d->layoutTab(index); 1222 #ifndef QT_NO_ACCESSIBILITY 1223 if (QAccessible::isActive()) { 1224 QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus); 1225 QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection); 1226 } 1227 #endif 1215 1228 #ifdef QT3_SUPPORT 1216 1229 emit selected(index); … … 1987 2000 Q_D(QTabBar); 1988 2001 if (event->type() == QEvent::StyleChange) { 1989 d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); 2002 if (!d->elideModeSetByUser) 2003 d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); 1990 2004 if (!d->useScrollButtonsSetByUser) 1991 2005 d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this); … … 2020 2034 Q_D(QTabBar); 2021 2035 d->elideMode = mode; 2036 2022 2037 d->refresh(); 2023 2038 } … … 2236 2251 { 2237 2252 Q_D(QTabBar); 2253 2238 2254 d->documentMode = enabled; 2239 2255 d->updateMacBorderMetrics();
Note:
See TracChangeset
for help on using the changeset viewer.