diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-08-28 13:51:22 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-08-28 13:51:22 (GMT) |
commit | 31a0ef1d1dd55096652c1c4f0501fce2937a1b23 (patch) | |
tree | f728a2e5829e26ed75bfd465d07b336fc77e599f /src/gui/styles | |
parent | 7c2620578ba0698a14c1d4ff5c7a4e260f06ad31 (diff) | |
parent | bd3cd571ac061b0ed0e8c001c90c4edeafae67d7 (diff) | |
download | Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.zip Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.gz Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 26 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index bc218cd..1cf47cc 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1350,9 +1350,6 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( } } -/*! - Constructs a QS60Style object. -*/ QS60Style::QS60Style() : QCommonStyle(*new QS60StylePrivate) { diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 7acb3a6..da71ced 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -214,6 +214,7 @@ enum PseudoElement { PseudoElement_ViewItemText, PseudoElement_ViewItemIndicator, PseudoElement_ScrollAreaCorner, + PseudoElement_TabBarTabCloseButton, NumPseudoElements }; @@ -223,7 +224,7 @@ struct PseudoElementInfo { }; static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = { - { QStyle::SC_None, "", }, + { QStyle::SC_None, "" }, { QStyle::SC_None, "down-arrow" }, { QStyle::SC_None, "up-arrow" }, { QStyle::SC_None, "left-arrow" }, @@ -300,8 +301,9 @@ static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = { { QStyle::SC_None, "item" }, { QStyle::SC_None, "icon" }, { QStyle::SC_None, "text" }, - { QStyle::SC_None, "indicator" } , - { QStyle::SC_None, "corner" } + { QStyle::SC_None, "indicator" }, + { QStyle::SC_None, "corner" }, + { QStyle::SC_None, "close-button" }, }; @@ -4370,6 +4372,12 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op case PE_IndicatorSpinPlus: pseudoElement = PseudoElement_SpinBoxUpArrow; break; +#ifndef QT_NO_TABBAR + case PE_IndicatorTabClose: + if (w) + w = w->parentWidget(); //match on the QTabBar instead of the CloseButton + pseudoElement = PseudoElement_TabBarTabCloseButton; +#endif default: break; @@ -5104,6 +5112,18 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi #endif // QT_NO_TABWIDGET s = QLatin1String("alignment"); break; +#ifndef QT_NO_TABBAR + case SH_TabBar_CloseButtonPosition: + rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); + if (rule.hasPosition()) { + Qt::Alignment align = rule.position()->position; + if (align & Qt::AlignLeft || align & Qt::AlignTop) + return QTabBar::LeftSide; + if (align & Qt::AlignRight || align & Qt::AlignBottom) + return QTabBar::RightSide; + } + break; +#endif case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; case SH_ComboBox_PopupFrameStyle: |