src/gui/styles/qcommonstyle.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
child 30 5dc02b23752f
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
  1147     int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget);
  1147     int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget);
  1148     int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
  1148     int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
  1149     int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2;
  1149     int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2;
  1150     if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth)
  1150     if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth)
  1151         verticalShift = -verticalShift;
  1151         verticalShift = -verticalShift;
  1152     tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding);
  1152     tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
  1153     bool selected = opt->state & QStyle::State_Selected;
  1153     bool selected = opt->state & QStyle::State_Selected;
  1154     if (selected) {
  1154     if (selected) {
  1155         tr.setBottom(tr.bottom() - verticalShift);
  1155         tr.setTop(tr.top() - verticalShift);
  1156         tr.setRight(tr.right() - horizontalShift);
  1156         tr.setRight(tr.right() - horizontalShift);
  1157     }
  1157     }
  1158 
  1158 
  1159     // left widget
  1159     // left widget
  1160     if (!opt->leftButtonSize.isEmpty()) {
  1160     if (!opt->leftButtonSize.isEmpty()) {
  1606                     if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget))
  1606                     if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget))
  1607                         alignment |= Qt::TextHideMnemonic;
  1607                         alignment |= Qt::TextHideMnemonic;
  1608 
  1608 
  1609                     if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
  1609                     if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
  1610                         pr.setHeight(pmSize.height() + 6);
  1610                         pr.setHeight(pmSize.height() + 6);
  1611                         tr.adjust(0, pr.height() - 1, 0, -3);
  1611                         tr.adjust(0, pr.height() - 1, 0, -2);
  1612                         pr.translate(shiftX, shiftY);
  1612                         pr.translate(shiftX, shiftY);
  1613                         if (!hasArrow) {
  1613                         if (!hasArrow) {
  1614                             proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm);
  1614                             proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm);
  1615                         } else {
  1615                         } else {
  1616                             drawArrow(this, toolbutton, pr, p, widget);
  1616                             drawArrow(this, toolbutton, pr, p, widget);