diff options
author | Sami Merila <sami.merila@nokia.com> | 2009-12-23 14:14:01 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2009-12-23 14:14:01 (GMT) |
commit | 2751cdb118f2ac0ba39613e2064471333904c770 (patch) | |
tree | 9e0a475152a38bfcaad4565c8f5289bcd919009a /src | |
parent | 0c21eed51e67a584fcb331ee2c9fb65bc11fb633 (diff) | |
download | Qt-2751cdb118f2ac0ba39613e2064471333904c770.zip Qt-2751cdb118f2ac0ba39613e2064471333904c770.tar.gz Qt-2751cdb118f2ac0ba39613e2064471333904c770.tar.bz2 |
Minor optimization for QS60Style
Ask selected state only once in QS60Style when handling element
CE_TabBarTabLabel.
Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 12e1696..bcc993a 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1571,16 +1571,16 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, f.setPointSizeF(f.pointSizeF() * KTabFontMul); painter->setFont(f); - if (option->state & QStyle::State_Selected){ + const bool selected = optionTab.state & State_Selected; + if (selected) optionTab.palette.setColor(QPalette::Active, QPalette::WindowText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option)); - } const bool verticalTabs = optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::RoundedWest || optionTab.shape == QTabBar::TriangularEast || optionTab.shape == QTabBar::TriangularWest; - const bool selected = optionTab.state & State_Selected; + if (verticalTabs) { painter->save(); int newX, newY, newRotation; |