Changeset 561 for trunk/src/gui/styles
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 50 edited
- 16 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/styles/qcdestyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qcdestyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qcleanlooksstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 45 45 #if !defined(QT_NO_STYLE_CLEANLOOKS) || defined(QT_PLUGIN) 46 46 47 #include <private/qstylehelper_p.h> 47 48 #include "qwindowsstyle_p.h" 48 49 #include <qcombobox.h> … … 73 74 QT_BEGIN_NAMESPACE 74 75 75 static const bool UsePixmapCache = true;76 using namespace QStyleHelper; 76 77 77 78 enum Direction { … … 84 85 // from windows style 85 86 static const int windowsItemFrame = 2; // menu item frame width 86 static const int windowsSepHeight = 6; // separator item height87 87 static const int windowsItemHMargin = 3; // menu item hor text margin 88 88 static const int windowsItemVMargin = 8; // menu item ver text margin 89 static const int windowsArrowHMargin = 6; // arrow horizontal margin90 static const int windowsTabSpacing = 12; // space between text and tab91 static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark92 89 static const int windowsRightBorder = 15; // right border on windows 93 static const int windowsCheckMarkWidth = 12; // checkmarks width on windows94 90 95 91 /* XPM */ … … 462 458 " "}; 463 459 464 #ifdef Q_WS_X11465 extern "C" {466 struct GConfClient;467 struct GError;468 typedef void (*Ptr_g_type_init)();469 typedef GConfClient* (*Ptr_gconf_client_get_default)();470 typedef char* (*Ptr_gconf_client_get_string)(GConfClient*, const char*, GError **);471 typedef void (*Ptr_g_object_unref)(void *);472 typedef void (*Ptr_g_error_free)(GError *);473 typedef void (*Ptr_g_free)(void*);474 }475 476 static Ptr_g_type_init p_g_type_init = 0;477 static Ptr_gconf_client_get_default p_gconf_client_get_default = 0;478 static Ptr_gconf_client_get_string p_gconf_client_get_string = 0;479 static Ptr_g_object_unref p_g_object_unref = 0;480 static Ptr_g_error_free p_g_error_free = 0;481 static Ptr_g_free p_g_free = 0;482 #endif483 484 460 static void qt_cleanlooks_draw_gradient(QPainter *painter, const QRect &rect, const QColor &gradientStart, 485 461 const QColor &gradientStop, Direction direction = TopDown, QBrush bgBrush = QBrush()) … … 542 518 else { 543 519 int size = horizontal ? rect.width() : rect.height() ; 544 if (size < 1)545 size = 1;546 float edge = 4.0/(float)size;547 gradient->setColorAt(0, gradientStart);548 gradient->setColorAt(edge, gradientMid.lighter(104));549 gradient->setColorAt(1.0 - edge, gradientMid.darker(100));550 gradient->setColorAt(1.0, gradientStop);520 if (size > 4) { 521 float edge = 4.0/(float)size; 522 gradient->setColorAt(0, gradientStart); 523 gradient->setColorAt(edge, gradientMid.lighter(104)); 524 gradient->setColorAt(1.0 - edge, gradientMid.darker(100)); 525 gradient->setColorAt(1.0, gradientStop); 526 } 551 527 } 552 528 painter->fillRect(rect, *gradient); 553 529 delete gradient; 554 }555 556 static QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)557 {558 QString tmp;559 const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);560 tmp.sprintf("%s-%d-%d-%lld-%dx%d-%d", key.toLatin1().constData(), uint(option->state),561 complexOption ? uint(complexOption->activeSubControls) : uint(0),562 option->palette.cacheKey(), size.width(), size.height(), option->direction);563 #ifndef QT_NO_SPINBOX564 if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {565 tmp.append(QLatin1Char('-'));566 tmp.append(QString::number(spinBox->buttonSymbols));567 tmp.append(QLatin1Char('-'));568 tmp.append(QString::number(spinBox->stepEnabled));569 tmp.append(QLatin1Char('-'));570 tmp.append(QLatin1Char(spinBox->frame ? '1' : '0'));571 }572 #endif // QT_NO_SPINBOX573 return tmp;574 530 } 575 531 … … 606 562 607 563 painter->setPen(QPen(mdiButtonBorderColor, 1)); 608 painter->drawLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()); 609 painter->drawLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()); 610 painter->drawLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2); 611 painter->drawLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2); 612 painter->drawPoint(tmp.left() + 1, tmp.top() + 1); 613 painter->drawPoint(tmp.right() - 1, tmp.top() + 1); 614 painter->drawPoint(tmp.left() + 1, tmp.bottom() - 1); 615 painter->drawPoint(tmp.right() - 1, tmp.bottom() - 1); 564 const QLine lines[4] = { 565 QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()), 566 QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()), 567 QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2), 568 QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2) 569 }; 570 painter->drawLines(lines, 4); 571 const QPoint points[4] = { 572 QPoint(tmp.left() + 1, tmp.top() + 1), 573 QPoint(tmp.right() - 1, tmp.top() + 1), 574 QPoint(tmp.left() + 1, tmp.bottom() - 1), 575 QPoint(tmp.right() - 1, tmp.bottom() - 1) 576 }; 577 painter->drawPoints(points, 4); 616 578 617 579 painter->setPen(titleBarHighlight); … … 783 745 button.QStyleOption::operator=(*option); 784 746 button.state &= ~State_MouseOver; 785 drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget);747 proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget); 786 748 } 787 749 return; … … 803 765 break; 804 766 case PE_IndicatorButtonDropDown: 805 drawPrimitive(PE_PanelButtonCommand, option, painter, widget);767 proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); 806 768 break; 807 769 case PE_IndicatorToolBarSeparator: … … 888 850 if (widget && widget->inherits("QDockWidgetTitleButton")) { 889 851 if (option->state & State_MouseOver) 890 drawPrimitive(PE_PanelButtonCommand, option, painter, widget);852 proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); 891 853 } else { 892 drawPrimitive(PE_PanelButtonCommand, option, painter, widget);854 proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); 893 855 } 894 856 } … … 903 865 else 904 866 dockWidgetHandle.state |= State_Horizontal; 905 drawControl(CE_Splitter, &dockWidgetHandle, painter, widget);867 proxy()->drawControl(CE_Splitter, &dockWidgetHandle, painter, widget); 906 868 } 907 869 break; … … 929 891 #ifdef QT3_SUPPORT 930 892 if (widget && widget->inherits("Q3ToolBar")) { 931 drawPrimitive(PE_Q3Separator, option, painter, widget);893 proxy()->drawPrimitive(PE_Q3Separator, option, painter, widget); 932 894 break; 933 895 } … … 945 907 painter->setPen(buttonShadowAlpha); 946 908 painter->drawLine(QPoint(r.left() + 2, r.top() - 1), QPoint(r.right() - 2, r.top() - 1)); 947 painter->drawPoint(r.right() - 1, r.top()); 948 painter->drawPoint(r.right(), r.top() + 1); 949 painter->drawPoint(r.right() - 1, r.bottom()); 950 painter->drawPoint(r.right(), r.bottom() - 1); 951 painter->drawPoint(r.left() + 1, r.top() ); 952 painter->drawPoint(r.left(), r.top() + 1); 953 painter->drawPoint(r.left() + 1, r.bottom() ); 954 painter->drawPoint(r.left(), r.bottom() - 1); 909 const QPoint points[8] = { 910 QPoint(r.right() - 1, r.top()), 911 QPoint(r.right(), r.top() + 1), 912 QPoint(r.right() - 1, r.bottom()), 913 QPoint(r.right(), r.bottom() - 1), 914 QPoint(r.left() + 1, r.top() ), 915 QPoint(r.left(), r.top() + 1), 916 QPoint(r.left() + 1, r.bottom() ), 917 QPoint(r.left(), r.bottom() - 1) 918 }; 919 painter->drawPoints(points, 8); 955 920 painter->setPen(QPen(option->palette.background().color(), 1)); 956 921 painter->drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); … … 984 949 painter->drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)); 985 950 painter->drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right() - 2, r.bottom())); 986 painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); 987 painter->drawPoint(QPoint(r.right() - 1, r.top() + 1)); 988 painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); 989 painter->drawPoint(QPoint(r.left() + 1, r.top() + 1)); 951 const QPoint points2[4] = { 952 QPoint(r.right() - 1, r.bottom() - 1), 953 QPoint(r.right() - 1, r.top() + 1), 954 QPoint(r.left() + 1, r.bottom() - 1), 955 QPoint(r.left() + 1, r.top() + 1) 956 }; 957 painter->drawPoints(points2, 4); 990 958 painter->drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())); 991 959 painter->setPen(oldPen); … … 1085 1053 painter->setBrushOrigin(rect.topLeft()); 1086 1054 painter->setPen(Qt::NoPen); 1087 painter->drawRect(rect.left(), rect.top(), rect.width(), 1); // Top 1088 painter->drawRect(rect.left(), rect.bottom(), rect.width(), 1); // Bottom 1089 painter->drawRect(rect.left(), rect.top(), 1, rect.height()); // Left 1090 painter->drawRect(rect.right(), rect.top(), 1, rect.height()); // Right 1055 const QRect rects[4] = { 1056 QRect(rect.left(), rect.top(), rect.width(), 1), // Top 1057 QRect(rect.left(), rect.bottom(), rect.width(), 1), // Bottom 1058 QRect(rect.left(), rect.top(), 1, rect.height()), // Left 1059 QRect(rect.right(), rect.top(), 1, rect.height()) // Right 1060 }; 1061 painter->drawRects(rects, 4); 1091 1062 painter->restore(); 1092 1063 } … … 1110 1081 r = option->rect.adjusted(0, 1, 0, -1); 1111 1082 painter->setPen(QPen(Qt::black, 0)); 1112 painter->drawLine(QPoint(r.left() + 2, r.top()), 1113 QPoint(r.right() - 2, r.top())); 1114 painter->drawLine(QPoint(r.left(), r.top() + 2), 1115 QPoint(r.left(), r.bottom() - 2)); 1116 painter->drawLine(QPoint(r.right(), r.top() + 2), 1117 QPoint(r.right(), r.bottom() - 2)); 1118 painter->drawLine(QPoint(r.left() + 2, r.bottom()), 1119 QPoint(r.right() - 2, r.bottom())); 1120 painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); 1121 painter->drawPoint(QPoint(r.right() - 1, r.top() + 1)); 1122 painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); 1123 painter->drawPoint(QPoint(r.left() + 1, r.top() + 1)); 1083 const QLine lines[4] = { 1084 QLine(QPoint(r.left() + 2, r.top()), 1085 QPoint(r.right() - 2, r.top())), 1086 QLine(QPoint(r.left(), r.top() + 2), 1087 QPoint(r.left(), r.bottom() - 2)), 1088 QLine(QPoint(r.right(), r.top() + 2), 1089 QPoint(r.right(), r.bottom() - 2)), 1090 QLine(QPoint(r.left() + 2, r.bottom()), 1091 QPoint(r.right() - 2, r.bottom())) 1092 }; 1093 painter->drawLines(lines, 4); 1094 const QPoint points[4] = { 1095 QPoint(r.right() - 1, r.bottom() - 1), 1096 QPoint(r.right() - 1, r.top() + 1), 1097 QPoint(r.left() + 1, r.bottom() - 1), 1098 QPoint(r.left() + 1, r.top() + 1) 1099 }; 1100 painter->drawPoints(points, 4); 1124 1101 painter->setPen(oldPen); 1125 1102 } … … 1185 1162 p->drawLine(QPoint(r.left() + 2, r.bottom()), 1186 1163 QPoint(r.right() - 2, r.bottom())); 1187 p->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); 1188 p->drawPoint(QPoint(r.right() - 1, r.top() + 1)); 1189 p->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); 1190 p->drawPoint(QPoint(r.left() + 1, r.top() + 1)); 1164 const QPoint points[4] = { 1165 QPoint(r.right() - 1, r.bottom() - 1), 1166 QPoint(r.right() - 1, r.top() + 1), 1167 QPoint(r.left() + 1, r.bottom() - 1), 1168 QPoint(r.left() + 1, r.top() + 1) 1169 }; 1170 p->drawPoints(points, 4); 1191 1171 1192 1172 if (!isDefault && !hasFocus && isEnabled) … … 1208 1188 1209 1189 p->setPen(topShadow); 1210 p->drawPoint(QPoint(r.right(), r.top() + 1)); 1211 p->drawPoint(QPoint(r.right() - 1, r.top() )); 1212 p->drawPoint(QPoint(r.right(), r.bottom() - 1)); 1213 p->drawPoint(QPoint(r.right() - 1, r.bottom() )); 1214 p->drawPoint(QPoint(r.left() + 1, r.bottom())); 1215 p->drawPoint(QPoint(r.left(), r.bottom() - 1)); 1216 p->drawPoint(QPoint(r.left() + 1, r.top())); 1217 p->drawPoint(QPoint(r.left(), r.top() + 1)); 1190 const QPoint points2[8] = { 1191 QPoint(r.right(), r.top() + 1), 1192 QPoint(r.right() - 1, r.top() ), 1193 QPoint(r.right(), r.bottom() - 1), 1194 QPoint(r.right() - 1, r.bottom() ), 1195 QPoint(r.left() + 1, r.bottom()), 1196 QPoint(r.left(), r.bottom() - 1), 1197 QPoint(r.left() + 1, r.top()), 1198 QPoint(r.left(), r.top() + 1) 1199 }; 1200 p->drawPoints(points2, 8); 1218 1201 1219 1202 topShadow.setAlpha(30); … … 1228 1211 r.adjust(-1, -1, 1, 1); 1229 1212 p->setPen(buttonShadowAlpha.darker(120)); 1230 p->drawLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0)); 1231 p->drawLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0)); 1232 p->drawLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3)); 1233 p->drawLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3)); 1234 p->drawPoint(r.topRight() + QPoint(-2, 1)); 1235 p->drawPoint(r.topRight() + QPoint(-1, 2)); 1236 p->drawPoint(r.bottomRight() + QPoint(-1, -2)); 1237 p->drawPoint(r.bottomRight() + QPoint(-2, -1)); 1238 p->drawPoint(r.topLeft() + QPoint(1, 2)); 1239 p->drawPoint(r.topLeft() + QPoint(2, 1)); 1240 p->drawPoint(r.bottomLeft() + QPoint(1, -2)); 1241 p->drawPoint(r.bottomLeft() + QPoint(2, -1)); 1213 const QLine lines[4] = { 1214 QLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0)), 1215 QLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0)), 1216 QLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3)), 1217 QLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3)) 1218 }; 1219 p->drawLines(lines, 4); 1220 const QPoint points3[8] = { 1221 r.topRight() + QPoint(-2, 1), 1222 r.topRight() + QPoint(-1, 2), 1223 r.bottomRight() + QPoint(-1, -2), 1224 r.bottomRight() + QPoint(-2, -1), 1225 r.topLeft() + QPoint(1, 2), 1226 r.topLeft() + QPoint(2, 1), 1227 r.bottomLeft() + QPoint(1, -2), 1228 r.bottomLeft() + QPoint(2, -1) 1229 }; 1230 p->drawPoints(points3, 8); 1242 1231 } 1243 1232 painter->setPen(oldPen); … … 1258 1247 QColor innerShadow = mergedColors(borderColor, option->palette.base().color()); 1259 1248 1260 int borderThickness = p ixelMetric(PM_TabBarBaseOverlap, twf, widget);1249 int borderThickness = proxy()->pixelMetric(PM_TabBarBaseOverlap, twf, widget); 1261 1250 bool reverse = (twf->direction == Qt::RightToLeft); 1262 1251 QRect tabBarRect; … … 1352 1341 1353 1342 painter->setPen(alphaCornerColor); 1354 painter->drawPoint(leftBottomInnerCorner1); 1355 painter->drawPoint(leftBottomInnerCorner2); 1356 painter->drawPoint(rightBottomInnerCorner1); 1357 painter->drawPoint(rightBottomInnerCorner2); 1358 painter->drawPoint(leftTopInnerCorner1); 1359 painter->drawPoint(leftTopInnerCorner2); 1343 const QPoint points[6] = { 1344 leftBottomInnerCorner1, 1345 leftBottomInnerCorner2, 1346 rightBottomInnerCorner1, 1347 rightBottomInnerCorner2, 1348 leftTopInnerCorner1, 1349 leftTopInnerCorner2 1350 }; 1351 painter->drawPoints(points, 6); 1360 1352 } 1361 1353 #endif // QT_NO_TABWIDGET … … 1371 1363 d->tabBarcloseButtonIcon = standardIcon(SP_DialogCloseButton, option, widget); 1372 1364 if ((option->state & State_Enabled) && (option->state & State_MouseOver)) 1373 drawPrimitive(PE_PanelButtonCommand, option, painter, widget);1365 proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget); 1374 1366 QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(QSize(16, 16), QIcon::Normal, QIcon::On); 1375 drawItemPixmap(painter, option->rect, Qt::AlignCenter, pixmap);1367 proxy()->drawItemPixmap(painter, option->rect, Qt::AlignCenter, pixmap); 1376 1368 } 1377 1369 break; … … 1544 1536 break; 1545 1537 } 1546 if ( QApplication::layoutDirection()== Qt::RightToLeft) { //reverse layout changes the order of Beginning/end1538 if (toolbar->direction == Qt::RightToLeft) { //reverse layout changes the order of Beginning/end 1547 1539 bool tmp = paintLeftBorder; 1548 1540 paintRightBorder=paintLeftBorder; … … 1650 1642 = painter->fontMetrics().elidedText(dwOpt->title, 1651 1643 Qt::ElideRight, titleRect.width()); 1652 drawItemText(painter,1644 proxy()->drawItemText(painter, 1653 1645 titleRect, 1654 1646 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, … … 1665 1657 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { 1666 1658 QPixmap cache; 1667 QString pixmapName = uniqueName(QLatin1String("headersection"), option, option->rect.size());1668 pixmapName += Q Latin1String("-") + QString::number(int(header->position));1669 pixmapName += Q Latin1String("-") + QString::number(int(header->orientation));1659 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size()); 1660 pixmapName += QString::number(- int(header->position)); 1661 pixmapName += QString::number(- int(header->orientation)); 1670 1662 QRect r = option->rect; 1671 1663 QColor gradientStopColor; … … 1684 1676 painter->fillRect(r, gradient); 1685 1677 1686 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {1678 if (!QPixmapCache::find(pixmapName, cache)) { 1687 1679 cache = QPixmap(r.size()); 1688 1680 cache.fill(Qt::transparent); … … 1703 1695 cachePainter.drawLine(pixmapRect.topRight() + QPoint(0, 3), pixmapRect.bottomRight() + QPoint(0, -3)); } 1704 1696 cachePainter.end(); 1705 if (UsePixmapCache) 1706 QPixmapCache::insert(pixmapName, cache); 1697 QPixmapCache::insert(pixmapName, cache); 1707 1698 } 1708 1699 painter->drawPixmap(r.topLeft(), cache); … … 1716 1707 QColor borderColor = dark.lighter(110); 1717 1708 painter->setPen(QPen(borderColor, 0)); 1718 painter->drawLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top())); 1719 painter->drawLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom())); 1720 painter->drawLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1)); 1721 painter->drawLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1)); 1709 const QLine lines[4] = { 1710 QLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top())), 1711 QLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom())), 1712 QLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1)), 1713 QLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1)) 1714 }; 1715 painter->drawLines(lines, 4); 1722 1716 QColor alphaCorner = mergedColors(borderColor, option->palette.background().color()); 1723 1717 QColor innerShadow = mergedColors(borderColor, option->palette.base().color()); … … 1725 1719 //corner smoothing 1726 1720 painter->setPen(alphaCorner); 1727 painter->drawPoint(rect.topRight()); 1728 painter->drawPoint(rect.topLeft()); 1729 painter->drawPoint(rect.bottomRight()); 1730 painter->drawPoint(rect.bottomLeft()); 1721 const QPoint points[4] = { 1722 rect.topRight(), 1723 rect.topLeft(), 1724 rect.bottomRight(), 1725 rect.bottomLeft() 1726 }; 1727 painter->drawPoints(points, 4); 1731 1728 1732 1729 //inner shadow … … 1759 1756 if (vertical) { 1760 1757 rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height 1761 QTransform m; 1762 m.translate(rect.height()-1, -1.0); 1758 QTransform m = QTransform::fromTranslate(rect.height()-1, -1.0); 1763 1759 m.rotate(90.0); 1764 1760 painter->setTransform(m, true); … … 1767 1763 int maxWidth = rect.width() - 4; 1768 1764 int minWidth = 4; 1769 qint64 progress = (qint64)qMax(bar->progress, bar->minimum); // workaround for bug in QProgressBar 1770 double vc6_workaround = ((progress - qint64(bar->minimum)) / qMax(double(1.0), double(qint64(bar->maximum) - qint64(bar->minimum))) * maxWidth); 1771 int progressBarWidth = (int(vc6_workaround) > minWidth ) ? int(vc6_workaround) : minWidth; 1772 int width = indeterminate ? maxWidth : progressBarWidth; 1765 qreal progress = qMax(bar->progress, bar->minimum); // workaround for bug in QProgressBar 1766 int progressBarWidth = (progress - bar->minimum) * qreal(maxWidth) / qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); 1767 int width = indeterminate ? maxWidth : qMax(minWidth, progressBarWidth); 1773 1768 1774 1769 bool reverse = (!vertical && (bar->direction == Qt::RightToLeft)) || vertical; … … 1855 1850 1856 1851 painter->setPen(QPen(highlightOutline, 0)); 1857 painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())); 1858 painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())); 1859 painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())); 1860 painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())); 1852 const QLine lines[4] = { 1853 QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())), 1854 QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())), 1855 QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), 1856 QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())) 1857 }; 1858 painter->drawLines(lines, 4); 1861 1859 1862 1860 //draw text … … 1865 1863 if (!styleHint(SH_UnderlineShortcut, mbi, widget)) 1866 1864 alignment |= Qt::TextHideMnemonic; 1867 drawItemText(painter, item.rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole);1865 proxy()->drawItemText(painter, item.rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole); 1868 1866 } 1869 1867 … … 1892 1890 if (!menuItem->text.isEmpty()) { 1893 1891 painter->setFont(menuItem->font); 1894 drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter,1892 proxy()->drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter, 1895 1893 menuItem->palette, menuItem->state & State_Enabled, menuItem->text, 1896 1894 QPalette::Text); … … 1912 1910 r = r.adjusted(-1, 0, 1, 0); 1913 1911 painter->setPen(QPen(highlightOutline, 0)); 1914 painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1)); 1915 painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1)); 1916 painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())); 1917 painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())); 1912 const QLine lines[4] = { 1913 QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1)), 1914 QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1)), 1915 QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), 1916 QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())) 1917 }; 1918 painter->drawLines(lines, 4); 1918 1919 } else { 1919 1920 painter->fillRect(option->rect, menuBackground); … … 1996 1997 QPixmap pixmap; 1997 1998 1998 int smallIconSize = p ixelMetric(PM_SmallIconSize, option, widget);1999 int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); 1999 2000 QSize iconSize(smallIconSize, smallIconSize); 2000 2001 #ifndef QT_NO_COMBOBOX … … 2022 2023 opt.state |= State_Sunken; 2023 2024 opt.rect = vCheckRect; 2024 drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget);2025 proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); 2025 2026 } 2026 2027 painter->drawPixmap(pmr.topLeft(), pixmap); … … 2055 2056 QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, 2056 2057 QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); 2057 if (dis && !act && styleHint(SH_EtchDisabledText, option, widget)) {2058 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { 2058 2059 p->setPen(menuitem->palette.light().color()); 2059 2060 p->drawText(vShortcutRect.adjusted(1, 1, 1, 1), text_flags, s.mid(t + 1)); … … 2064 2065 } 2065 2066 QFont font = menuitem->font; 2067 // font may not have any "hard" flags set. We override 2068 // the point size so that when it is resolved against the device, this font will win. 2069 // This is mainly to handle cases where someone sets the font on the window 2070 // and then the combo inherits it and passes it onward. At that point the resolve mask 2071 // is very, very weak. This makes it stonger. 2072 font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); 2066 2073 2067 2074 if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) … … 2069 2076 2070 2077 p->setFont(font); 2071 if (dis && !act && styleHint(SH_EtchDisabledText, option, widget)) {2078 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { 2072 2079 p->setPen(menuitem->palette.light().color()); 2073 2080 p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, s.left(t)); … … 2092 2099 newMI.palette.setColor(QPalette::ButtonText, 2093 2100 newMI.palette.highlightedText().color()); 2094 drawPrimitive(arrow, &newMI, painter, widget);2101 proxy()->drawPrimitive(arrow, &newMI, painter, widget); 2095 2102 } 2096 2103 } … … 2153 2160 if (button->features & QStyleOptionButton::HasMenu) 2154 2161 ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0); 2155 drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled),2162 proxy()->drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled), 2156 2163 button->text, QPalette::ButtonText); 2157 2164 } … … 2208 2215 && tab->selectedPosition 2209 2216 == QStyleOptionTab::PreviousIsSelected)); 2210 int tabBarAlignment = styleHint(SH_TabBar_Alignment, tab, widget);2217 int tabBarAlignment = proxy()->styleHint(SH_TabBar_Alignment, tab, widget); 2211 2218 bool leftAligned = (!rtlHorTabs && tabBarAlignment == Qt::AlignLeft) 2212 2219 || (rtlHorTabs … … 2221 2228 2222 2229 QColor background = tab->palette.background().color(); 2223 int borderThinkness = p ixelMetric(PM_TabBarBaseOverlap, tab, widget);2230 int borderThinkness = proxy()->pixelMetric(PM_TabBarBaseOverlap, tab, widget); 2224 2231 if (selected) 2225 2232 borderThinkness /= 2; … … 2457 2464 if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { 2458 2465 QPixmap cache; 2459 QString pixmapName = uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size());2460 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {2466 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size()); 2467 if (!QPixmapCache::find(pixmapName, cache)) { 2461 2468 cache = QPixmap(spinBox->rect.size()); 2462 2469 cache.fill(Qt::transparent); … … 2474 2481 QStyleOptionSpinBox spinBoxCopy = *spinBox; 2475 2482 spinBoxCopy.rect = pixmapRect; 2476 QRect upRect = subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxUp, widget);2477 QRect downRect = subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxDown, widget);2478 2479 int fw = spinBoxCopy.frame ? p ixelMetric(PM_SpinBoxFrameWidth, &spinBoxCopy, widget) : 0;2483 QRect upRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxUp, widget); 2484 QRect downRect = proxy()->subControlRect(CC_SpinBox, &spinBoxCopy, SC_SpinBoxDown, widget); 2485 2486 int fw = spinBoxCopy.frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, &spinBoxCopy, widget) : 0; 2480 2487 cachePainter.fillRect(rect.adjusted(1, qMax(fw - 1, 0), -1, -fw), 2481 2488 option->palette.base()); … … 2489 2496 2490 2497 // antialias corners 2491 cachePainter.drawPoint(QPoint(r.right(), r.top() + 1)); 2492 cachePainter.drawPoint(QPoint(r.right() - 1, r.top() )); 2493 cachePainter.drawPoint(QPoint(r.right(), r.bottom() - 1)); 2494 cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() )); 2495 cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom())); 2496 cachePainter.drawPoint(QPoint(r.left(), r.bottom() - 1)); 2497 cachePainter.drawPoint(QPoint(r.left() + 1, r.top())); 2498 cachePainter.drawPoint(QPoint(r.left(), r.top() + 1)); 2498 const QPoint points[8] = { 2499 QPoint(r.right(), r.top() + 1), 2500 QPoint(r.right() - 1, r.top() ), 2501 QPoint(r.right(), r.bottom() - 1), 2502 QPoint(r.right() - 1, r.bottom() ), 2503 QPoint(r.left() + 1, r.bottom()), 2504 QPoint(r.left(), r.bottom() - 1), 2505 QPoint(r.left() + 1, r.top()), 2506 QPoint(r.left(), r.top() + 1) 2507 }; 2508 cachePainter.drawPoints(points, 8); 2499 2509 2500 2510 // draw frame … … 2524 2534 2525 2535 // top and bottom lines 2526 cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom())); 2527 cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())); 2528 cachePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)); 2529 cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); 2536 const QLine lines[4] = { 2537 QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom())), 2538 QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())), 2539 QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)), 2540 QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)) 2541 }; 2542 cachePainter.drawLines(lines, 4); 2530 2543 } 2531 2544 … … 2561 2574 if (spinBox->frame) { 2562 2575 // rounded corners 2563 cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); 2564 cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1)); 2565 cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); 2566 cachePainter.drawPoint(QPoint(r.right() - 1, r.top() + 1)); 2576 const QPoint points[4] = { 2577 QPoint(r.left() + 1, r.bottom() - 1), 2578 QPoint(r.left() + 1, r.top() + 1), 2579 QPoint(r.right() - 1, r.bottom() - 1), 2580 QPoint(r.right() - 1, r.top() + 1) 2581 }; 2582 cachePainter.drawPoints(points, 4); 2567 2583 2568 2584 if (option->state & State_HasFocus) { … … 2573 2589 cachePainter.drawRect(rect.adjusted(1, 2, -3 -downRect.width(), -3)); 2574 2590 cachePainter.setPen(QPen(darkoutline, 0)); 2575 cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom())); 2576 cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top())); 2577 cachePainter.drawLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1)); 2578 cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); 2591 const QLine lines[4] = { 2592 QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom())), 2593 QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top())), 2594 QLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1)), 2595 QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)) 2596 }; 2597 cachePainter.drawLines(lines, 4); 2579 2598 cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); 2580 2599 cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1)); … … 2675 2694 } 2676 2695 cachePainter.end(); 2677 if (UsePixmapCache) 2678 QPixmapCache::insert(pixmapName, cache); 2696 QPixmapCache::insert(pixmapName, cache); 2679 2697 } 2680 2698 painter->drawPixmap(spinBox->rect.topLeft(), cache); … … 2700 2718 QStyleOptionDockWidgetV2 dockwidget; 2701 2719 dockwidget.QStyleOption::operator=(*option); 2702 drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget);2720 proxy()->drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget); 2703 2721 } else 2704 2722 #endif // QT3_SUPPORT … … 2722 2740 painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top()); 2723 2741 painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom()); 2724 painter->drawPoint(fullRect.left() + 4, fullRect.top() + 1); 2725 painter->drawPoint(fullRect.left() + 3, fullRect.top() + 1); 2726 painter->drawPoint(fullRect.left() + 2, fullRect.top() + 2); 2727 painter->drawPoint(fullRect.left() + 1, fullRect.top() + 3); 2728 painter->drawPoint(fullRect.left() + 1, fullRect.top() + 4); 2742 const QPoint points[5] = { 2743 QPoint(fullRect.left() + 4, fullRect.top() + 1), 2744 QPoint(fullRect.left() + 3, fullRect.top() + 1), 2745 QPoint(fullRect.left() + 2, fullRect.top() + 2), 2746 QPoint(fullRect.left() + 1, fullRect.top() + 3), 2747 QPoint(fullRect.left() + 1, fullRect.top() + 4) 2748 }; 2749 painter->drawPoints(points, 5); 2729 2750 2730 2751 painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom()); 2731 painter->drawPoint(fullRect.right() - 3, fullRect.top() + 1); 2732 painter->drawPoint(fullRect.right() - 4, fullRect.top() + 1); 2733 painter->drawPoint(fullRect.right() - 2, fullRect.top() + 2); 2734 painter->drawPoint(fullRect.right() - 1, fullRect.top() + 3); 2735 painter->drawPoint(fullRect.right() - 1, fullRect.top() + 4); 2752 const QPoint points2[5] = { 2753 QPoint(fullRect.right() - 3, fullRect.top() + 1), 2754 QPoint(fullRect.right() - 4, fullRect.top() + 1), 2755 QPoint(fullRect.right() - 2, fullRect.top() + 2), 2756 QPoint(fullRect.right() - 1, fullRect.top() + 3), 2757 QPoint(fullRect.right() - 1, fullRect.top() + 4) 2758 }; 2759 painter->drawPoints(points2, 5); 2736 2760 2737 2761 // draw bottomline … … 2743 2767 } 2744 2768 // draw title 2745 QRect textRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget);2769 QRect textRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget); 2746 2770 QFont font = painter->font(); 2747 2771 font.setBold(true); … … 2758 2782 if ((titleBar->subControls & SC_TitleBarMinButton) && (titleBar->titleBarFlags & Qt::WindowMinimizeButtonHint) && 2759 2783 !(titleBar->titleBarState& Qt::WindowMinimized)) { 2760 QRect minButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget);2784 QRect minButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget); 2761 2785 if (minButtonRect.isValid()) { 2762 2786 bool hover = (titleBar->activeSubControls & SC_TitleBarMinButton) && (titleBar->state & State_MouseOver); … … 2779 2803 if ((titleBar->subControls & SC_TitleBarMaxButton) && (titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) && 2780 2804 !(titleBar->titleBarState & Qt::WindowMaximized)) { 2781 QRect maxButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget);2805 QRect maxButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget); 2782 2806 if (maxButtonRect.isValid()) { 2783 2807 bool hover = (titleBar->activeSubControls & SC_TitleBarMaxButton) && (titleBar->state & State_MouseOver); … … 2792 2816 maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1); 2793 2817 painter->setPen(textAlphaColor); 2794 painter->drawPoint(maxButtonIconRect.topLeft()); 2795 painter->drawPoint(maxButtonIconRect.topRight()); 2796 painter->drawPoint(maxButtonIconRect.bottomLeft()); 2797 painter->drawPoint(maxButtonIconRect.bottomRight()); 2818 const QPoint points[4] = { 2819 maxButtonIconRect.topLeft(), 2820 maxButtonIconRect.topRight(), 2821 maxButtonIconRect.bottomLeft(), 2822 maxButtonIconRect.bottomRight() 2823 }; 2824 painter->drawPoints(points, 4); 2798 2825 } 2799 2826 } … … 2801 2828 // close button 2802 2829 if ((titleBar->subControls & SC_TitleBarCloseButton) && (titleBar->titleBarFlags & Qt::WindowSystemMenuHint)) { 2803 QRect closeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget);2830 QRect closeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget); 2804 2831 if (closeButtonRect.isValid()) { 2805 2832 bool hover = (titleBar->activeSubControls & SC_TitleBarCloseButton) && (titleBar->state & State_MouseOver); … … 2808 2835 QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); 2809 2836 painter->setPen(textAlphaColor); 2810 painter->drawLine(closeIconRect.left() + 1, closeIconRect.top(), 2811 closeIconRect.right(), closeIconRect.bottom() - 1); 2812 painter->drawLine(closeIconRect.left(), closeIconRect.top() + 1, 2813 closeIconRect.right() - 1, closeIconRect.bottom()); 2814 painter->drawLine(closeIconRect.right() - 1, closeIconRect.top(), 2815 closeIconRect.left(), closeIconRect.bottom() - 1); 2816 painter->drawLine(closeIconRect.right(), closeIconRect.top() + 1, 2817 closeIconRect.left() + 1, closeIconRect.bottom()); 2818 painter->drawPoint(closeIconRect.topLeft()); 2819 painter->drawPoint(closeIconRect.topRight()); 2820 painter->drawPoint(closeIconRect.bottomLeft()); 2821 painter->drawPoint(closeIconRect.bottomRight()); 2837 const QLine lines[4] = { 2838 QLine(closeIconRect.left() + 1, closeIconRect.top(), 2839 closeIconRect.right(), closeIconRect.bottom() - 1), 2840 QLine(closeIconRect.left(), closeIconRect.top() + 1, 2841 closeIconRect.right() - 1, closeIconRect.bottom()), 2842 QLine(closeIconRect.right() - 1, closeIconRect.top(), 2843 closeIconRect.left(), closeIconRect.bottom() - 1), 2844 QLine(closeIconRect.right(), closeIconRect.top() + 1, 2845 closeIconRect.left() + 1, closeIconRect.bottom()) 2846 }; 2847 painter->drawLines(lines, 4); 2848 const QPoint points[4] = { 2849 closeIconRect.topLeft(), 2850 closeIconRect.topRight(), 2851 closeIconRect.bottomLeft(), 2852 closeIconRect.bottomRight() 2853 }; 2854 painter->drawPoints(points, 4); 2822 2855 2823 2856 painter->setPen(textColor); … … 2835 2868 ((titleBar->titleBarFlags & Qt::WindowMaximizeButtonHint) && 2836 2869 (titleBar->titleBarState & Qt::WindowMaximized)))) { 2837 QRect normalButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget);2870 QRect normalButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget); 2838 2871 if (normalButtonRect.isValid()) { 2839 2872 … … 2849 2882 frontWindowRect.right() - 1, frontWindowRect.top() + 1); 2850 2883 painter->setPen(textAlphaColor); 2851 painter->drawPoint(frontWindowRect.topLeft()); 2852 painter->drawPoint(frontWindowRect.topRight()); 2853 painter->drawPoint(frontWindowRect.bottomLeft()); 2854 painter->drawPoint(frontWindowRect.bottomRight()); 2884 const QPoint points[4] = { 2885 frontWindowRect.topLeft(), 2886 frontWindowRect.topRight(), 2887 frontWindowRect.bottomLeft(), 2888 frontWindowRect.bottomRight() 2889 }; 2890 painter->drawPoints(points, 4); 2855 2891 2856 2892 QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3); … … 2864 2900 backWindowRect.right() - 1, backWindowRect.top() + 1); 2865 2901 painter->setPen(textAlphaColor); 2866 painter->drawPoint(backWindowRect.topLeft()); 2867 painter->drawPoint(backWindowRect.topRight()); 2868 painter->drawPoint(backWindowRect.bottomLeft()); 2869 painter->drawPoint(backWindowRect.bottomRight()); 2902 const QPoint points2[4] = { 2903 backWindowRect.topLeft(), 2904 backWindowRect.topRight(), 2905 backWindowRect.bottomLeft(), 2906 backWindowRect.bottomRight() 2907 }; 2908 painter->drawPoints(points2, 4); 2870 2909 painter->restore(); 2871 2910 } … … 2875 2914 if (titleBar->subControls & SC_TitleBarContextHelpButton 2876 2915 && (titleBar->titleBarFlags & Qt::WindowContextHelpButtonHint)) { 2877 QRect contextHelpButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget);2916 QRect contextHelpButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget); 2878 2917 if (contextHelpButtonRect.isValid()) { 2879 2918 bool hover = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_MouseOver); … … 2894 2933 // shade button 2895 2934 if (titleBar->subControls & SC_TitleBarShadeButton && (titleBar->titleBarFlags & Qt::WindowShadeButtonHint)) { 2896 QRect shadeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget);2935 QRect shadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget); 2897 2936 if (shadeButtonRect.isValid()) { 2898 2937 bool hover = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_MouseOver); … … 2907 2946 // unshade button 2908 2947 if (titleBar->subControls & SC_TitleBarUnshadeButton && (titleBar->titleBarFlags & Qt::WindowShadeButtonHint)) { 2909 QRect unshadeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget);2948 QRect unshadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget); 2910 2949 if (unshadeButtonRect.isValid()) { 2911 2950 bool hover = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_MouseOver); … … 2919 2958 2920 2959 if ((titleBar->subControls & SC_TitleBarSysMenu) && (titleBar->titleBarFlags & Qt::WindowSystemMenuHint)) { 2921 QRect iconRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget);2960 QRect iconRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget); 2922 2961 if (iconRect.isValid()) { 2923 2962 if (!titleBar->icon.isNull()) { … … 2929 2968 tool.rect = iconRect; 2930 2969 painter->save(); 2931 drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm);2970 proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm); 2932 2971 painter->restore(); 2933 2972 } … … 2949 2988 2950 2989 QRect rect = scrollBar->rect; 2951 QRect scrollBarSubLine = subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget);2952 QRect scrollBarAddLine = subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget);2953 QRect scrollBarSlider = subControlRect(control, scrollBar, SC_ScrollBarSlider, widget);2954 QRect grooveRect = subControlRect(control, scrollBar, SC_ScrollBarGroove, widget);2990 QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); 2991 QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); 2992 QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); 2993 QRect grooveRect = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); 2955 2994 2956 2995 // paint groove … … 3087 3126 // The SubLine (up/left) buttons 3088 3127 if (scrollBar->subControls & SC_ScrollBarSubLine) { 3089 //int scrollBarExtent = p ixelMetric(PM_ScrollBarExtent, option, widget);3128 //int scrollBarExtent = proxy()->pixelMetric(PM_ScrollBarExtent, option, widget); 3090 3129 QRect pixmapRect = scrollBarSubLine; 3091 3130 if (isEnabled ) { … … 3133 3172 QStyleOption arrowOpt = *option; 3134 3173 arrowOpt.rect = scrollBarSubLine.adjusted(3, 3, -2, -2); 3135 drawPrimitive(arrow, &arrowOpt, painter, widget);3174 proxy()->drawPrimitive(arrow, &arrowOpt, painter, widget); 3136 3175 3137 3176 3138 3177 // The AddLine (down/right) button 3139 3178 if (scrollBar->subControls & SC_ScrollBarAddLine) { 3140 QString addLinePixmapName = uniqueName(QLatin1String("scrollbar_addline"), option, QSize(16, 16));3179 QString addLinePixmapName = QStyleHelper::uniqueName(QLatin1String("scrollbar_addline"), option, QSize(16, 16)); 3141 3180 QRect pixmapRect = scrollBarAddLine; 3142 3181 if (isEnabled) { … … 3184 3223 QStyleOption arrowOpt = *option; 3185 3224 arrowOpt.rect = scrollBarAddLine.adjusted(3, 3, -2, -2); 3186 drawPrimitive(arrow, &arrowOpt, painter, widget);3225 proxy()->drawPrimitive(arrow, &arrowOpt, painter, widget); 3187 3226 } 3188 3227 } … … 3199 3238 bool focus = isEnabled && (comboBox->state & State_HasFocus); 3200 3239 QPixmap cache; 3201 QString pixmapName = uniqueName(QLatin1String("combobox"), option, comboBox->rect.size());3240 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("combobox"), option, comboBox->rect.size()); 3202 3241 if (sunken) 3203 3242 pixmapName += QLatin1String("-sunken"); … … 3207 3246 pixmapName += QLatin1String("-enabled"); 3208 3247 3209 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {3248 if (!QPixmapCache::find(pixmapName, cache)) { 3210 3249 cache = QPixmap(comboBox->rect.size()); 3211 3250 cache.fill(Qt::transparent); … … 3216 3255 3217 3256 QRect rect = pixmapRect; 3218 QRect downArrowRect = subControlRect(CC_ComboBox, &comboBoxCopy,3257 QRect downArrowRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, 3219 3258 SC_ComboBoxArrow, widget); 3220 QRect editRect = subControlRect(CC_ComboBox, &comboBoxCopy,3259 QRect editRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, 3221 3260 SC_ComboBoxEditField, widget); 3222 3261 // Draw a push button … … 3232 3271 } 3233 3272 3234 drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget);3273 proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); 3235 3274 3236 3275 //remove shadow from left side of edit field when pressed: … … 3274 3313 buttonOption.state &= ~State_MouseOver; 3275 3314 } 3276 drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget);3315 proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, &cachePainter, widget); 3277 3316 3278 3317 cachePainter.setPen(buttonShadow.darker(102)); … … 3327 3366 } 3328 3367 // Draw the focus rect 3329 if ((focus && (option->state & State_KeyboardFocusChange)) && !comboBox->editable) { 3368 if (focus && !comboBox->editable 3369 && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) { 3330 3370 QStyleOptionFocusRect focus; 3331 focus.rect = subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxEditField, widget)3371 focus.rect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxEditField, widget) 3332 3372 .adjusted(0, 2, option->direction == Qt::RightToLeft ? 1 : -1, -2); 3333 drawPrimitive(PE_FrameFocusRect, &focus, &cachePainter, widget);3373 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, &cachePainter, widget); 3334 3374 } 3335 3375 cachePainter.end(); 3336 if (UsePixmapCache) 3337 QPixmapCache::insert(pixmapName, cache); 3376 QPixmapCache::insert(pixmapName, cache); 3338 3377 } 3339 3378 painter->drawPixmap(comboBox->rect.topLeft(), cache); … … 3346 3385 painter->save(); 3347 3386 if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) { 3348 QRect textRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget);3349 QRect checkBoxRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget);3387 QRect textRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); 3388 QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget); 3350 3389 bool flat = groupBox->features & QStyleOptionFrameV2::Flat; 3351 3390 … … 3357 3396 frame.lineWidth = groupBox->lineWidth; 3358 3397 frame.midLineWidth = groupBox->midLineWidth; 3359 frame.rect = subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget);3398 frame.rect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); 3360 3399 3361 3400 painter->save(); … … 3366 3405 painter->setClipRegion(region); 3367 3406 frame.palette.setBrush(QPalette::Dark, option->palette.mid().color().lighter(110)); 3368 drawPrimitive(PE_FrameGroupBox, &frame, painter);3407 proxy()->drawPrimitive(PE_FrameGroupBox, &frame, painter); 3369 3408 painter->restore(); 3370 3409 } … … 3394 3433 box.QStyleOption::operator=(*groupBox); 3395 3434 box.rect = checkBoxRect; 3396 drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget);3435 proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); 3397 3436 } 3398 3437 } … … 3403 3442 case CC_Slider: 3404 3443 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 3405 QRect groove = subControlRect(CC_Slider, option, SC_SliderGroove, widget);3406 QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget);3407 QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);3444 QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); 3445 QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); 3446 QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); 3408 3447 3409 3448 bool horizontal = slider->orientation == Qt::Horizontal; … … 3422 3461 3423 3462 if ((option->subControls & SC_SliderGroove) && groove.isValid()) { 3424 QString groovePixmapName = uniqueName(QLatin1String("slider_groove"), option, groove.size());3463 QString groovePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_groove"), option, groove.size()); 3425 3464 QRect pixmapRect(0, 0, groove.width(), groove.height()); 3426 3465 3427 3466 // draw background groove 3428 if (! UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) {3467 if (!QPixmapCache::find(groovePixmapName, cache)) { 3429 3468 cache = QPixmap(pixmapRect.size()); 3430 3469 cache.fill(Qt::transparent); … … 3453 3492 groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2)); 3454 3493 groovePainter.end(); 3455 if (UsePixmapCache) 3456 QPixmapCache::insert(groovePixmapName, cache); 3494 QPixmapCache::insert(groovePixmapName, cache); 3457 3495 } 3458 3496 painter->drawPixmap(groove.topLeft(), cache); … … 3461 3499 QRect clipRect; 3462 3500 groovePixmapName += QLatin1String("_blue"); 3463 if (! UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) {3501 if (!QPixmapCache::find(groovePixmapName, cache)) { 3464 3502 cache = QPixmap(pixmapRect.size()); 3465 3503 cache.fill(Qt::transparent); … … 3480 3518 groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2)); 3481 3519 groovePainter.end(); 3482 if (UsePixmapCache) 3483 QPixmapCache::insert(groovePixmapName, cache); 3520 QPixmapCache::insert(groovePixmapName, cache); 3484 3521 } 3485 3522 if (horizontal) { … … 3502 3539 // draw handle 3503 3540 if ((option->subControls & SC_SliderHandle) ) { 3504 QString handlePixmapName = uniqueName(QLatin1String("slider_handle"), option, handle.size());3505 if (! UsePixmapCache || !QPixmapCache::find(handlePixmapName, cache)) {3541 QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); 3542 if (!QPixmapCache::find(handlePixmapName, cache)) { 3506 3543 cache = QPixmap(handle.size()); 3507 3544 cache.fill(Qt::transparent); … … 3543 3580 handlePainter.setRenderHint(QPainter::Antialiasing); 3544 3581 handlePainter.translate(0.5, 0.5); 3545 handlePainter.drawLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom())); 3546 handlePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top())); 3547 handlePainter.drawLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom())); 3548 handlePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top())); 3582 const QLine lines[4] = { 3583 QLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom())), 3584 QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top())), 3585 QLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom())), 3586 QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top())) 3587 }; 3588 handlePainter.drawLines(lines, 4); 3549 3589 handlePainter.restore();; 3550 3590 handlePainter.setPen(QPen(outline.darker(130), 1)); … … 3584 3624 } 3585 3625 handlePainter.end(); 3586 if (UsePixmapCache) 3587 QPixmapCache::insert(handlePixmapName, cache); 3626 QPixmapCache::insert(handlePixmapName, cache); 3588 3627 } 3589 3628 … … 3594 3633 fropt.QStyleOption::operator=(*slider); 3595 3634 fropt.rect = slider->rect; 3596 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);3635 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 3597 3636 } 3598 3637 } 3599 3638 if (option->subControls & SC_SliderTickmarks) { 3600 3639 painter->setPen(darkOutline); 3601 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);3602 int available = p ixelMetric(PM_SliderSpaceAvailable, slider, widget);3640 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 3641 int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); 3603 3642 int interval = slider->tickInterval; 3604 3643 if (interval <= 0) { … … 3614 3653 3615 3654 int v = slider->minimum; 3616 int len = p ixelMetric(PM_SliderLength, slider, widget);3655 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 3617 3656 while (v <= slider->maximum + 1) { 3618 3657 if (v == slider->maximum + 1 && interval == 1) … … 3657 3696 break; 3658 3697 #endif // QT_NO_SLIDER 3698 #ifndef QT_NO_DIAL 3699 case CC_Dial: 3700 if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option)) 3701 QStyleHelper::drawDial(dial, painter); 3702 break; 3703 #endif // QT_NO_DIAL 3659 3704 default: 3660 3705 QWindowsStyle::drawComplexControl(control, option, painter, widget); … … 3773 3818 if (!btn->icon.isNull() && btn->iconSize.height() > 16) 3774 3819 newSize -= QSize(0, 2); 3820 newSize += QSize(0, 1); 3775 3821 } 3776 3822 if (const QPushButton *button = qobject_cast<const QPushButton *>(widget)) { … … 3781 3827 } 3782 3828 break; 3829 #ifndef QT_NO_GROUPBOX 3783 3830 case CT_GroupBox: 3831 // Since we use a bold font we have to recalculate base width 3832 if (const QGroupBox *gb = qobject_cast<const QGroupBox*>(widget)) { 3833 QFont font = gb->font(); 3834 font.setBold(true); 3835 QFontMetrics metrics(font); 3836 int baseWidth = metrics.width(gb->title()) + metrics.width(QLatin1Char(' ')); 3837 if (gb->isCheckable()) { 3838 baseWidth += proxy()->pixelMetric(QStyle::PM_IndicatorWidth, option, widget); 3839 baseWidth += proxy()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, option, widget); 3840 } 3841 newSize.setWidth(qMax(baseWidth, newSize.width())); 3842 } 3843 newSize += QSize(0, 1); 3844 break; 3845 #endif //QT_NO_GROUPBOX 3784 3846 case CT_RadioButton: 3785 3847 case CT_CheckBox: … … 3808 3870 if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { 3809 3871 if (!menuItem->text.isEmpty()) { 3810 newSize.setHeight(menuItem->fontMetrics. lineSpacing());3872 newSize.setHeight(menuItem->fontMetrics.height()); 3811 3873 } 3812 3874 } … … 3849 3911 { 3850 3912 QWindowsStyle::polish(app); 3851 #ifdef Q_WS_X113852 Q_D(QCleanlooksStyle);3853 3854 QString dataDirs = QLatin1String(getenv("XDG_DATA_DIRS"));3855 3856 if (dataDirs.isEmpty())3857 dataDirs = QLatin1String("/usr/local/share/:/usr/share/");3858 3859 dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));3860 d->iconDirs = dataDirs.split(QLatin1String(":"));3861 #endif3862 3913 } 3863 3914 … … 3960 4011 case CC_Slider: 3961 4012 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 3962 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);4013 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 3963 4014 switch (subControl) { 3964 4015 case SC_SliderHandle: { … … 4015 4066 QSize bs; 4016 4067 int center = spinbox->rect.height() / 2; 4017 int fw = spinbox->frame ? p ixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;4068 int fw = spinbox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; 4018 4069 int y = fw; 4019 4070 bs.setHeight(qMax(8, spinbox->rect.height()/2 - y)); … … 4056 4107 int topMargin = 0; 4057 4108 int topHeight = 0; 4058 int verticalAlignment = styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget);4109 int verticalAlignment = proxy()->styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget); 4059 4110 bool flat = groupBox->features & QStyleOptionFrameV2::Flat; 4060 4111 if (!groupBox->text.isEmpty()) { … … 4087 4138 QSize textRect = fontMetrics.boundingRect(groupBoxWidget->title()).size() + QSize(2, 2); 4088 4139 if (subControl == SC_GroupBoxCheckBox) { 4089 int indicatorWidth = p ixelMetric(PM_IndicatorWidth, option, widget);4090 int indicatorHeight = p ixelMetric(PM_IndicatorHeight, option, widget);4140 int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); 4141 int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); 4091 4142 rect.setWidth(indicatorWidth); 4092 4143 rect.setHeight(indicatorHeight); … … 4109 4160 break; 4110 4161 case SC_ComboBoxEditField: { 4111 int frameWidth = p ixelMetric(PM_DefaultFrameWidth);4162 int frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth); 4112 4163 rect = visualRect(option->direction, option->rect, rect); 4113 4164 rect.setRect(option->rect.left() + frameWidth, option->rect.top() + frameWidth, … … 4360 4411 r.adjust(0, 0, 0, -4); 4361 4412 } else { 4362 if ( QApplication::layoutDirection()== Qt::LeftToRight)4413 if (opt->direction == Qt::LeftToRight) 4363 4414 r.adjust(4, 0, 0, 0); 4364 4415 else … … 4375 4426 } 4376 4427 return r; 4377 }4378 4379 void QCleanlooksStylePrivate::lookupIconTheme() const4380 {4381 #ifdef Q_WS_X114382 4383 if (themeName.isEmpty()) {4384 //resolve glib and gconf functions4385 p_g_type_init = (Ptr_g_type_init)QLibrary::resolve(QLatin1String("gobject-2.0"), 0, "g_type_init");4386 p_gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLatin1String("gconf-2"), 4, "gconf_client_get_default");4387 p_gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLatin1String("gconf-2"), 4, "gconf_client_get_string");4388 p_g_object_unref = (Ptr_g_object_unref)QLibrary::resolve(QLatin1String("gobject-2.0"), 0, "g_object_unref");4389 p_g_error_free = (Ptr_g_error_free)QLibrary::resolve(QLatin1String("glib-2.0"), 0, "g_error_free");4390 p_g_free = (Ptr_g_free)QLibrary::resolve(QLatin1String("glib-2.0"), 0, "g_free");4391 4392 if (p_g_type_init &&4393 p_gconf_client_get_default &&4394 p_gconf_client_get_string &&4395 p_g_object_unref &&4396 p_g_error_free &&4397 p_g_free) {4398 4399 p_g_type_init();4400 GConfClient* client = p_gconf_client_get_default();4401 GError *err = 0;4402 char *str = p_gconf_client_get_string(client, "/desktop/gnome/interface/icon_theme", &err);4403 if (!err) {4404 themeName = QString::fromUtf8(str);4405 p_g_free(str);4406 }4407 p_g_object_unref(client);4408 if (err)4409 p_g_error_free (err);4410 }4411 if (themeName.isEmpty())4412 themeName = QLatin1String("gnome");4413 }4414 #endif4415 4428 } 4416 4429 … … 4422 4435 const QWidget *widget) const 4423 4436 { 4424 #ifdef Q_WS_X114425 Q_D(const QCleanlooksStyle);4426 if (!qApp->desktopSettingsAware())4427 return QWindowsStyle::standardIconImplementation(standardIcon, option, widget);4428 QIcon icon;4429 QPixmap pixmap;4430 QPixmap link;4431 d->lookupIconTheme();4432 switch (standardIcon) {4433 case SP_DirIcon: {4434 icon = QIcon(standardPixmap(standardIcon, option, widget));4435 icon.addPixmap(standardPixmap(SP_DirClosedIcon, option, widget),4436 QIcon::Normal, QIcon::Off);4437 pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory.png"));4438 if (!pixmap.isNull())4439 icon.addPixmap(pixmap, QIcon::Normal, QIcon::Off);4440 pixmap = d->findIcon(48, QLatin1String("gnome-fs-directory.png"));4441 if (!pixmap.isNull())4442 icon.addPixmap(pixmap, QIcon::Normal, QIcon::Off);4443 pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory-accept.png"));4444 if (!pixmap.isNull())4445 icon.addPixmap(pixmap, QIcon::Normal, QIcon::On);4446 pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory-accept.png"));4447 if (!pixmap.isNull())4448 icon.addPixmap(pixmap, QIcon::Normal, QIcon::On);4449 }4450 break;4451 case SP_DirLinkIcon:4452 {4453 icon = QIcon(standardPixmap(standardIcon, option, widget));4454 QPixmap link = d->findIcon(12, QLatin1String("emblem-symbolic-link.png"));4455 if (!link.isNull()) {4456 icon.addPixmap(standardPixmap(SP_DirLinkIcon, option, widget));4457 pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory.png"));4458 if (!pixmap.isNull()) {4459 QPainter painter(&pixmap);4460 painter.drawPixmap(8, 8, 8, 8, link);4461 painter.end();4462 icon.addPixmap(pixmap);4463 }4464 }4465 break;4466 }4467 case SP_FileIcon:4468 {4469 icon = d->createIcon(QLatin1String("unknown.png"));4470 if (icon.isNull())4471 icon = d->createIcon(QLatin1String("gnome-fs-regular.png"));4472 if (icon.isNull())4473 icon = d->createIcon(QLatin1String("stock_new.png"));4474 break;4475 }4476 case SP_DialogCloseButton:4477 {4478 icon = d->createIcon(QLatin1String("gtk-close.png"));4479 if (icon.isNull())4480 icon = d->createIcon(QLatin1String("stock-close.png"));4481 break;4482 }4483 case SP_DirHomeIcon:4484 {4485 icon = d->createIcon(QLatin1String("folder_home.png"));4486 if (icon.isNull())4487 icon = d->createIcon(QLatin1String("gnome_home.png"));4488 break;4489 }4490 case SP_DriveFDIcon:4491 {4492 icon = d->createIcon(QLatin1String("gnome-dev-floppy.png"));4493 break;4494 }4495 case SP_ComputerIcon:4496 {4497 icon = d->createIcon(QLatin1String("gnome-fs-client.png"));4498 break;4499 }4500 case SP_DesktopIcon:4501 {4502 icon = d->createIcon(QLatin1String("gnome-fs-desktop.png"));4503 break;4504 }4505 case SP_TrashIcon:4506 {4507 icon = d->createIcon(QLatin1String("gnome-fs-trash-empty.png"));4508 break;4509 }4510 case SP_DriveCDIcon:4511 case SP_DriveDVDIcon:4512 {4513 icon = d->createIcon(QLatin1String("gnome-dev-cdrom.png"));4514 break;4515 }4516 case SP_DriveHDIcon:4517 {4518 icon = d->createIcon(QLatin1String("gnome-dev-harddisk.png"));4519 break;4520 }4521 case SP_ArrowUp:4522 {4523 icon = d->createIcon(QLatin1String("stock_up.png"));4524 break;4525 }4526 case SP_ArrowDown:4527 {4528 icon = d->createIcon(QLatin1String("stock_down.png"));4529 break;4530 }4531 case SP_ArrowRight:4532 {4533 icon = d->createIcon(QLatin1String("stock_right.png"));4534 break;4535 }4536 case SP_ArrowLeft:4537 {4538 icon = d->createIcon(QLatin1String("stock_left.png"));4539 break;4540 }4541 case SP_BrowserReload:4542 {4543 icon = d->createIcon(QLatin1String("view-refresh.png"));4544 break;4545 }4546 case SP_BrowserStop:4547 {4548 pixmap = d->findIcon(24, QLatin1String("stop.png"));4549 break;4550 }4551 case SP_FileLinkIcon:4552 {4553 icon = QIcon(standardPixmap(standardIcon, option, widget));4554 QPixmap link = d->findIcon(12, QLatin1String("emblem-symbolic-link.png"));4555 if (!link.isNull()) {4556 icon.addPixmap(standardPixmap(SP_FileLinkIcon,option, widget));4557 pixmap = d->findIcon(16, QLatin1String("unknown.png"));4558 if (pixmap.isNull())4559 pixmap = d->findIcon(16, QLatin1String("stock_new.png"));4560 if (!pixmap.isNull()) {4561 QPainter painter(&pixmap);4562 painter.drawPixmap(8, 8, 8, 8, link);4563 painter.end();4564 icon.addPixmap(pixmap);4565 }4566 }4567 break;4568 }4569 case SP_ArrowForward:4570 if (QApplication::layoutDirection() == Qt::RightToLeft)4571 return standardIconImplementation(SP_ArrowLeft, option, widget);4572 return standardIconImplementation(SP_ArrowRight, option, widget);4573 case SP_ArrowBack:4574 if (QApplication::layoutDirection() == Qt::RightToLeft)4575 return standardIconImplementation(SP_ArrowRight, option, widget);4576 return standardIconImplementation(SP_ArrowLeft, option, widget);4577 default:4578 icon = QIcon(standardPixmap(standardIcon, option, widget));4579 }4580 if (!icon.isNull())4581 return icon;4582 #endif // Q_WS_X114583 4437 return QWindowsStyle::standardIconImplementation(standardIcon, option, widget); 4584 4438 } … … 4590 4444 const QWidget *widget) const 4591 4445 { 4592 #ifdef Q_WS_X114593 Q_D(const QCleanlooksStyle);4594 4446 QPixmap pixmap; 4595 if (!qApp->desktopSettingsAware()) 4596 return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); 4597 d->lookupIconTheme(); 4447 4598 4448 #ifndef QT_NO_IMAGEFORMAT_XPM 4599 4449 switch (standardPixmap) { 4600 case SP_MessageBoxInformation:4601 {4602 pixmap = d->findIcon(48, QLatin1String("dialog-info.png"));4603 if (pixmap.isNull())4604 pixmap = d->findIcon(48, QLatin1String("stock_dialog-info.png"));4605 if (!pixmap.isNull())4606 return pixmap;4607 break;4608 }4609 case SP_MessageBoxWarning:4610 {4611 pixmap = d->findIcon(48, QLatin1String("dialog-warning.png"));4612 if (pixmap.isNull())4613 pixmap = d->findIcon(48, QLatin1String("stock_dialog-warning.png"));4614 if (!pixmap.isNull())4615 return pixmap;4616 break;4617 }4618 case SP_MessageBoxCritical:4619 {4620 pixmap = d->findIcon(48, QLatin1String("dialog-error.png"));4621 if (pixmap.isNull())4622 pixmap = d->findIcon(48, QLatin1String("stock_dialog-error.png"));4623 if (!pixmap.isNull())4624 return pixmap;4625 break;4626 }4627 case SP_MessageBoxQuestion:4628 {4629 pixmap = d->findIcon(48, QLatin1String("dialog-question.png"));4630 if (!pixmap.isNull())4631 return pixmap;4632 break;4633 }4634 case SP_DirHomeIcon:4635 {4636 pixmap = d->findIcon(16, QLatin1String("folder_home.png"));4637 if (pixmap.isNull())4638 pixmap = d->findIcon(16, QLatin1String("gnome_home.png"));4639 if (!pixmap.isNull())4640 return pixmap;4641 break;4642 }4643 case SP_DialogOpenButton:4644 case SP_DirOpenIcon:4645 {4646 pixmap = d->findIcon(24, QLatin1String("stock_open.png"));4647 if (!pixmap.isNull())4648 return pixmap;4649 break;4650 }4651 case SP_FileIcon:4652 {4653 pixmap = d->findIcon(24, QLatin1String("unknown.png"));4654 if (pixmap.isNull())4655 pixmap = d->findIcon(24, QLatin1String("gnome-fs-regular.png"));4656 if (pixmap.isNull())4657 pixmap = d->findIcon(24, QLatin1String("stock_new.png"));4658 if (!pixmap.isNull())4659 return pixmap;4660 break;4661 }4662 case SP_FileLinkIcon:4663 {4664 pixmap = d->findIcon(24, QLatin1String("emblem-symbolic-link.png"));4665 if (!pixmap.isNull()) {4666 QPixmap fileIcon = d->findIcon(24, QLatin1String("unknown.png"));4667 if (fileIcon.isNull())4668 fileIcon = d->findIcon(24, QLatin1String("stock_new.png"));4669 if (!fileIcon.isNull()) {4670 QPainter painter(&fileIcon);4671 painter.setRenderHint(QPainter::SmoothPixmapTransform);4672 painter.drawPixmap(12, 12, 12, 12, pixmap);4673 return fileIcon;4674 }4675 }4676 break;4677 }4678 case SP_DirClosedIcon:4679 case SP_DirIcon:4680 {4681 pixmap = d->findIcon(24, QLatin1String("gnome-fs-directory.png"));4682 if (!pixmap.isNull())4683 return pixmap;4684 break;4685 }4686 case SP_DirLinkIcon:4687 {4688 pixmap = d->findIcon(24, QLatin1String("emblem-symbolic-link.png"));4689 if (!pixmap.isNull()) {4690 QPixmap dirIcon = d->findIcon(24, QLatin1String("gnome-fs-directory.png"));4691 if (!dirIcon.isNull()) {4692 QPainter painter(&dirIcon);4693 painter.setRenderHint(QPainter::SmoothPixmapTransform);4694 painter.drawPixmap(12, 12, 12, 12, pixmap);4695 return dirIcon;4696 }4697 }4698 break;4699 }4700 case SP_DriveFDIcon:4701 {4702 pixmap = d->findIcon(24, QLatin1String("gnome-dev-floppy.png"));4703 if (!pixmap.isNull())4704 return pixmap;4705 break;4706 }4707 case SP_ComputerIcon:4708 {4709 pixmap = d->findIcon(24, QLatin1String("gnome-fs-client.png"));4710 if (!pixmap.isNull())4711 return pixmap;4712 break;4713 }4714 case SP_DesktopIcon:4715 {4716 pixmap = d->findIcon(24, QLatin1String("gnome-fs-desktop.png"));4717 if (!pixmap.isNull())4718 return pixmap;4719 break;4720 }4721 case SP_TrashIcon:4722 {4723 pixmap = d->findIcon(24, QLatin1String("gnome-fs-trash-empty.png"));4724 if (!pixmap.isNull())4725 return pixmap;4726 break;4727 }4728 case SP_DriveCDIcon:4729 case SP_DriveDVDIcon:4730 {4731 pixmap = d->findIcon(24, QLatin1String("gnome-dev-cdrom.png"));4732 if (!pixmap.isNull())4733 return pixmap;4734 break;4735 }4736 case SP_DriveHDIcon:4737 {4738 pixmap = d->findIcon(24, QLatin1String("gnome-dev-harddisk.png"));4739 if (!pixmap.isNull())4740 return pixmap;4741 break;4742 }4743 case SP_FileDialogToParent:4744 {4745 pixmap = d->findIcon(16, QLatin1String("stock_up.png"));4746 if (!pixmap.isNull())4747 return pixmap;4748 break;4749 }4750 case SP_FileDialogNewFolder:4751 {4752 pixmap = d->findIcon(16, QLatin1String("stock_new-dir.png"));4753 if (!pixmap.isNull())4754 return pixmap;4755 break;4756 }4757 case SP_ArrowUp:4758 {4759 pixmap = d->findIcon(16, QLatin1String("stock_up.png"));4760 if (!pixmap.isNull())4761 return pixmap;4762 break;4763 }4764 case SP_ArrowDown:4765 {4766 pixmap = d->findIcon(16, QLatin1String("stock_down.png"));4767 if (!pixmap.isNull())4768 return pixmap;4769 break;4770 }4771 case SP_ArrowRight:4772 {4773 pixmap = d->findIcon(16, QLatin1String("stock_right.png"));4774 if (!pixmap.isNull())4775 return pixmap;4776 break;4777 }4778 case SP_ArrowLeft:4779 {4780 pixmap = d->findIcon(16, QLatin1String("stock_left.png"));4781 if (!pixmap.isNull())4782 return pixmap;4783 break;4784 }4785 case SP_DialogCloseButton:4786 {4787 pixmap = d->findIcon(24, QLatin1String("gtk-close.png"));4788 if (pixmap.isNull())4789 pixmap = d->findIcon(24, QLatin1String("stock-close.png"));4790 if (!pixmap.isNull())4791 return pixmap;4792 break;4793 }4794 case SP_DialogApplyButton:4795 {4796 pixmap = d->findIcon(24, QLatin1String("dialog-apply.png"));4797 if (pixmap.isNull())4798 pixmap = d->findIcon(24, QLatin1String("stock-apply.png"));4799 if (!pixmap.isNull())4800 return pixmap;4801 break;4802 }4803 case SP_DialogResetButton:4804 {4805 pixmap = d->findIcon(24, QLatin1String("gtk-clear.png"));4806 if (!pixmap.isNull())4807 return pixmap;4808 break;4809 }4810 case SP_DialogHelpButton:4811 {4812 pixmap = d->findIcon(24, QLatin1String("gtk-help.png"));4813 if (!pixmap.isNull())4814 return pixmap;4815 break;4816 }4817 case SP_DialogOkButton:4818 {4819 pixmap = d->findIcon(24, QLatin1String("dialog-ok.png"));4820 if (pixmap.isNull())4821 pixmap = d->findIcon(24, QLatin1String("stock-ok.png"));4822 if (!pixmap.isNull())4823 return pixmap;4824 break;4825 }4826 case SP_DialogCancelButton:4827 {4828 pixmap = d->findIcon(24, QLatin1String("dialog-cancel.png"));4829 if (pixmap.isNull())4830 pixmap = d->findIcon(24, QLatin1String("stock-cancel.png"));4831 if (pixmap.isNull())4832 pixmap = d->findIcon(24, QLatin1String("process-stop.png"));4833 if (!pixmap.isNull())4834 return pixmap;4835 break;4836 }4837 case SP_DialogSaveButton:4838 {4839 pixmap = d->findIcon(24, QLatin1String("stock_save.png"));4840 if (!pixmap.isNull())4841 return pixmap;4842 break;4843 }4844 case SP_BrowserStop:4845 {4846 pixmap = d->findIcon(16, QLatin1String("process-stop.png"));4847 if (!pixmap.isNull())4848 return pixmap;4849 break;4850 }4851 case SP_BrowserReload:4852 {4853 pixmap = d->findIcon(16, QLatin1String("view-refresh.png"));4854 if (!pixmap.isNull())4855 return pixmap;4856 break;4857 }4858 case SP_MediaPlay:4859 {4860 pixmap = d->findIcon(24, QLatin1String("media-playback-start.png"));4861 if (!pixmap.isNull())4862 return pixmap;4863 break;4864 }4865 case SP_MediaPause:4866 {4867 pixmap = d->findIcon(24, QLatin1String("media-playback-pause.png"));4868 if (!pixmap.isNull())4869 return pixmap;4870 break;4871 }4872 case SP_MediaStop:4873 {4874 pixmap = d->findIcon(24, QLatin1String("media-playback-stop.png"));4875 if (!pixmap.isNull())4876 return pixmap;4877 break;4878 }4879 case SP_MediaVolume:4880 {4881 pixmap = d->findIcon(16, QLatin1String("audio-volume-medium.png"));4882 if (!pixmap.isNull())4883 return pixmap;4884 break;4885 }4886 case SP_MediaVolumeMuted:4887 {4888 pixmap = d->findIcon(16, QLatin1String("audio-volume-muted.png"));4889 if (!pixmap.isNull())4890 return pixmap;4891 break;4892 }4893 case SP_MediaSeekForward:4894 {4895 pixmap = d->findIcon(24, QLatin1String("media-seek-forward.png"));4896 if (!pixmap.isNull())4897 return pixmap;4898 break;4899 }4900 case SP_MediaSeekBackward:4901 {4902 pixmap = d->findIcon(24, QLatin1String("media-seek-backward.png"));4903 if (!pixmap.isNull())4904 return pixmap;4905 break;4906 }4907 case SP_MediaSkipForward:4908 {4909 pixmap = d->findIcon(24, QLatin1String("media-skip-forward.png"));4910 if (!pixmap.isNull())4911 return pixmap;4912 break;4913 }4914 case SP_MediaSkipBackward:4915 {4916 pixmap = d->findIcon(24, QLatin1String("media-skip-backward.png"));4917 if (!pixmap.isNull())4918 return pixmap;4919 break;4920 }4921 case SP_TitleBarMenuButton:4922 case SP_TitleBarShadeButton:4923 case SP_TitleBarUnshadeButton:4924 case SP_TitleBarMaxButton:4925 case SP_TitleBarContextHelpButton:4926 return QWindowsStyle::standardPixmap(standardPixmap, opt, widget);4927 4450 case SP_TitleBarNormalButton: 4928 4451 return QPixmap((const char **)dock_widget_restore_xpm); … … 4937 4460 } 4938 4461 #endif //QT_NO_IMAGEFORMAT_XPM 4939 #endif //Q_WS_X11 4462 4940 4463 return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); 4941 4464 } -
trunk/src/gui/styles/qcleanlooksstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qcleanlooksstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 72 72 ~QCleanlooksStylePrivate() { 73 73 } 74 75 void lookupIconTheme() const;76 74 }; 77 75 -
trunk/src/gui/styles/qcommonstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 64 64 #include <qtoolbutton.h> 65 65 #include <qrubberband.h> 66 #include <private/qapplication_p.h>67 66 #include <private/qcommonstylepixmaps_p.h> 68 67 #include <private/qmath_p.h> 68 #include <private/qstylehelper_p.h> 69 69 #include <qdebug.h> 70 70 #include <qtextformat.h> … … 75 75 #include <qsettings.h> 76 76 #include <qpixmapcache.h> 77 #include <private/qguiplatformplugin_p.h> 77 78 78 79 #include <limits.h> … … 84 85 #ifdef Q_WS_X11 85 86 # include <private/qt_x11_p.h> 87 #elif defined(Q_WS_MAC) 88 # include <private/qt_cocoa_helpers_mac_p.h> 86 89 #endif 87 90 … … 125 128 126 129 /*! 127 \overload 128 129 Destroys the style 130 Destroys the style. 130 131 */ 131 132 QCommonStyle::~QCommonStyle() … … 155 156 break; 156 157 case PE_IndicatorViewItemCheck: 157 drawPrimitive(PE_IndicatorCheckBox, opt, p, widget);158 proxy()->drawPrimitive(PE_IndicatorCheckBox, opt, p, widget); 158 159 break; 159 160 case PE_IndicatorCheckBox: … … 505 506 } 506 507 507 int size = p ixelMetric(QStyle::PM_SmallIconSize);508 int size = proxy()->pixelMetric(QStyle::PM_SmallIconSize); 508 509 QIcon::Mode mode = opt->state & State_Enabled ? 509 510 (opt->state & State_Raised ? QIcon::Active : QIcon::Normal) … … 516 517 QIcon::State state = opt->state & State_Sunken ? QIcon::On : QIcon::Off; 517 518 QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(size, mode, state); 518 drawItemPixmap(p, opt->rect, Qt::AlignCenter, pixmap);519 proxy()->drawItemPixmap(p, opt->rect, Qt::AlignCenter, pixmap); 519 520 break; 520 521 } … … 525 526 break; 526 527 case PE_FrameLineEdit: 527 drawPrimitive(PE_Frame, opt, p, widget);528 proxy()->drawPrimitive(PE_Frame, opt, p, widget); 528 529 break; 529 530 #ifndef QT_NO_GROUPBOX … … 550 551 int lw = frame->lineWidth; 551 552 if (lw <= 0) 552 lw = p ixelMetric(PM_DockWidgetFrameWidth);553 lw = proxy()->pixelMetric(PM_DockWidgetFrameWidth); 553 554 554 555 qDrawShadePanel(p, frame->rect, frame->palette, false, lw); … … 562 563 if (opt->state & State_Horizontal) { 563 564 int x = opt->rect.width() / 3; 564 if ( QApplication::layoutDirection()== Qt::RightToLeft)565 if (opt->direction == Qt::RightToLeft) 565 566 x -= 2; 566 567 if (opt->rect.height() > 4) { … … 582 583 break; 583 584 case PE_Q3DockWindowSeparator: 584 drawPrimitive(PE_IndicatorToolBarSeparator, opt, p, widget);585 proxy()->drawPrimitive(PE_IndicatorToolBarSeparator, opt, p, widget); 585 586 break; 586 587 case PE_IndicatorToolBarSeparator: … … 602 603 case PE_IndicatorSpinMinus: { 603 604 QRect r = opt->rect; 604 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);605 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 605 606 QRect br = r.adjusted(fw, fw, -fw, -fw); 606 607 … … 619 620 case PE_IndicatorSpinDown: { 620 621 QRect r = opt->rect; 621 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);622 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 622 623 // QRect br = r.adjusted(fw, fw, -fw, -fw); 623 624 int x = r.x(), y = r.y(), w = r.width(), h = r.height(); … … 644 645 int bsy = 0; 645 646 if (opt->state & State_Sunken) { 646 bsx = p ixelMetric(PM_ButtonShiftHorizontal);647 bsy = p ixelMetric(PM_ButtonShiftVertical);647 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); 648 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); 648 649 } 649 650 p->save(); … … 694 695 695 696 if (panel->lineWidth > 0) 696 drawPrimitive(PE_FrameLineEdit, panel, p, widget);697 proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget); 697 698 } 698 699 break; … … 766 767 cg = QPalette::Inactive; 767 768 768 if ((vopt->state & QStyle::State_Selected) && styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget))769 if ((vopt->state & QStyle::State_Selected) && proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget)) 769 770 p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight)); 770 771 else if (vopt->features & QStyleOptionViewItemV2::Alternate) … … 835 836 #endif // QT_NO_TOOLBUTTON 836 837 837 838 839 #ifdef Q_WS_X11 // These functions are used to parse the X11 freedesktop icon spec840 841 void QCommonStylePrivate::lookupIconTheme() const842 {843 if (!themeName.isEmpty())844 return;845 846 QString dataDirs = QString::fromLocal8Bit(getenv("XDG_DATA_DIRS"));847 if (dataDirs.isEmpty())848 dataDirs = QLatin1String("/usr/local/share/:/usr/share/");849 dataDirs += QLatin1Char(':') + QApplicationPrivate::kdeHome() + QLatin1String("/share");850 dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));851 QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'));852 foreach (const QString &dirName, kdeDirs)853 dataDirs.append(QLatin1String(":") + dirName + QLatin1String("/share"));854 iconDirs = dataDirs.split(QLatin1Char(':'));855 856 QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde"));857 QDir dir(fileInfo.canonicalFilePath());858 int kdeVersion = qgetenv("KDE_SESSION_VERSION").toInt();859 QString kdeDefault = kdeVersion >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");860 QString defaultTheme = fileInfo.exists() ? dir.dirName() : kdeDefault;861 QSettings settings(QApplicationPrivate::kdeHome() +862 QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);863 settings.beginGroup(QLatin1String("Icons"));864 themeName = settings.value(QLatin1String("Theme"), defaultTheme).toString();865 }866 867 QIconTheme QCommonStylePrivate::parseIndexFile(const QString &themeName) const868 {869 Q_Q(const QCommonStyle);870 QIconTheme theme;871 QFile themeIndex;872 QStringList parents;873 QHash <int, QString> dirList;874 875 for ( int i = 0 ; i < iconDirs.size() && !themeIndex.exists() ; ++i) {876 QString contentDir = QLatin1String(iconDirs[i].startsWith(QDir::homePath()) ?877 "/.icons/" : "/icons/");878 themeIndex.setFileName(iconDirs[i] + contentDir +879 themeName + QLatin1String("/index.theme"));880 }881 882 if (themeIndex.open(QIODevice::ReadOnly | QIODevice::Text)) {883 884 QTextStream in(&themeIndex);885 886 while (!in.atEnd()) {887 888 QString line = in.readLine();889 890 if (line.startsWith(QLatin1String("Inherits="))) {891 line = line.right(line.length() - 9);892 parents = line.split(QLatin1Char(','));893 }894 895 if (line.startsWith(QLatin1String("["))) {896 line = line.trimmed();897 line.chop(1);898 QString dirName = line.right(line.length() - 1);899 if (!in.atEnd()) {900 line = in.readLine();901 int size;902 if (line.startsWith(QLatin1String("Size="))) {903 size = line.right(line.length() - 5).toInt();904 if (size)905 dirList.insertMulti(size, dirName);906 }907 }908 }909 }910 }911 912 if (q->inherits("QPlastiqueStyle")) {913 QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde"));914 QDir dir(fileInfo.canonicalFilePath());915 QString defaultKDETheme = dir.exists() ? dir.dirName() : QString::fromLatin1("crystalsvg");916 if (!parents.contains(defaultKDETheme) && themeName != defaultKDETheme)917 parents.append(defaultKDETheme);918 } else if (parents.isEmpty() && themeName != QLatin1String("hicolor")) {919 parents.append(QLatin1String("hicolor"));920 }921 theme = QIconTheme(dirList, parents);922 return theme;923 }924 925 QPixmap QCommonStylePrivate::findIconHelper(int size,926 const QString &themeName,927 const QString &iconName,928 QStringList &visited) const929 {930 QPixmap pixmap;931 932 if (!themeName.isEmpty()) {933 934 visited << themeName;935 QIconTheme theme = themeList.value(themeName);936 937 if (!theme.isValid()) {938 theme = parseIndexFile(themeName);939 themeList.insert(themeName, theme);940 }941 942 if (!theme.isValid())943 return QPixmap();944 945 QList <QString> subDirs = theme.dirList().values(size);946 947 for ( int i = 0 ; i < iconDirs.size() ; ++i) {948 for ( int j = 0 ; j < subDirs.size() ; ++j) {949 QString contentDir = (iconDirs[i].startsWith(QDir::homePath())) ?950 QLatin1String("/.icons/") : QLatin1String("/icons/");951 QString fileName = iconDirs[i] + contentDir + themeName + QLatin1Char('/') + subDirs[j] + QLatin1Char('/') + iconName;952 QFile file(fileName);953 if (file.exists())954 pixmap.load(fileName);955 if (!pixmap.isNull())956 break;957 }958 }959 960 if (pixmap.isNull()) {961 QStringList parents = theme.parents();962 //search recursively through inherited themes963 for (int i = 0 ; pixmap.isNull() && i < parents.size() ; ++i) {964 QString parentTheme = parents[i].trimmed();965 if (!visited.contains(parentTheme)) //guard against endless recursion966 pixmap = findIconHelper(size, parentTheme, iconName, visited);967 }968 }969 }970 return pixmap;971 }972 973 QPixmap QCommonStylePrivate::findIcon(int size, const QString &name) const974 {975 QPixmap pixmap;976 QString pixmapName = QLatin1String("$qt") + name + QString::number(size);977 978 if (QPixmapCache::find(pixmapName, pixmap))979 return pixmap;980 981 if (!themeName.isEmpty()) {982 QStringList visited;983 pixmap = findIconHelper(size, themeName, name, visited);984 }985 QPixmapCache::insert(pixmapName, pixmap);986 return pixmap;987 }988 989 QIcon QCommonStylePrivate::createIcon(const QString &name) const990 {991 QIcon icon;992 icon.addPixmap(findIcon(16, name));993 icon.addPixmap(findIcon(24, name));994 icon.addPixmap(findIcon(32, name));995 return icon;996 }997 998 #endif //Q_WS_X11999 1000 838 #ifndef QT_NO_ITEMVIEWS 1001 1002 839 1003 840 QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, int role) const … … 1048 885 } 1049 886 textLayout.endLayout(); 1050 const QSize size = QSizeF(widthUsed, height).toSize();887 const QSize size(qCeil(widthUsed), qCeil(height)); 1051 888 return QSize(size.width() + 2 * textMargin, size.height()); 1052 889 } … … 1153 990 } 1154 991 1155 /* Set sizehint to false to layout the elements inside opt->rect. Set sizehint to true to ignore 1156 opt->rect and return rectangles in infinite space */ 992 /*! \internal 993 compute the position for the different component of an item (pixmap, text, checkbox) 994 995 Set sizehint to false to layout the elements inside opt->rect. Set sizehint to true to ignore 996 opt->rect and return rectangles in infinite space 997 998 Code duplicated in QItemDelegate::doLayout 999 */ 1157 1000 void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItemV4 *opt, QRect *checkRect, 1158 1001 QRect *pixmapRect, QRect *textRect, bool sizehint) const … … 1175 1018 int w, h; 1176 1019 1177 if (textRect->height() == 0 && !hasPixmap) 1020 if (textRect->height() == 0 && (!hasPixmap || !sizehint)) { 1021 //if there is no text, we still want to have a decent height for the item sizeHint and the editor size 1178 1022 textRect->setHeight(opt->fontMetrics.height()); 1023 } 1179 1024 1180 1025 QSize pm(0, 0); … … 1280 1125 #endif // QT_NO_ITEMVIEWS 1281 1126 1127 1128 #ifndef QT_NO_TABBAR 1129 /*! \internal 1130 Compute the textRect and the pixmapRect from the opt rect 1131 1132 Uses the same computation than in QTabBar::tabSizeHint 1133 */ 1134 void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const 1135 { 1136 Q_ASSERT(textRect); 1137 Q_ASSERT(iconRect); 1138 QRect tr = opt->rect; 1139 bool verticalTabs = opt->shape == QTabBar::RoundedEast 1140 || opt->shape == QTabBar::RoundedWest 1141 || opt->shape == QTabBar::TriangularEast 1142 || opt->shape == QTabBar::TriangularWest; 1143 if (verticalTabs) 1144 tr.setRect(0, 0, tr.height(), tr.width()); //0, 0 as we will have a translate transform 1145 1146 int verticalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftVertical, opt, widget); 1147 int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget); 1148 int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; 1149 int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; 1150 if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) 1151 verticalShift = -verticalShift; 1152 tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding); 1153 bool selected = opt->state & QStyle::State_Selected; 1154 if (selected) { 1155 tr.setBottom(tr.bottom() - verticalShift); 1156 tr.setRight(tr.right() - horizontalShift); 1157 } 1158 1159 // left widget 1160 if (!opt->leftButtonSize.isEmpty()) { 1161 tr.setLeft(tr.left() + 4 + 1162 (verticalTabs ? opt->leftButtonSize.height() : opt->leftButtonSize.width())); 1163 } 1164 // right widget 1165 if (!opt->rightButtonSize.isEmpty()) { 1166 tr.setRight(tr.right() - 4 - 1167 (verticalTabs ? opt->rightButtonSize.height() : opt->rightButtonSize.width())); 1168 } 1169 1170 // icon 1171 if (!opt->icon.isNull()) { 1172 QSize iconSize = opt->iconSize; 1173 if (!iconSize.isValid()) { 1174 int iconExtent = proxyStyle->pixelMetric(QStyle::PM_SmallIconSize); 1175 iconSize = QSize(iconExtent, iconExtent); 1176 } 1177 QSize tabIconSize = opt->icon.actualSize(iconSize, 1178 (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, 1179 (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off ); 1180 1181 *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2, 1182 tabIconSize.width(), tabIconSize .height()); 1183 if (!verticalTabs) 1184 *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect); 1185 tr.setLeft(tr.left() + tabIconSize.width() + 4); 1186 } 1187 1188 if (!verticalTabs) 1189 tr = proxyStyle->visualRect(opt->direction, opt->rect, tr); 1190 1191 *textRect = tr; 1192 } 1193 #endif //QT_NO_TABBAR 1194 1195 1282 1196 /*! 1283 1197 \reimp … … 1291 1205 case CE_PushButton: 1292 1206 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { 1293 drawControl(CE_PushButtonBevel, btn, p, widget);1207 proxy()->drawControl(CE_PushButtonBevel, btn, p, widget); 1294 1208 QStyleOptionButton subopt = *btn; 1295 1209 subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); 1296 drawControl(CE_PushButtonLabel, &subopt, p, widget);1210 proxy()->drawControl(CE_PushButtonLabel, &subopt, p, widget); 1297 1211 if (btn->state & State_HasFocus) { 1298 1212 QStyleOptionFocusRect fropt; 1299 1213 fropt.QStyleOption::operator=(*btn); 1300 1214 fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget); 1301 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);1215 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 1302 1216 } 1303 1217 } … … 1306 1220 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { 1307 1221 QRect br = btn->rect; 1308 int dbi = p ixelMetric(PM_ButtonDefaultIndicator, btn, widget);1222 int dbi = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); 1309 1223 if (btn->features & QStyleOptionButton::DefaultButton) 1310 drawPrimitive(PE_FrameDefaultButton, opt, p, widget);1224 proxy()->drawPrimitive(PE_FrameDefaultButton, opt, p, widget); 1311 1225 if (btn->features & QStyleOptionButton::AutoDefaultButton) 1312 1226 br.setCoords(br.left() + dbi, br.top() + dbi, br.right() - dbi, br.bottom() - dbi); … … 1316 1230 QStyleOptionButton tmpBtn = *btn; 1317 1231 tmpBtn.rect = br; 1318 drawPrimitive(PE_PanelButtonCommand, &tmpBtn, p, widget);1232 proxy()->drawPrimitive(PE_PanelButtonCommand, &tmpBtn, p, widget); 1319 1233 } 1320 1234 if (btn->features & QStyleOptionButton::HasMenu) { 1321 int mbi = p ixelMetric(PM_MenuButtonIndicator, btn, widget);1235 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, btn, widget); 1322 1236 QRect ir = btn->rect; 1323 1237 QStyleOptionButton newBtn = *btn; 1324 1238 newBtn.rect = QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6); 1325 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);1239 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 1326 1240 } 1327 1241 } … … 1331 1245 QRect textRect = button->rect; 1332 1246 uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic; 1333 if (! styleHint(SH_UnderlineShortcut, button, widget))1247 if (!proxy()->styleHint(SH_UnderlineShortcut, button, widget)) 1334 1248 tf |= Qt::TextHideMnemonic; 1335 1249 … … 1366 1280 1367 1281 if (button->state & (State_On | State_Sunken)) 1368 iconRect.translate(p ixelMetric(PM_ButtonShiftHorizontal, opt, widget),1369 p ixelMetric(PM_ButtonShiftVertical, opt, widget));1282 iconRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), 1283 proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget)); 1370 1284 p->drawPixmap(iconRect, pixmap); 1371 1285 } else { … … 1373 1287 } 1374 1288 if (button->state & (State_On | State_Sunken)) 1375 textRect.translate(p ixelMetric(PM_ButtonShiftHorizontal, opt, widget),1376 p ixelMetric(PM_ButtonShiftVertical, opt, widget));1289 textRect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, widget), 1290 proxy()->pixelMetric(PM_ButtonShiftVertical, opt, widget)); 1377 1291 1378 1292 if (button->features & QStyleOptionButton::HasMenu) { 1379 int indicatorSize = p ixelMetric(PM_MenuButtonIndicator, button, widget);1293 int indicatorSize = proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget); 1380 1294 if (button->direction == Qt::LeftToRight) 1381 1295 textRect = textRect.adjusted(0, 0, -indicatorSize, 0); … … 1383 1297 textRect = textRect.adjusted(indicatorSize, 0, 0, 0); 1384 1298 } 1385 drawItemText(p, textRect, tf, button->palette, (button->state & State_Enabled),1299 proxy()->drawItemText(p, textRect, tf, button->palette, (button->state & State_Enabled), 1386 1300 button->text, QPalette::ButtonText); 1387 1301 } … … 1394 1308 subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator 1395 1309 : SE_CheckBoxIndicator, btn, widget); 1396 drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox,1310 proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, 1397 1311 &subopt, p, widget); 1398 1312 subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents 1399 1313 : SE_CheckBoxContents, btn, widget); 1400 drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, p, widget);1314 proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, p, widget); 1401 1315 if (btn->state & State_HasFocus) { 1402 1316 QStyleOptionFocusRect fropt; … … 1404 1318 fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect 1405 1319 : SE_CheckBoxFocusRect, btn, widget); 1406 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);1320 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 1407 1321 } 1408 1322 } … … 1413 1327 uint alignment = visualAlignment(btn->direction, Qt::AlignLeft | Qt::AlignVCenter); 1414 1328 1415 if (! styleHint(SH_UnderlineShortcut, btn, widget))1329 if (!proxy()->styleHint(SH_UnderlineShortcut, btn, widget)) 1416 1330 alignment |= Qt::TextHideMnemonic; 1417 1331 QPixmap pix; … … 1419 1333 if (!btn->icon.isNull()) { 1420 1334 pix = btn->icon.pixmap(btn->iconSize, btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled); 1421 drawItemPixmap(p, btn->rect, alignment, pix);1335 proxy()->drawItemPixmap(p, btn->rect, alignment, pix); 1422 1336 if (btn->direction == Qt::RightToLeft) 1423 1337 textRect.setRight(textRect.right() - btn->iconSize.width() - 4); … … 1426 1340 } 1427 1341 if (!btn->text.isEmpty()){ 1428 drawItemText(p, textRect, alignment | Qt::TextShowMnemonic,1342 proxy()->drawItemText(p, textRect, alignment | Qt::TextShowMnemonic, 1429 1343 btn->palette, btn->state & State_Enabled, btn->text, QPalette::WindowText); 1430 1344 } … … 1436 1350 QStyleOption arrowOpt = *opt; 1437 1351 arrowOpt.state |= State_Enabled; 1438 drawPrimitive(((opt->state & State_DownArrow) ? PE_IndicatorArrowDown : PE_IndicatorArrowUp),1352 proxy()->drawPrimitive(((opt->state & State_DownArrow) ? PE_IndicatorArrowDown : PE_IndicatorArrowUp), 1439 1353 &arrowOpt, p, widget); 1440 1354 break; } … … 1458 1372 uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip 1459 1373 | Qt::TextSingleLine; 1460 if (! styleHint(SH_UnderlineShortcut, mbi, widget))1374 if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) 1461 1375 alignment |= Qt::TextHideMnemonic; 1462 QPixmap pix = mbi->icon.pixmap(p ixelMetric(PM_SmallIconSize), (mbi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);1376 QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (mbi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); 1463 1377 if (!pix.isNull()) 1464 drawItemPixmap(p,mbi->rect, alignment, pix);1378 proxy()->drawItemPixmap(p,mbi->rect, alignment, pix); 1465 1379 else 1466 drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled,1380 proxy()->drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, 1467 1381 mbi->text, QPalette::ButtonText); 1468 1382 } … … 1479 1393 QStyleOptionProgressBarV2 subopt = *pb; 1480 1394 subopt.rect = subElementRect(SE_ProgressBarGroove, pb, widget); 1481 drawControl(CE_ProgressBarGroove, &subopt, p, widget);1395 proxy()->drawControl(CE_ProgressBarGroove, &subopt, p, widget); 1482 1396 subopt.rect = subElementRect(SE_ProgressBarContents, pb, widget); 1483 drawControl(CE_ProgressBarContents, &subopt, p, widget);1397 proxy()->drawControl(CE_ProgressBarContents, &subopt, p, widget); 1484 1398 if (pb->textVisible) { 1485 1399 subopt.rect = subElementRect(SE_ProgressBarLabel, pb, widget); 1486 drawControl(CE_ProgressBarLabel, &subopt, p, widget);1400 proxy()->drawControl(CE_ProgressBarLabel, &subopt, p, widget); 1487 1401 } 1488 1402 } … … 1510 1424 QPalette shadowPalette = pb->palette; 1511 1425 shadowPalette.setColor(textRole, shadowColor); 1512 drawItemText(p, shadowRect, Qt::AlignCenter | Qt::TextSingleLine, shadowPalette,1426 proxy()->drawItemText(p, shadowRect, Qt::AlignCenter | Qt::TextSingleLine, shadowPalette, 1513 1427 pb->state & State_Enabled, pb->text, textRole); 1514 1428 } 1515 drawItemText(p, pb->rect, Qt::AlignCenter | Qt::TextSingleLine, pb->palette,1429 proxy()->drawItemText(p, pb->rect, Qt::AlignCenter | Qt::TextSingleLine, pb->palette, 1516 1430 pb->state & State_Enabled, pb->text, textRole); 1517 1431 } … … 1560 1474 p->drawLine(x, rect.y(), x, rect.height()); 1561 1475 } else { 1562 const int unit_width = p ixelMetric(PM_ProgressBarChunkWidth, pb, widget);1476 const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget); 1563 1477 if (!unit_width) 1564 1478 return; … … 1602 1516 pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); 1603 1517 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); 1604 drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget);1518 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); 1605 1519 x += reverse ? -unit_width : unit_width; 1606 1520 } … … 1613 1527 pbBits.rect.setRect(offset, myY, pixels_left, myHeight); 1614 1528 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); 1615 drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget);1529 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); 1616 1530 } 1617 1531 } … … 1624 1538 if (!header->icon.isNull()) { 1625 1539 QPixmap pixmap 1626 = header->icon.pixmap(p ixelMetric(PM_SmallIconSize), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);1540 = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); 1627 1541 int pixw = pixmap.width(); 1628 1542 … … 1641 1555 p->setFont(fnt); 1642 1556 } 1643 drawItemText(p, rect, header->textAlignment, header->palette,1557 proxy()->drawItemText(p, rect, header->textAlignment, header->palette, 1644 1558 (header->state & State_Enabled), header->text, QPalette::ButtonText); 1645 1559 } … … 1653 1567 int shiftY = 0; 1654 1568 if (toolbutton->state & (State_Sunken | State_On)) { 1655 shiftX = p ixelMetric(PM_ButtonShiftHorizontal, toolbutton, widget);1656 shiftY = p ixelMetric(PM_ButtonShiftVertical, toolbutton, widget);1569 shiftX = proxy()->pixelMetric(PM_ButtonShiftHorizontal, toolbutton, widget); 1570 shiftY = proxy()->pixelMetric(PM_ButtonShiftVertical, toolbutton, widget); 1657 1571 } 1658 1572 // Arrow type always overrules and is always shown … … 1661 1575 || toolbutton->toolButtonStyle == Qt::ToolButtonTextOnly) { 1662 1576 int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; 1663 if (! styleHint(SH_UnderlineShortcut, opt, widget))1577 if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) 1664 1578 alignment |= Qt::TextHideMnemonic; 1665 1579 rect.translate(shiftX, shiftY); 1666 drawItemText(p, rect, alignment, toolbutton->palette, 1580 p->setFont(toolbutton->font); 1581 proxy()->drawItemText(p, rect, alignment, toolbutton->palette, 1667 1582 opt->state & State_Enabled, toolbutton->text, 1668 1583 QPalette::ButtonText); … … 1689 1604 tr = rect; 1690 1605 int alignment = Qt::TextShowMnemonic; 1691 if (! styleHint(SH_UnderlineShortcut, opt, widget))1606 if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) 1692 1607 alignment |= Qt::TextHideMnemonic; 1693 1608 1694 1609 if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { 1695 1610 pr.setHeight(pmSize.height() + 6); 1696 tr.adjust(0, pr.height() , 0, -3);1611 tr.adjust(0, pr.height() - 1, 0, -3); 1697 1612 pr.translate(shiftX, shiftY); 1698 1613 if (!hasArrow) { 1699 drawItemPixmap(p, pr, Qt::AlignCenter, pm);1614 proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm); 1700 1615 } else { 1701 1616 drawArrow(this, toolbutton, pr, p, widget); … … 1707 1622 pr.translate(shiftX, shiftY); 1708 1623 if (!hasArrow) { 1709 drawItemPixmap(p, QStyle::visualRect(opt->direction, rect, pr), Qt::AlignCenter, pm);1624 proxy()->drawItemPixmap(p, QStyle::visualRect(opt->direction, rect, pr), Qt::AlignCenter, pm); 1710 1625 } else { 1711 1626 drawArrow(this, toolbutton, pr, p, widget); … … 1714 1629 } 1715 1630 tr.translate(shiftX, shiftY); 1716 drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette,1631 proxy()->drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette, 1717 1632 toolbutton->state & State_Enabled, toolbutton->text, 1718 1633 QPalette::ButtonText); … … 1722 1637 drawArrow(this, toolbutton, rect, p, widget); 1723 1638 } else { 1724 drawItemPixmap(p, rect, Qt::AlignCenter, pm);1639 proxy()->drawItemPixmap(p, rect, Qt::AlignCenter, pm); 1725 1640 } 1726 1641 } … … 1732 1647 case CE_ToolBoxTab: 1733 1648 if (const QStyleOptionToolBox *tb = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) { 1734 drawControl(CE_ToolBoxTabShape, tb, p, widget);1735 drawControl(CE_ToolBoxTabLabel, tb, p, widget);1649 proxy()->drawControl(CE_ToolBoxTabShape, tb, p, widget); 1650 proxy()->drawControl(CE_ToolBoxTabLabel, tb, p, widget); 1736 1651 } 1737 1652 break; … … 1779 1694 case CE_TabBarTab: 1780 1695 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { 1781 drawControl(CE_TabBarTabShape, tab, p, widget);1782 drawControl(CE_TabBarTabLabel, tab, p, widget);1696 proxy()->drawControl(CE_TabBarTabShape, tab, p, widget); 1697 proxy()->drawControl(CE_TabBarTabLabel, tab, p, widget); 1783 1698 } 1784 1699 break; … … 1790 1705 bool selected = tab->state & State_Selected; 1791 1706 bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; 1792 int tabOverlap = onlyOne ? 0 : p ixelMetric(PM_TabBarTabOverlap, opt, widget);1707 int tabOverlap = onlyOne ? 0 : proxy()->pixelMetric(PM_TabBarTabOverlap, opt, widget); 1793 1708 1794 1709 if (!selected) { … … 1894 1809 bool enabled = tb->state & State_Enabled; 1895 1810 bool selected = tb->state & State_Selected; 1896 QPixmap pm = tb->icon.pixmap(p ixelMetric(QStyle::PM_SmallIconSize, tb, widget),1811 QPixmap pm = tb->icon.pixmap(proxy()->pixelMetric(QStyle::PM_SmallIconSize, tb, widget), 1897 1812 enabled ? QIcon::Normal : QIcon::Disabled); 1898 1813 … … 1910 1825 } 1911 1826 1912 if (selected && styleHint(QStyle::SH_ToolBox_SelectedPageTitleBold, tb, widget)) {1827 if (selected && proxy()->styleHint(QStyle::SH_ToolBox_SelectedPageTitleBold, tb, widget)) { 1913 1828 QFont f(p->font()); 1914 1829 f.setBold(true); … … 1922 1837 1923 1838 int alignment = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic; 1924 if (! styleHint(QStyle::SH_UnderlineShortcut, tb, widget))1839 if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, tb, widget)) 1925 1840 alignment |= Qt::TextHideMnemonic; 1926 drawItemText(p, tr, alignment, tb->palette, enabled, txt, QPalette::ButtonText);1841 proxy()->drawItemText(p, tr, alignment, tb->palette, enabled, txt, QPalette::ButtonText); 1927 1842 1928 1843 if (!txt.isEmpty() && opt->state & State_HasFocus) { … … 1931 1846 opt.palette = tb->palette; 1932 1847 opt.state = QStyle::State_None; 1933 drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, widget);1848 proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, p, widget); 1934 1849 } 1935 1850 } … … 1937 1852 case CE_TabBarTabLabel: 1938 1853 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { 1939 // ### consider merging this with SE_TabBarTabText1940 1854 QStyleOptionTabV3 tabV2(*tab); 1941 1855 QRect tr = tabV2.rect; … … 1946 1860 1947 1861 int alignment = Qt::AlignCenter | Qt::TextShowMnemonic; 1948 if (! styleHint(SH_UnderlineShortcut, opt, widget))1862 if (!proxy()->styleHint(SH_UnderlineShortcut, opt, widget)) 1949 1863 alignment |= Qt::TextHideMnemonic; 1950 1864 … … 1961 1875 newRot = -90; 1962 1876 } 1963 tr.setRect(0, 0, tr.height(), tr.width()); 1964 QTransform m; 1965 m.translate(newX, newY); 1877 QTransform m = QTransform::fromTranslate(newX, newY); 1966 1878 m.rotate(newRot); 1967 1879 p->setTransform(m, true); 1968 1880 } 1969 tr = subElementRect(SE_TabBarTabText, opt, widget); 1881 QRect iconRect; 1882 d->tabLayout(&tabV2, widget, &tr, &iconRect); 1883 tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); //we compute tr twice because the style may override subElementRect 1970 1884 1971 1885 if (!tabV2.icon.isNull()) { 1972 QSize iconSize = tabV2.iconSize; 1973 if (!iconSize.isValid()) { 1974 int iconExtent = pixelMetric(PM_SmallIconSize); 1975 iconSize = QSize(iconExtent, iconExtent); 1976 } 1977 QSize tabIconSize = tabV2.icon.actualSize(iconSize, 1978 (tabV2.state & State_Enabled) ? QIcon::Normal 1979 : QIcon::Disabled); 1980 QPixmap tabIcon = tabV2.icon.pixmap(iconSize, 1886 QPixmap tabIcon = tabV2.icon.pixmap(tabV2.iconSize, 1981 1887 (tabV2.state & State_Enabled) ? QIcon::Normal 1982 : QIcon::Disabled); 1983 1984 int offset = 4; 1985 int left = opt->rect.left(); 1986 if (tabV2.leftButtonSize.isEmpty()) 1987 offset += 2; 1988 else 1989 left += tabV2.leftButtonSize.width() + (6 + 2) + 2; 1990 QRect iconRect = QRect(left + offset, tr.center().y() - tabIcon.height() / 2, 1991 tabIconSize.width(), tabIconSize.height()); 1992 if (!verticalTabs) 1993 iconRect = visualRect(opt->direction, opt->rect, iconRect); 1888 : QIcon::Disabled, 1889 (tabV2.state & State_Selected) ? QIcon::On 1890 : QIcon::Off); 1994 1891 p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon); 1995 1892 } 1996 1893 1997 drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text, QPalette::WindowText);1894 proxy()->drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text, QPalette::WindowText); 1998 1895 if (verticalTabs) 1999 1896 p->restore(); … … 2106 2003 QRect r = opt->rect; 2107 2004 QStyleHintReturnMask mask; 2108 if ( styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask))2005 if (proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask)) 2109 2006 p->setClipRegion(mask.region); 2110 2007 p->drawTiledPixmap(r.x(), r.y(), r.width(), r.height(), tiledPixmap); … … 2144 2041 2145 2042 const int indent = p->fontMetrics().descent(); 2146 drawItemText(p, r.adjusted(indent + 1, 1, -indent - 1, -1),2043 proxy()->drawItemText(p, r.adjusted(indent + 1, 1, -indent - 1, -1), 2147 2044 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, 2148 2045 dwOpt->state & State_Enabled, dwOpt->title, … … 2159 2056 QRegion clipRegion = p->clipRegion(); 2160 2057 p->setClipRect(opt->rect); 2161 drawControl(CE_HeaderSection, header, p, widget);2058 proxy()->drawControl(CE_HeaderSection, header, p, widget); 2162 2059 QStyleOptionHeader subopt = *header; 2163 2060 subopt.rect = subElementRect(SE_HeaderLabel, header, widget); 2164 2061 if (subopt.rect.isValid()) 2165 drawControl(CE_HeaderLabel, &subopt, p, widget);2062 proxy()->drawControl(CE_HeaderLabel, &subopt, p, widget); 2166 2063 if (header->sortIndicator != QStyleOptionHeader::None) { 2167 2064 subopt.rect = subElementRect(SE_HeaderArrow, opt, widget); 2168 drawPrimitive(PE_IndicatorHeaderArrow, &subopt, p, widget);2065 proxy()->drawPrimitive(PE_IndicatorHeaderArrow, &subopt, p, widget); 2169 2066 } 2170 2067 p->setClipRegion(clipRegion); … … 2185 2082 case CE_ComboBoxLabel: 2186 2083 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { 2187 QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget);2084 QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); 2188 2085 p->save(); 2189 2086 p->setClipRect(editRect); … … 2199 2096 if (cb->editable) 2200 2097 p->fillRect(iconRect, opt->palette.brush(QPalette::Base)); 2201 drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);2098 proxy()->drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); 2202 2099 2203 2100 if (cb->direction == Qt::RightToLeft) … … 2207 2104 } 2208 2105 if (!cb->currentText.isEmpty() && !cb->editable) { 2209 drawItemText(p, editRect.adjusted(1, 0, -1, 0),2106 proxy()->drawItemText(p, editRect.adjusted(1, 0, -1, 0), 2210 2107 visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), 2211 2108 cb->palette, cb->state & State_Enabled, cb->currentText); … … 2223 2120 frame.lineWidth = toolBar->lineWidth; 2224 2121 frame.midLineWidth = toolBar->midLineWidth; 2225 drawPrimitive(PE_PanelToolBar, opt, p, widget);2122 proxy()->drawPrimitive(PE_PanelToolBar, opt, p, widget); 2226 2123 2227 2124 if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) … … 2265 2162 2266 2163 // draw the background 2267 drawPrimitive(PE_PanelItemViewItem, opt, p, widget);2164 proxy()->drawPrimitive(PE_PanelItemViewItem, opt, p, widget); 2268 2165 2269 2166 // draw the check mark 2270 if ( checkRect.isValid()) {2167 if (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) { 2271 2168 QStyleOptionViewItemV4 option(*vopt); 2272 2169 option.rect = checkRect; … … 2284 2181 break; 2285 2182 } 2286 drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, p, widget);2183 proxy()->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, p, widget); 2287 2184 } 2288 2185 … … 2327 2224 o.backgroundColor = vopt->palette.color(cg, (vopt->state & QStyle::State_Selected) 2328 2225 ? QPalette::Highlight : QPalette::Window); 2329 drawPrimitive(QStyle::PE_FrameFocusRect, &o, p, widget);2226 proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, p, widget); 2330 2227 } 2331 2228 … … 2366 2263 widget->style()->drawPrimitive(QStyle::PE_Frame, opt, p, widget); 2367 2264 } else { 2368 drawPrimitive(QStyle::PE_Frame, opt, p, widget);2265 proxy()->drawPrimitive(QStyle::PE_Frame, opt, p, widget); 2369 2266 } 2370 2267 break; … … 2424 2321 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { 2425 2322 int dx1, dx2; 2426 dx1 = p ixelMetric(PM_DefaultFrameWidth, btn, widget);2323 dx1 = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget); 2427 2324 if (btn->features & QStyleOptionButton::AutoDefaultButton) 2428 dx1 += p ixelMetric(PM_ButtonDefaultIndicator, btn, widget);2325 dx1 += proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); 2429 2326 dx2 = dx1 * 2; 2430 2327 r.setRect(opt->rect.x() + dx1, opt->rect.y() + dx1, opt->rect.width() - dx2, … … 2437 2334 int dbw1 = 0, dbw2 = 0; 2438 2335 if (btn->features & QStyleOptionButton::AutoDefaultButton){ 2439 dbw1 = p ixelMetric(PM_ButtonDefaultIndicator, btn, widget);2336 dbw1 = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); 2440 2337 dbw2 = dbw1 * 2; 2441 2338 } 2442 2339 2443 int dfw1 = p ixelMetric(PM_DefaultFrameWidth, btn, widget) + 1,2340 int dfw1 = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget) + 1, 2444 2341 dfw2 = dfw1 * 2; 2445 2342 … … 2451 2348 case SE_CheckBoxIndicator: 2452 2349 { 2453 int h = p ixelMetric(PM_IndicatorHeight, opt, widget);2350 int h = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); 2454 2351 r.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - h) / 2), 2455 p ixelMetric(PM_IndicatorWidth, opt, widget), h);2352 proxy()->pixelMetric(PM_IndicatorWidth, opt, widget), h); 2456 2353 r = visualRect(opt->direction, opt->rect, r); 2457 2354 } … … 2463 2360 QRect ir = visualRect(opt->direction, opt->rect, 2464 2361 subElementRect(SE_CheckBoxIndicator, opt, widget)); 2465 int spacing = p ixelMetric(PM_CheckBoxLabelSpacing, opt, widget);2362 int spacing = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, opt, widget); 2466 2363 r.setRect(ir.right() + spacing, opt->rect.y(), opt->rect.width() - ir.width() - spacing, 2467 2364 opt->rect.height()); … … 2503 2400 case SE_RadioButtonIndicator: 2504 2401 { 2505 int h = p ixelMetric(PM_ExclusiveIndicatorHeight, opt, widget);2402 int h = proxy()->pixelMetric(PM_ExclusiveIndicatorHeight, opt, widget); 2506 2403 r.setRect(opt->rect.x(), opt->rect.y() + ((opt->rect.height() - h) / 2), 2507 p ixelMetric(PM_ExclusiveIndicatorWidth, opt, widget), h);2404 proxy()->pixelMetric(PM_ExclusiveIndicatorWidth, opt, widget), h); 2508 2405 r = visualRect(opt->direction, opt->rect, r); 2509 2406 } … … 2514 2411 QRect ir = visualRect(opt->direction, opt->rect, 2515 2412 subElementRect(SE_RadioButtonIndicator, opt, widget)); 2516 int spacing = p ixelMetric(PM_RadioButtonLabelSpacing, opt, widget);2413 int spacing = proxy()->pixelMetric(PM_RadioButtonLabelSpacing, opt, widget); 2517 2414 r.setRect(ir.left() + ir.width() + spacing, opt->rect.y(), opt->rect.width() - ir.width() - spacing, 2518 2415 opt->rect.height()); … … 2551 2448 case SE_SliderFocusRect: 2552 2449 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 2553 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, slider, widget);2554 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);2450 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); 2451 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 2555 2452 if (slider->orientation == Qt::Horizontal) 2556 2453 r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2); … … 2623 2520 #endif // QT_NO_TOOLBOX 2624 2521 case SE_HeaderLabel: { 2625 int margin = p ixelMetric(QStyle::PM_HeaderMargin, opt, widget);2522 int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); 2626 2523 r.setRect(opt->rect.x() + margin, opt->rect.y() + margin, 2627 2524 opt->rect.width() - margin * 2, opt->rect.height() - margin * 2); … … 2643 2540 int x = opt->rect.x(); 2644 2541 int y = opt->rect.y(); 2645 int margin = p ixelMetric(QStyle::PM_HeaderMargin, opt, widget);2542 int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, opt, widget); 2646 2543 2647 2544 if (opt->state & State_Horizontal) { … … 2679 2576 - twf->leftCornerWidgetSize.width() 2680 2577 - twf->rightCornerWidgetSize.width())); 2681 switch ( styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) {2578 switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { 2682 2579 default: 2683 2580 case Qt::AlignLeft: … … 2701 2598 - twf->leftCornerWidgetSize.width() 2702 2599 - twf->rightCornerWidgetSize.width())); 2703 switch ( styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) {2600 switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { 2704 2601 default: 2705 2602 case Qt::AlignLeft: … … 2726 2623 - twf->leftCornerWidgetSize.height() 2727 2624 - twf->rightCornerWidgetSize.height())); 2728 switch ( styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) {2625 switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { 2729 2626 default: 2730 2627 case Qt::AlignLeft: … … 2748 2645 - twf->leftCornerWidgetSize.height() 2749 2646 - twf->rightCornerWidgetSize.height())); 2750 switch ( styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) {2647 switch (proxy()->styleHint(SH_TabBar_Alignment, twf, widget) & alingMask) { 2751 2648 default: 2752 2649 case Qt::AlignLeft: … … 2770 2667 QStyleOptionTab tabopt; 2771 2668 tabopt.shape = twf->shape; 2772 int overlap = p ixelMetric(PM_TabBarBaseOverlap, &tabopt, widget);2669 int overlap = proxy()->pixelMetric(PM_TabBarBaseOverlap, &tabopt, widget); 2773 2670 if (twf->lineWidth == 0) 2774 2671 overlap = 0; … … 2838 2735 break; 2839 2736 case SE_TabBarTabText: 2840 // ### consider merging this with CE_TabBarTabLabel2841 2737 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { 2842 QStyleOptionTabV3 tabV2(*tab); 2843 QRect tr = tabV2.rect; 2844 bool verticalTabs = tabV2.shape == QTabBar::RoundedEast 2845 || tabV2.shape == QTabBar::RoundedWest 2846 || tabV2.shape == QTabBar::TriangularEast 2847 || tabV2.shape == QTabBar::TriangularWest; 2848 if (verticalTabs) 2849 tr.setRect(0, 0, tr.height(), tr.width()); 2850 int verticalShift = pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget); 2851 int horizontalShift = pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget); 2852 if (tabV2.shape == QTabBar::RoundedSouth || tabV2.shape == QTabBar::TriangularSouth) 2853 verticalShift = -verticalShift; 2854 tr.adjust(0, 0, horizontalShift, verticalShift); 2855 bool selected = tabV2.state & State_Selected; 2856 if (selected) { 2857 tr.setBottom(tr.bottom() - verticalShift); 2858 tr.setRight(tr.right() - horizontalShift); 2859 } 2860 2861 // left widget 2862 if (!tabV2.leftButtonSize.isEmpty()) { 2863 tr.setLeft(tr.left() + 6 + 2 + 2864 (verticalTabs ? tabV2.leftButtonSize.height() : tabV2.leftButtonSize.width())); 2865 } 2866 2867 // icon 2868 if (!tabV2.icon.isNull()) { 2869 QSize iconSize = tabV2.iconSize; 2870 if (!iconSize.isValid()) { 2871 int iconExtent = pixelMetric(PM_SmallIconSize); 2872 iconSize = QSize(iconExtent, iconExtent); 2873 } 2874 QSize tabIconSize = tabV2.icon.actualSize(iconSize, 2875 (tabV2.state & State_Enabled) ? QIcon::Normal 2876 : QIcon::Disabled); 2877 int offset = 4; 2878 if (tabV2.leftButtonSize.isEmpty()) 2879 offset += 2; 2880 2881 QRect iconRect = QRect(tr.left() + offset, tr.center().y() - tabIconSize.height() / 2, 2882 tabIconSize.width(), tabIconSize .height()); 2883 if (!verticalTabs) 2884 iconRect = visualRect(opt->direction, opt->rect, iconRect); 2885 tr.setLeft(tr.left() + tabIconSize.width() + offset + 2); 2886 } 2887 2888 // right widget 2889 if (!tabV2.rightButtonSize.isEmpty()) { 2890 tr.setRight(tr.right() - 6 - 2 - 2891 (verticalTabs ? tabV2.rightButtonSize.height() : tabV2.rightButtonSize.width())); 2892 } 2893 2894 if (!verticalTabs) 2895 tr = visualRect(opt->direction, opt->rect, tr); 2896 r = tr; 2738 QStyleOptionTabV3 tabV3(*tab); 2739 QRect dummyIconRect; 2740 d->tabLayout(&tabV3, widget, &r, &dummyIconRect); 2897 2741 } 2898 2742 break; … … 2901 2745 if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) { 2902 2746 bool selected = tab->state & State_Selected; 2903 int verticalShift = pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget); 2904 int horizontalShift = pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget); 2747 int verticalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget); 2748 int horizontalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget); 2749 int hpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; 2750 hpadding = qMax(hpadding, 4); //workaround KStyle returning 0 because they workaround an old bug in Qt 2905 2751 2906 2752 bool verticalTabs = tab->shape == QTabBar::RoundedEast … … 2917 2763 verticalShift *= -1; 2918 2764 } 2765 if (tab->shape == QTabBar::RoundedWest || tab->shape == QTabBar::TriangularWest) 2766 horizontalShift = -horizontalShift; 2767 2919 2768 tr.adjust(0, 0, horizontalShift, verticalShift); 2920 2769 if (selected) … … 2927 2776 int w = size.width(); 2928 2777 int h = size.height(); 2929 int midHeight = static_cast<int>( ceil(float(tr.height() - h) / 2));2778 int midHeight = static_cast<int>(qCeil(float(tr.height() - h) / 2)); 2930 2779 int midWidth = ((tr.width() - w) / 2); 2931 2780 … … 2942 2791 default: 2943 2792 if (sr == SE_TabBarTabLeftButton) 2944 r = QRect( 6 + tab->rect.x(), midHeight, w, h);2793 r = QRect(tab->rect.x() + hpadding, midHeight, w, h); 2945 2794 else 2946 r = QRect(tab->rect.right() - 6 - w, midHeight, w, h);2795 r = QRect(tab->rect.right() - w - hpadding, midHeight, w, h); 2947 2796 r = visualRect(tab->direction, tab->rect, r); 2948 2797 } 2949 2798 if (verticalTabs) { 2950 2799 if (atTheTop) 2951 r = QRect(midWidth, tr.y() + tab->rect.height() - 6- h, w, h);2800 r = QRect(midWidth, tr.y() + tab->rect.height() - hpadding - h, w, h); 2952 2801 else 2953 r = QRect(midWidth, tr.y() + 6, w, h);2802 r = QRect(midWidth, tr.y() + hpadding, w, h); 2954 2803 } 2955 2804 } … … 2991 2840 case SE_FrameContents: 2992 2841 if (const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) { 2993 int fw = p ixelMetric(PM_DefaultFrameWidth, f, widget);2842 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, f, widget); 2994 2843 r = opt->rect.adjusted(fw, fw, -fw, -fw); 2995 2844 r = visualRect(opt->direction, opt->rect, r); … … 3058 2907 case SE_DockWidgetTitleBarText: 3059 2908 case SE_DockWidgetIcon: { 3060 int iconSize = p ixelMetric(PM_SmallIconSize, opt, widget);3061 int buttonMargin = p ixelMetric(PM_DockWidgetTitleBarButtonMargin, opt, widget);3062 int margin = p ixelMetric(QStyle::PM_DockWidgetTitleMargin, opt, widget);2909 int iconSize = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); 2910 int buttonMargin = proxy()->pixelMetric(PM_DockWidgetTitleBarButtonMargin, opt, widget); 2911 int margin = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, opt, widget); 3063 2912 QRect rect = opt->rect; 3064 2913 … … 3125 2974 icon = dw->windowIcon(); 3126 2975 if (!icon.isNull() 3127 && icon.cacheKey() != qApp->windowIcon().cacheKey()) {2976 && icon.cacheKey() != QApplication::windowIcon().cacheKey()) { 3128 2977 QSize sz = icon.actualSize(QSize(r.height(), r.height())); 3129 2978 if (verticalTitleBar) … … 3170 3019 if (!d->isViewItemCached(*vopt)) { 3171 3020 d->viewItemLayout(vopt, &d->checkRect, &d->decorationRect, &d->displayRect, false); 3172 if (d->cachedOption) 3021 if (d->cachedOption) { 3173 3022 delete d->cachedOption; 3023 d->cachedOption = 0; 3024 } 3174 3025 d->cachedOption = new QStyleOptionViewItemV4(*vopt); 3175 3026 } … … 3183 3034 break; 3184 3035 #endif //QT_NO_ITEMVIEWS 3036 #ifndef QT_NO_TOOLBAR 3037 case SE_ToolBarHandle: 3038 if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { 3039 if (tbopt->features & QStyleOptionToolBar::Movable) { 3040 ///we need to access the widget here because the style option doesn't 3041 //have all the information we need (ie. the layout's margin) 3042 const QToolBar *tb = qobject_cast<const QToolBar*>(widget); 3043 const int margin = tb && tb->layout() ? tb->layout()->margin() : 2; 3044 const int handleExtent = pixelMetric(QStyle::PM_ToolBarHandleExtent, opt, tb); 3045 if (tbopt->state & QStyle::State_Horizontal) { 3046 r = QRect(margin, margin, handleExtent, tbopt->rect.height() - 2*margin); 3047 r = QStyle::visualRect(tbopt->direction, tbopt->rect, r); 3048 } else { 3049 r = QRect(margin, margin, tbopt->rect.width() - 2*margin, handleExtent); 3050 } 3051 } 3052 } 3053 break; 3054 #endif //QT_NO_TOOLBAR 3185 3055 default: 3186 3056 break; … … 3190 3060 3191 3061 #ifndef QT_NO_DIAL 3192 static qreal angle(const QPointF &p1, const QPointF &p2)3193 {3194 static const qreal rad_factor = 180 / Q_PI;3195 qreal _angle = 0;3196 3197 if (p1.x() == p2.x()) {3198 if (p1.y() < p2.y())3199 _angle = 270;3200 else3201 _angle = 90;3202 } else {3203 qreal x1, x2, y1, y2;3204 3205 if (p1.x() <= p2.x()) {3206 x1 = p1.x(); y1 = p1.y();3207 x2 = p2.x(); y2 = p2.y();3208 } else {3209 x2 = p1.x(); y2 = p1.y();3210 x1 = p2.x(); y1 = p2.y();3211 }3212 3213 qreal m = -(y2 - y1) / (x2 - x1);3214 _angle = atan(m) * rad_factor;3215 3216 if (p1.x() < p2.x())3217 _angle = 180 - _angle;3218 else3219 _angle = -_angle;3220 }3221 return _angle;3222 }3223 3224 static int calcBigLineSize(int radius)3225 {3226 int bigLineSize = radius / 6;3227 if (bigLineSize < 4)3228 bigLineSize = 4;3229 if (bigLineSize > radius / 2)3230 bigLineSize = radius / 2;3231 return bigLineSize;3232 }3233 3062 3234 3063 static QPolygonF calcArrow(const QStyleOptionSlider *dial, qreal &a) … … 3251 3080 int yc = height / 2; 3252 3081 3253 int len = r - calcBigLineSize(r) - 5;3082 int len = r - QStyleHelper::calcBigLineSize(r) - 5; 3254 3083 if (len < 5) 3255 3084 len = 5; … … 3266 3095 } 3267 3096 3268 static QPolygonF calcLines(const QStyleOptionSlider *dial, const QWidget *)3269 {3270 QPolygonF poly;3271 int width = dial->rect.width();3272 int height = dial->rect.height();3273 qreal r = qMin(width, height) / 2;3274 int bigLineSize = calcBigLineSize(int(r));3275 3276 qreal xc = width / 2;3277 qreal yc = height / 2;3278 int ns = dial->tickInterval;3279 int notches = (dial->maximum + ns - 1 - dial->minimum) / ns;3280 if (notches <= 0)3281 return poly;3282 if (dial->maximum < dial->minimum3283 || dial->maximum - dial->minimum > 1000) {3284 int maximum = dial->minimum + 1000;3285 notches = (maximum + ns - 1 - dial->minimum) / ns;3286 }3287 3288 poly.resize(2 + 2 * notches);3289 int smallLineSize = bigLineSize / 2;3290 for (int i = 0; i <= notches; ++i) {3291 qreal angle = dial->dialWrapping ? Q_PI * 3 / 2 - i * 2 * Q_PI / notches3292 : (Q_PI * 8 - i * 10 * Q_PI / notches) / 6;3293 qreal s = qSin(angle);3294 qreal c = qCos(angle);3295 if (i == 0 || (((ns * i) % (dial->pageStep ? dial->pageStep : 1)) == 0)) {3296 poly[2 * i] = QPointF(xc + (r - bigLineSize) * c,3297 yc - (r - bigLineSize) * s);3298 poly[2 * i + 1] = QPointF(xc + r * c, yc - r * s);3299 } else {3300 poly[2 * i] = QPointF(xc + (r - 1 - smallLineSize) * c,3301 yc - (r - 1 - smallLineSize) * s);3302 poly[2 * i + 1] = QPointF(xc + (r - 1) * c, yc -(r - 1) * s);3303 }3304 }3305 return poly;3306 }3307 3097 #endif // QT_NO_DIAL 3308 3098 … … 3318 3108 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 3319 3109 if (slider->subControls == SC_SliderTickmarks) { 3320 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, slider, widget);3110 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); 3321 3111 int ticks = slider->tickPosition; 3322 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);3323 int len = p ixelMetric(PM_SliderLength, slider, widget);3324 int available = p ixelMetric(PM_SliderSpaceAvailable, slider, widget);3112 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 3113 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 3114 int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); 3325 3115 int interval = slider->tickInterval; 3326 3116 if (interval <= 0) { … … 3380 3170 if (scrollbar->subControls & SC_ScrollBarSubLine) { 3381 3171 newScrollbar.state = saveFlags; 3382 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarSubLine, widget);3172 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSubLine, widget); 3383 3173 if (newScrollbar.rect.isValid()) { 3384 3174 if (!(scrollbar->activeSubControls & SC_ScrollBarSubLine)) 3385 3175 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3386 drawControl(CE_ScrollBarSubLine, &newScrollbar, p, widget);3176 proxy()->drawControl(CE_ScrollBarSubLine, &newScrollbar, p, widget); 3387 3177 } 3388 3178 } … … 3390 3180 newScrollbar.rect = scrollbar->rect; 3391 3181 newScrollbar.state = saveFlags; 3392 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarAddLine, widget);3182 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarAddLine, widget); 3393 3183 if (newScrollbar.rect.isValid()) { 3394 3184 if (!(scrollbar->activeSubControls & SC_ScrollBarAddLine)) 3395 3185 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3396 drawControl(CE_ScrollBarAddLine, &newScrollbar, p, widget);3186 proxy()->drawControl(CE_ScrollBarAddLine, &newScrollbar, p, widget); 3397 3187 } 3398 3188 } … … 3400 3190 newScrollbar.rect = scrollbar->rect; 3401 3191 newScrollbar.state = saveFlags; 3402 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarSubPage, widget);3192 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSubPage, widget); 3403 3193 if (newScrollbar.rect.isValid()) { 3404 3194 if (!(scrollbar->activeSubControls & SC_ScrollBarSubPage)) 3405 3195 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3406 drawControl(CE_ScrollBarSubPage, &newScrollbar, p, widget);3196 proxy()->drawControl(CE_ScrollBarSubPage, &newScrollbar, p, widget); 3407 3197 } 3408 3198 } … … 3410 3200 newScrollbar.rect = scrollbar->rect; 3411 3201 newScrollbar.state = saveFlags; 3412 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarAddPage, widget);3202 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarAddPage, widget); 3413 3203 if (newScrollbar.rect.isValid()) { 3414 3204 if (!(scrollbar->activeSubControls & SC_ScrollBarAddPage)) 3415 3205 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3416 drawControl(CE_ScrollBarAddPage, &newScrollbar, p, widget);3206 proxy()->drawControl(CE_ScrollBarAddPage, &newScrollbar, p, widget); 3417 3207 } 3418 3208 } … … 3420 3210 newScrollbar.rect = scrollbar->rect; 3421 3211 newScrollbar.state = saveFlags; 3422 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarFirst, widget);3212 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarFirst, widget); 3423 3213 if (newScrollbar.rect.isValid()) { 3424 3214 if (!(scrollbar->activeSubControls & SC_ScrollBarFirst)) 3425 3215 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3426 drawControl(CE_ScrollBarFirst, &newScrollbar, p, widget);3216 proxy()->drawControl(CE_ScrollBarFirst, &newScrollbar, p, widget); 3427 3217 } 3428 3218 } … … 3430 3220 newScrollbar.rect = scrollbar->rect; 3431 3221 newScrollbar.state = saveFlags; 3432 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarLast, widget);3222 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarLast, widget); 3433 3223 if (newScrollbar.rect.isValid()) { 3434 3224 if (!(scrollbar->activeSubControls & SC_ScrollBarLast)) 3435 3225 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3436 drawControl(CE_ScrollBarLast, &newScrollbar, p, widget);3226 proxy()->drawControl(CE_ScrollBarLast, &newScrollbar, p, widget); 3437 3227 } 3438 3228 } … … 3440 3230 newScrollbar.rect = scrollbar->rect; 3441 3231 newScrollbar.state = saveFlags; 3442 newScrollbar.rect = subControlRect(cc, &newScrollbar, SC_ScrollBarSlider, widget);3232 newScrollbar.rect = proxy()->subControlRect(cc, &newScrollbar, SC_ScrollBarSlider, widget); 3443 3233 if (newScrollbar.rect.isValid()) { 3444 3234 if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) 3445 3235 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 3446 drawControl(CE_ScrollBarSlider, &newScrollbar, p, widget);3236 proxy()->drawControl(CE_ScrollBarSlider, &newScrollbar, p, widget); 3447 3237 3448 3238 if (scrollbar->state & State_HasFocus) { … … 3452 3242 newScrollbar.rect.width() - 5, 3453 3243 newScrollbar.rect.height() - 5); 3454 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);3244 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 3455 3245 } 3456 3246 } … … 3474 3264 3475 3265 if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) { 3476 QRect r = subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget);3266 QRect r = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget); 3477 3267 qDrawWinPanel(p, r, sb->palette, true); 3478 3268 } … … 3498 3288 : PE_IndicatorSpinUp); 3499 3289 3500 copy.rect = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget);3501 drawPrimitive(PE_PanelButtonBevel, ©, p, widget);3290 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); 3291 proxy()->drawPrimitive(PE_PanelButtonBevel, ©, p, widget); 3502 3292 copy.rect.adjust(3, 0, -4, 0); 3503 drawPrimitive(pe, ©, p, widget);3293 proxy()->drawPrimitive(pe, ©, p, widget); 3504 3294 } 3505 3295 … … 3524 3314 : PE_IndicatorSpinDown); 3525 3315 3526 copy.rect = subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget);3527 drawPrimitive(PE_PanelButtonBevel, ©, p, widget);3316 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); 3317 proxy()->drawPrimitive(PE_PanelButtonBevel, ©, p, widget); 3528 3318 copy.rect.adjust(3, 0, -4, 0); 3529 drawPrimitive(pe, ©, p, widget);3319 proxy()->drawPrimitive(pe, ©, p, widget); 3530 3320 } 3531 3321 } … … 3537 3327 = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { 3538 3328 QRect button, menuarea; 3539 button = subControlRect(cc, toolbutton, SC_ToolButton, widget);3540 menuarea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget);3329 button = proxy()->subControlRect(cc, toolbutton, SC_ToolButton, widget); 3330 menuarea = proxy()->subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget); 3541 3331 3542 3332 State bflags = toolbutton->state & ~State_Sunken; … … 3560 3350 tool.rect = button; 3561 3351 tool.state = bflags; 3562 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3352 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3563 3353 } 3564 3354 } … … 3569 3359 fr.rect.adjust(3, 3, -3, -3); 3570 3360 if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup) 3571 fr.rect.adjust(0, 0, -p ixelMetric(QStyle::PM_MenuButtonIndicator,3361 fr.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, 3572 3362 toolbutton, widget), 0); 3573 drawPrimitive(PE_FrameFocusRect, &fr, p, widget);3363 proxy()->drawPrimitive(PE_FrameFocusRect, &fr, p, widget); 3574 3364 } 3575 3365 QStyleOptionToolButton label = *toolbutton; 3576 3366 label.state = bflags; 3577 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);3367 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 3578 3368 label.rect = button.adjusted(fw, fw, -fw, -fw); 3579 drawControl(CE_ToolButtonLabel, &label, p, widget);3369 proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget); 3580 3370 3581 3371 if (toolbutton->subControls & SC_ToolButtonMenu) { … … 3583 3373 tool.state = mflags; 3584 3374 if (mflags & (State_Sunken | State_On | State_Raised)) 3585 drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget);3586 drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget);3375 proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget); 3376 proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget); 3587 3377 } else if (toolbutton->features & QStyleOptionToolButton::HasMenu) { 3588 int mbi = p ixelMetric(PM_MenuButtonIndicator, toolbutton, widget);3378 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, widget); 3589 3379 QRect ir = toolbutton->rect; 3590 3380 QStyleOptionToolButton newBtn = *toolbutton; 3591 3381 newBtn.rect = QRect(ir.right() + 5 - mbi, ir.y() + ir.height() - mbi + 4, mbi - 6, mbi - 6); 3592 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);3382 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 3593 3383 } 3594 3384 } … … 3614 3404 p->fillRect(opt->rect, fillBrush); 3615 3405 3616 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarLabel, widget);3406 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarLabel, widget); 3617 3407 3618 3408 p->setPen(tb->palette.highlightedText().color()); … … 3627 3417 tool.palette = tb->palette; 3628 3418 if (tb->subControls & SC_TitleBarCloseButton && tb->titleBarFlags & Qt::WindowSystemMenuHint) { 3629 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarCloseButton, widget);3419 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarCloseButton, widget); 3630 3420 down = tb->activeSubControls & SC_TitleBarCloseButton && (opt->state & State_Sunken); 3631 3421 if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool … … 3639 3429 tool.rect = ir; 3640 3430 tool.state = down ? State_Sunken : State_Raised; 3641 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3431 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3642 3432 3643 3433 p->save(); 3644 3434 if (down) 3645 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3646 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3647 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3435 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3436 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3437 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3648 3438 p->restore(); 3649 3439 } … … 3652 3442 && tb->titleBarFlags & Qt::WindowMaximizeButtonHint 3653 3443 && !(tb->titleBarState & Qt::WindowMaximized)) { 3654 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarMaxButton, widget);3444 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMaxButton, widget); 3655 3445 3656 3446 down = tb->activeSubControls & SC_TitleBarMaxButton && (opt->state & State_Sunken); … … 3658 3448 tool.rect = ir; 3659 3449 tool.state = down ? State_Sunken : State_Raised; 3660 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3450 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3661 3451 3662 3452 p->save(); 3663 3453 if (down) 3664 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3665 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3666 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3454 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3455 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3456 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3667 3457 p->restore(); 3668 3458 } … … 3671 3461 && tb->titleBarFlags & Qt::WindowMinimizeButtonHint 3672 3462 && !(tb->titleBarState & Qt::WindowMinimized)) { 3673 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarMinButton, widget);3463 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarMinButton, widget); 3674 3464 down = tb->activeSubControls & SC_TitleBarMinButton && (opt->state & State_Sunken); 3675 3465 pm = standardIcon(SP_TitleBarMinButton, &tool, widget).pixmap(10, 10); 3676 3466 tool.rect = ir; 3677 3467 tool.state = down ? State_Sunken : State_Raised; 3678 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3468 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3679 3469 3680 3470 p->save(); 3681 3471 if (down) 3682 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3683 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3684 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3472 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3473 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3474 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3685 3475 p->restore(); 3686 3476 } … … 3693 3483 3694 3484 if (drawNormalButton) { 3695 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarNormalButton, widget);3485 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarNormalButton, widget); 3696 3486 down = tb->activeSubControls & SC_TitleBarNormalButton && (opt->state & State_Sunken); 3697 3487 pm = standardIcon(SP_TitleBarNormalButton, &tool, widget).pixmap(10, 10); 3698 3488 tool.rect = ir; 3699 3489 tool.state = down ? State_Sunken : State_Raised; 3700 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3490 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3701 3491 3702 3492 p->save(); 3703 3493 if (down) 3704 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3705 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3706 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3494 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3495 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3496 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3707 3497 p->restore(); 3708 3498 } … … 3711 3501 && tb->titleBarFlags & Qt::WindowShadeButtonHint 3712 3502 && !(tb->titleBarState & Qt::WindowMinimized)) { 3713 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarShadeButton, widget);3503 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarShadeButton, widget); 3714 3504 down = (tb->activeSubControls & SC_TitleBarShadeButton && (opt->state & State_Sunken)); 3715 3505 pm = standardIcon(SP_TitleBarShadeButton, &tool, widget).pixmap(10, 10); 3716 3506 tool.rect = ir; 3717 3507 tool.state = down ? State_Sunken : State_Raised; 3718 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3508 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3719 3509 p->save(); 3720 3510 if (down) 3721 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3722 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3723 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3511 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3512 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3513 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3724 3514 p->restore(); 3725 3515 } … … 3728 3518 && tb->titleBarFlags & Qt::WindowShadeButtonHint 3729 3519 && tb->titleBarState & Qt::WindowMinimized) { 3730 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarUnshadeButton, widget);3520 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarUnshadeButton, widget); 3731 3521 3732 3522 down = tb->activeSubControls & SC_TitleBarUnshadeButton && (opt->state & State_Sunken); … … 3734 3524 tool.rect = ir; 3735 3525 tool.state = down ? State_Sunken : State_Raised; 3736 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3526 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3737 3527 p->save(); 3738 3528 if (down) 3739 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3740 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3741 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3529 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3530 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3531 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3742 3532 p->restore(); 3743 3533 } 3744 3534 if (tb->subControls & SC_TitleBarContextHelpButton 3745 3535 && tb->titleBarFlags & Qt::WindowContextHelpButtonHint) { 3746 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarContextHelpButton, widget);3536 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarContextHelpButton, widget); 3747 3537 3748 3538 down = tb->activeSubControls & SC_TitleBarContextHelpButton && (opt->state & State_Sunken); … … 3750 3540 tool.rect = ir; 3751 3541 tool.state = down ? State_Sunken : State_Raised; 3752 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);3542 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 3753 3543 p->save(); 3754 3544 if (down) 3755 p->translate(p ixelMetric(PM_ButtonShiftHorizontal, tb, widget),3756 p ixelMetric(PM_ButtonShiftVertical, tb, widget));3757 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3545 p->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, widget), 3546 proxy()->pixelMetric(PM_ButtonShiftVertical, tb, widget)); 3547 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3758 3548 p->restore(); 3759 3549 } 3760 3550 if (tb->subControls & SC_TitleBarSysMenu && tb->titleBarFlags & Qt::WindowSystemMenuHint) { 3761 ir = subControlRect(CC_TitleBar, tb, SC_TitleBarSysMenu, widget);3551 ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarSysMenu, widget); 3762 3552 if (!tb->icon.isNull()) { 3763 3553 tb->icon.paint(p, ir); 3764 3554 } else { 3765 int iconSize = p ixelMetric(PM_SmallIconSize, tb, widget);3555 int iconSize = proxy()->pixelMetric(PM_SmallIconSize, tb, widget); 3766 3556 pm = standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(iconSize, iconSize); 3767 3557 tool.rect = ir; 3768 3558 p->save(); 3769 drawItemPixmap(p, ir, Qt::AlignCenter, pm);3559 proxy()->drawItemPixmap(p, ir, Qt::AlignCenter, pm); 3770 3560 p->restore(); 3771 3561 } … … 3795 3585 if (dial->subControls & QStyle::SC_DialTickmarks) { 3796 3586 p->setPen(pal.foreground().color()); 3797 p->drawLines( calcLines(dial, widget)); // ### calcLines could be cached...3587 p->drawLines(QStyleHelper::calcLines(dial)); 3798 3588 } 3799 3589 3800 3590 if (dial->state & State_Enabled) { 3801 p->setBrush(pal.brush(QPalette::ColorRole( styleHint(SH_Dial_BackgroundRole,3591 p->setBrush(pal.brush(QPalette::ColorRole(proxy()->styleHint(SH_Dial_BackgroundRole, 3802 3592 dial, widget)))); 3803 3593 p->setPen(Qt::NoPen); … … 3817 3607 p->drawPolygon(arrow); 3818 3608 3819 a = angle(QPointF(width / 2, height / 2), arrow[0]);3609 a = QStyleHelper::angle(QPointF(width / 2, height / 2), arrow[0]); 3820 3610 p->setBrush(Qt::NoBrush); 3821 3611 … … 3860 3650 } 3861 3651 fropt.rect = br.adjusted(-2, -2, 2, 2); 3862 drawPrimitive(QStyle::PE_FrameFocusRect, &fropt, p, widget);3652 proxy()->drawPrimitive(QStyle::PE_FrameFocusRect, &fropt, p, widget); 3863 3653 } 3864 3654 p->restore(); … … 3870 3660 if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { 3871 3661 // Draw frame 3872 QRect textRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, widget);3873 QRect checkBoxRect = subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget);3662 QRect textRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, widget); 3663 QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget); 3874 3664 if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { 3875 3665 QStyleOptionFrameV2 frame; … … 3878 3668 frame.lineWidth = groupBox->lineWidth; 3879 3669 frame.midLineWidth = groupBox->midLineWidth; 3880 frame.rect = subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, widget);3670 frame.rect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxFrame, widget); 3881 3671 p->save(); 3882 3672 QRegion region(groupBox->rect); … … 3893 3683 } 3894 3684 p->setClipRegion(region); 3895 drawPrimitive(PE_FrameGroupBox, &frame, p, widget);3685 proxy()->drawPrimitive(PE_FrameGroupBox, &frame, p, widget); 3896 3686 p->restore(); 3897 3687 } … … 3903 3693 p->setPen(textColor); 3904 3694 int alignment = int(groupBox->textAlignment); 3905 if (! styleHint(QStyle::SH_UnderlineShortcut, opt, widget))3695 if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, opt, widget)) 3906 3696 alignment |= Qt::TextHideMnemonic; 3907 3697 3908 drawItemText(p, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment,3698 proxy()->drawItemText(p, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, 3909 3699 groupBox->palette, groupBox->state & State_Enabled, groupBox->text, 3910 3700 textColor.isValid() ? QPalette::NoRole : QPalette::WindowText); … … 3914 3704 fropt.QStyleOption::operator=(*groupBox); 3915 3705 fropt.rect = textRect; 3916 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);3706 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 3917 3707 } 3918 3708 } … … 3923 3713 box.QStyleOption::operator=(*groupBox); 3924 3714 box.rect = checkBoxRect; 3925 drawPrimitive(PE_IndicatorCheckBox, &box, p, widget);3715 proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, p, widget); 3926 3716 } 3927 3717 } … … 3940 3730 btnOpt.state |= State_Sunken; 3941 3731 btnOpt.state &= ~State_Raised; 3942 bsx = p ixelMetric(PM_ButtonShiftHorizontal);3943 bsy = p ixelMetric(PM_ButtonShiftVertical);3732 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); 3733 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); 3944 3734 } else { 3945 3735 btnOpt.state |= State_Raised; … … 3948 3738 bsy = 0; 3949 3739 } 3950 btnOpt.rect = subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget);3951 drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);3740 btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiCloseButton, widget); 3741 proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); 3952 3742 QPixmap pm = standardIcon(SP_TitleBarCloseButton).pixmap(16, 16); 3953 drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);3743 proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); 3954 3744 } 3955 3745 if (opt->subControls & QStyle::SC_MdiNormalButton) { … … 3957 3747 btnOpt.state |= State_Sunken; 3958 3748 btnOpt.state &= ~State_Raised; 3959 bsx = p ixelMetric(PM_ButtonShiftHorizontal);3960 bsy = p ixelMetric(PM_ButtonShiftVertical);3749 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); 3750 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); 3961 3751 } else { 3962 3752 btnOpt.state |= State_Raised; … … 3965 3755 bsy = 0; 3966 3756 } 3967 btnOpt.rect = subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget);3968 drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);3757 btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiNormalButton, widget); 3758 proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); 3969 3759 QPixmap pm = standardIcon(SP_TitleBarNormalButton).pixmap(16, 16); 3970 drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);3760 proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); 3971 3761 } 3972 3762 if (opt->subControls & QStyle::SC_MdiMinButton) { … … 3974 3764 btnOpt.state |= State_Sunken; 3975 3765 btnOpt.state &= ~State_Raised; 3976 bsx = p ixelMetric(PM_ButtonShiftHorizontal);3977 bsy = p ixelMetric(PM_ButtonShiftVertical);3766 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); 3767 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); 3978 3768 } else { 3979 3769 btnOpt.state |= State_Raised; … … 3982 3772 bsy = 0; 3983 3773 } 3984 btnOpt.rect = subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget);3985 drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget);3774 btnOpt.rect = proxy()->subControlRect(CC_MdiControls, opt, SC_MdiMinButton, widget); 3775 proxy()->drawPrimitive(PE_PanelButtonCommand, &btnOpt, p, widget); 3986 3776 QPixmap pm = standardIcon(SP_TitleBarMinButton).pixmap(16, 16); 3987 drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm);3777 proxy()->drawItemPixmap(p, btnOpt.rect.translated(bsx, bsy), Qt::AlignCenter, pm); 3988 3778 } 3989 3779 } … … 4007 3797 case CC_Slider: 4008 3798 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 4009 QRect r = subControlRect(cc, slider, SC_SliderHandle, widget);3799 QRect r = proxy()->subControlRect(cc, slider, SC_SliderHandle, widget); 4010 3800 if (r.isValid() && r.contains(pt)) { 4011 3801 sc = SC_SliderHandle; 4012 3802 } else { 4013 r = subControlRect(cc, slider, SC_SliderGroove ,widget);3803 r = proxy()->subControlRect(cc, slider, SC_SliderGroove ,widget); 4014 3804 if (r.isValid() && r.contains(pt)) 4015 3805 sc = SC_SliderGroove; … … 4024 3814 uint ctrl = SC_ScrollBarAddLine; 4025 3815 while (ctrl <= SC_ScrollBarGroove) { 4026 r = subControlRect(cc, scrollbar, QStyle::SubControl(ctrl), widget);3816 r = proxy()->subControlRect(cc, scrollbar, QStyle::SubControl(ctrl), widget); 4027 3817 if (r.isValid() && r.contains(pt)) { 4028 3818 sc = QStyle::SubControl(ctrl); … … 4040 3830 uint ctrl = SC_ToolButton; 4041 3831 while (ctrl <= SC_ToolButtonMenu) { 4042 r = subControlRect(cc, toolbutton, QStyle::SubControl(ctrl), widget);3832 r = proxy()->subControlRect(cc, toolbutton, QStyle::SubControl(ctrl), widget); 4043 3833 if (r.isValid() && r.contains(pt)) { 4044 3834 sc = QStyle::SubControl(ctrl); … … 4064 3854 uint ctrl = SC_SpinBoxUp; 4065 3855 while (ctrl <= SC_SpinBoxEditField) { 4066 r = subControlRect(cc, spinbox, QStyle::SubControl(ctrl), widget);3856 r = proxy()->subControlRect(cc, spinbox, QStyle::SubControl(ctrl), widget); 4067 3857 if (r.isValid() && r.contains(pt)) { 4068 3858 sc = QStyle::SubControl(ctrl); … … 4080 3870 4081 3871 while (ctrl <= SC_TitleBarLabel) { 4082 r = subControlRect(cc, tb, QStyle::SubControl(ctrl), widget);3872 r = proxy()->subControlRect(cc, tb, QStyle::SubControl(ctrl), widget); 4083 3873 if (r.isValid() && r.contains(pt)) { 4084 3874 sc = QStyle::SubControl(ctrl); … … 4095 3885 uint ctrl = SC_ComboBoxArrow; // Start here and go down. 4096 3886 while (ctrl > 0) { 4097 r = subControlRect(cc, cb, QStyle::SubControl(ctrl), widget);3887 r = proxy()->subControlRect(cc, cb, QStyle::SubControl(ctrl), widget); 4098 3888 if (r.isValid() && r.contains(pt)) { 4099 3889 sc = QStyle::SubControl(ctrl); … … 4111 3901 uint ctrl = SC_GroupBoxCheckBox; 4112 3902 while (ctrl <= SC_GroupBoxFrame) { 4113 r = subControlRect(cc, groupBox, QStyle::SubControl(ctrl), widget);3903 r = proxy()->subControlRect(cc, groupBox, QStyle::SubControl(ctrl), widget); 4114 3904 if (r.isValid() && r.contains(pt)) { 4115 3905 sc = QStyle::SubControl(ctrl); … … 4126 3916 uint ctrl = SC_MdiMinButton; 4127 3917 while (ctrl <= SC_MdiCloseButton) { 4128 r = subControlRect(CC_MdiControls, opt, QStyle::SubControl(ctrl), widget);3918 r = proxy()->subControlRect(CC_MdiControls, opt, QStyle::SubControl(ctrl), widget); 4129 3919 if (r.isValid() && r.contains(pt) && (opt->subControls & ctrl)) { 4130 3920 sc = QStyle::SubControl(ctrl); … … 4152 3942 case CC_Slider: 4153 3943 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 4154 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, slider, widget);4155 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);3944 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); 3945 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 4156 3946 4157 3947 switch (sc) { 4158 3948 case SC_SliderHandle: { 4159 3949 int sliderPos = 0; 4160 int len = p ixelMetric(PM_SliderLength, slider, widget);3950 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 4161 3951 bool horizontal = slider->orientation == Qt::Horizontal; 4162 3952 sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, … … 4189 3979 if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 4190 3980 const QRect scrollBarRect = scrollbar->rect; 4191 int sbextent = p ixelMetric(PM_ScrollBarExtent, scrollbar, widget);3981 int sbextent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollbar, widget); 4192 3982 int maxlen = ((scrollbar->orientation == Qt::Horizontal) ? 4193 3983 scrollBarRect.width() : scrollBarRect.height()) - (sbextent * 2); … … 4199 3989 sliderlen = (qint64(scrollbar->pageStep) * maxlen) / (range + scrollbar->pageStep); 4200 3990 4201 int slidermin = p ixelMetric(PM_ScrollBarSliderMin, scrollbar, widget);3991 int slidermin = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); 4202 3992 if (sliderlen < slidermin || range > INT_MAX / 2) 4203 3993 sliderlen = slidermin; … … 4272 4062 if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { 4273 4063 QSize bs; 4274 int fw = spinbox->frame ? p ixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;4064 int fw = spinbox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; 4275 4065 bs.setHeight(qMax(8, spinbox->rect.height()/2 - fw)); 4276 4066 // 1.6 -approximate golden mean … … 4313 4103 case CC_ToolButton: 4314 4104 if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { 4315 int mbi = p ixelMetric(PM_MenuButtonIndicator, tb, widget);4105 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, tb, widget); 4316 4106 ret = tb->rect; 4317 4107 switch (sc) { … … 4453 4243 int topMargin = 0; 4454 4244 int topHeight = 0; 4455 int verticalAlignment = styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget);4245 int verticalAlignment = proxy()->styleHint(SH_GroupBox_TextLabelVerticalAlignment, groupBox, widget); 4456 4246 if (groupBox->text.size() || (groupBox->subControls & QStyle::SC_GroupBoxCheckBox)) { 4457 4247 topHeight = groupBox->fontMetrics.height(); … … 4473 4263 if (!(widget && widget->inherits("Q3GroupBox")) 4474 4264 && ((groupBox->features & QStyleOptionFrameV2::Flat) == 0)) { 4475 frameWidth = p ixelMetric(PM_DefaultFrameWidth, groupBox, widget);4265 frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); 4476 4266 } 4477 4267 ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin, … … 4489 4279 ret.setHeight(h); 4490 4280 4491 int indicatorWidth = p ixelMetric(PM_IndicatorWidth, opt, widget);4492 int indicatorSpace = p ixelMetric(PM_CheckBoxLabelSpacing, opt, widget) - 1;4281 int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, opt, widget); 4282 int indicatorSpace = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, opt, widget) - 1; 4493 4283 bool hasCheckBox = groupBox->subControls & QStyle::SC_GroupBoxCheckBox; 4494 4284 int checkBoxSize = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0; … … 4504 4294 // Adjust for check box 4505 4295 if (sc == SC_GroupBoxCheckBox) { 4506 int indicatorHeight = p ixelMetric(PM_IndicatorHeight, opt, widget);4296 int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); 4507 4297 left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth); 4508 4298 int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2; … … 4590 4380 break; 4591 4381 case PM_DialogButtonsSeparator: 4592 ret = 5;4382 ret = int(QStyleHelper::dpiScaled(5.)); 4593 4383 break; 4594 4384 case PM_DialogButtonsButtonWidth: 4595 ret = 70;4385 ret = int(QStyleHelper::dpiScaled(70.)); 4596 4386 break; 4597 4387 case PM_DialogButtonsButtonHeight: 4598 ret = 30;4388 ret = int(QStyleHelper::dpiScaled(30.)); 4599 4389 break; 4600 4390 case PM_CheckListControllerSize: 4601 4391 case PM_CheckListButtonSize: 4602 ret = 16;4392 ret = int(QStyleHelper::dpiScaled(16.)); 4603 4393 break; 4604 4394 case PM_TitleBarHeight: { 4605 4395 if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { 4606 4396 if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { 4607 ret = qMax(widget ? widget->fontMetrics(). lineSpacing() : opt->fontMetrics.lineSpacing(), 16);4397 ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 16); 4608 4398 #ifndef QT_NO_DOCKWIDGET 4609 4399 } else if (qobject_cast<const QDockWidget*>(widget)) { 4610 ret = qMax(widget->fontMetrics(). lineSpacing(), 13);4400 ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13))); 4611 4401 #endif 4612 4402 } else { 4613 ret = qMax(widget ? widget->fontMetrics(). lineSpacing() : opt->fontMetrics.lineSpacing(), 18);4403 ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 18); 4614 4404 } 4615 4405 } else { 4616 ret = 18;4406 ret = int(QStyleHelper::dpiScaled(18.)); 4617 4407 } 4618 4408 4619 4409 break; } 4620 4410 case PM_ScrollBarSliderMin: 4621 ret = 9;4411 ret = int(QStyleHelper::dpiScaled(9.)); 4622 4412 break; 4623 4413 4624 4414 case PM_ButtonMargin: 4625 ret = 6;4415 ret = int(QStyleHelper::dpiScaled(6.)); 4626 4416 break; 4627 4417 4628 4418 case PM_DockWidgetTitleBarButtonMargin: 4629 ret = 2;4419 ret = int(QStyleHelper::dpiScaled(2.)); 4630 4420 break; 4631 4421 … … 4635 4425 4636 4426 case PM_MenuButtonIndicator: 4637 ret = 12;4427 ret = int(QStyleHelper::dpiScaled(12.)); 4638 4428 break; 4639 4429 … … 4650 4440 case PM_TabBarBaseOverlap: 4651 4441 case PM_TabBarBaseHeight: 4652 ret = p ixelMetric(PM_DefaultFrameWidth, opt, widget);4442 ret = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 4653 4443 break; 4654 4444 4655 4445 case PM_MdiSubWindowFrameWidth: 4656 ret = 4;4446 ret = int(QStyleHelper::dpiScaled(4.)); 4657 4447 break; 4658 4448 4659 4449 case PM_MdiSubWindowMinimizedWidth: 4660 ret = 196;4450 ret = int(QStyleHelper::dpiScaled(196.)); 4661 4451 break; 4662 4452 … … 4669 4459 ret = qMax(16, s); 4670 4460 } else { 4671 ret = 16;4461 ret = int(QStyleHelper::dpiScaled(16.)); 4672 4462 } 4673 4463 break; … … 4679 4469 #ifndef QT_NO_SLIDER 4680 4470 case PM_SliderThickness: 4681 ret = 16;4471 ret = int(QStyleHelper::dpiScaled(16.)); 4682 4472 break; 4683 4473 … … 4686 4476 int space = (sl->orientation == Qt::Horizontal) ? sl->rect.height() 4687 4477 : sl->rect.width(); 4688 int thickness = p ixelMetric(PM_SliderControlThickness, sl, widget);4478 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, sl, widget); 4689 4479 int ticks = sl->tickPosition; 4690 4480 … … 4703 4493 if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 4704 4494 if (sl->orientation == Qt::Horizontal) 4705 ret = sl->rect.width() - p ixelMetric(PM_SliderLength, sl, widget);4495 ret = sl->rect.width() - proxy()->pixelMetric(PM_SliderLength, sl, widget); 4706 4496 else 4707 ret = sl->rect.height() - p ixelMetric(PM_SliderLength, sl, widget);4497 ret = sl->rect.height() - proxy()->pixelMetric(PM_SliderLength, sl, widget); 4708 4498 } else { 4709 4499 ret = 0; … … 4713 4503 #ifndef QT_NO_DOCKWIDGET 4714 4504 case PM_DockWidgetSeparatorExtent: 4715 ret = 6;4505 ret = int(QStyleHelper::dpiScaled(6.)); 4716 4506 break; 4717 4507 4718 4508 case PM_DockWidgetHandleExtent: 4719 ret = 8;4509 ret = int(QStyleHelper::dpiScaled(8.)); 4720 4510 break; 4721 4511 case PM_DockWidgetTitleMargin: … … 4746 4536 4747 4537 case PM_ToolBarItemSpacing: 4748 ret = 4;4538 ret = int(QStyleHelper::dpiScaled(4.)); 4749 4539 break; 4750 4540 4751 4541 case PM_ToolBarHandleExtent: 4752 ret = 8;4542 ret = int(QStyleHelper::dpiScaled(8.)); 4753 4543 break; 4754 4544 4755 4545 case PM_ToolBarSeparatorExtent: 4756 ret = 6;4546 ret = int(QStyleHelper::dpiScaled(6.)); 4757 4547 break; 4758 4548 4759 4549 case PM_ToolBarExtensionExtent: 4760 ret = 12;4550 ret = int(QStyleHelper::dpiScaled(12.)); 4761 4551 break; 4762 4552 #endif // QT_NO_TOOLBAR … … 4768 4558 4769 4559 case PM_TabBarTabHSpace: 4770 ret = 24;4560 ret = int(QStyleHelper::dpiScaled(24.)); 4771 4561 break; 4772 4562 … … 4797 4587 4798 4588 case PM_IndicatorWidth: 4799 ret = 13;4589 ret = int(QStyleHelper::dpiScaled(13.)); 4800 4590 break; 4801 4591 4802 4592 case PM_IndicatorHeight: 4803 ret = 13;4593 ret = int(QStyleHelper::dpiScaled(13.)); 4804 4594 break; 4805 4595 4806 4596 case PM_ExclusiveIndicatorWidth: 4807 ret = 12;4597 ret = int(QStyleHelper::dpiScaled(12.)); 4808 4598 break; 4809 4599 4810 4600 case PM_ExclusiveIndicatorHeight: 4811 ret = 12;4601 ret = int(QStyleHelper::dpiScaled(12.)); 4812 4602 break; 4813 4603 4814 4604 case PM_MenuTearoffHeight: 4815 ret = 10;4605 ret = int(QStyleHelper::dpiScaled(10.)); 4816 4606 break; 4817 4607 4818 4608 case PM_MenuScrollerHeight: 4819 ret = 10;4609 ret = int(QStyleHelper::dpiScaled(10.)); 4820 4610 break; 4821 4611 … … 4827 4617 4828 4618 case PM_HeaderMargin: 4829 ret = 4;4619 ret = int(QStyleHelper::dpiScaled(4.)); 4830 4620 break; 4831 4621 case PM_HeaderMarkSize: 4832 ret = 32;4622 ret = int(QStyleHelper::dpiScaled(32.)); 4833 4623 break; 4834 4624 case PM_HeaderGripMargin: 4835 ret = 4;4625 ret = int(QStyleHelper::dpiScaled(4.)); 4836 4626 break; 4837 4627 case PM_TabBarScrollButtonWidth: 4838 ret = 16;4628 ret = int(QStyleHelper::dpiScaled(16.)); 4839 4629 break; 4840 4630 case PM_LayoutLeftMargin: … … 4849 4639 isWindow = widget->isWindow(); 4850 4640 } 4851 ret = p ixelMetric(isWindow ? PM_DefaultTopLevelMargin : PM_DefaultChildMargin);4641 ret = proxy()->pixelMetric(isWindow ? PM_DefaultTopLevelMargin : PM_DefaultChildMargin); 4852 4642 } 4853 4643 break; 4854 4644 case PM_LayoutHorizontalSpacing: 4855 4645 case PM_LayoutVerticalSpacing: 4856 ret = p ixelMetric(PM_DefaultLayoutSpacing);4646 ret = proxy()->pixelMetric(PM_DefaultLayoutSpacing); 4857 4647 break; 4858 4648 4859 4649 case PM_DefaultTopLevelMargin: 4860 ret = 11;4650 ret = int(QStyleHelper::dpiScaled(11.)); 4861 4651 break; 4862 4652 case PM_DefaultChildMargin: 4863 ret = 9;4653 ret = int(QStyleHelper::dpiScaled(9.)); 4864 4654 break; 4865 4655 case PM_DefaultLayoutSpacing: 4866 ret = 6; 4656 ret = int(QStyleHelper::dpiScaled(6.)); 4657 break; 4658 4659 case PM_ToolBarIconSize: 4660 ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ToolBarIconSize); 4661 if (!ret) 4662 ret = int(QStyleHelper::dpiScaled(24.)); 4867 4663 break; 4868 4664 4869 4665 case PM_TabBarIconSize: 4870 case PM_ToolBarIconSize:4871 4666 case PM_ListViewIconSize: 4872 ret = p ixelMetric(PM_SmallIconSize, opt, widget);4667 ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); 4873 4668 break; 4874 4669 4875 4670 case PM_ButtonIconSize: 4876 4671 case PM_SmallIconSize: 4877 ret = 16;4672 ret = int(QStyleHelper::dpiScaled(16.)); 4878 4673 break; 4879 4674 case PM_IconViewIconSize: 4880 ret = p ixelMetric(PM_LargeIconSize, opt, widget);4675 ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); 4881 4676 break; 4882 4677 4883 4678 case PM_LargeIconSize: 4884 ret = 32;4679 ret = int(QStyleHelper::dpiScaled(32.)); 4885 4680 break; 4886 4681 … … 4890 4685 case PM_CheckBoxLabelSpacing: 4891 4686 case PM_RadioButtonLabelSpacing: 4892 ret = 6;4687 ret = int(QStyleHelper::dpiScaled(6.)); 4893 4688 break; 4894 4689 case PM_SizeGripSize: 4895 ret = 13;4690 ret = int(QStyleHelper::dpiScaled(13.)); 4896 4691 break; 4897 4692 case PM_MessageBoxIconSize: 4898 ret = 32; 4693 #ifdef Q_WS_MAC 4694 if (QApplication::desktopSettingsAware()) { 4695 ret = 64; // No DPI scaling, it's handled elsewhere. 4696 } else 4697 #endif 4698 { 4699 ret = int(QStyleHelper::dpiScaled(32.)); 4700 } 4899 4701 break; 4900 4702 case PM_TextCursorWidth: … … 4906 4708 case PM_TabCloseIndicatorWidth: 4907 4709 case PM_TabCloseIndicatorHeight: 4908 ret = 16;4710 ret = int(QStyleHelper::dpiScaled(16.)); 4909 4711 break; 4910 4712 case PM_ScrollView_ScrollBarSpacing: 4911 ret = 2 * p ixelMetric(PM_DefaultFrameWidth, opt, widget);4713 ret = 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 4912 4714 break; 4913 4715 case PM_SubMenuOverlap: 4914 ret = -p ixelMetric(QStyle::PM_MenuPanelWidth, opt, widget);4716 ret = -proxy()->pixelMetric(QStyle::PM_MenuPanelWidth, opt, widget); 4915 4717 break; 4916 4718 default: … … 4935 4737 int w = csz.width(), 4936 4738 h = csz.height(), 4937 bm = p ixelMetric(PM_ButtonMargin, btn, widget),4938 fw = p ixelMetric(PM_DefaultFrameWidth, btn, widget) * 2;4739 bm = proxy()->pixelMetric(PM_ButtonMargin, btn, widget), 4740 fw = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget) * 2; 4939 4741 w += bm + fw; 4940 4742 h += bm + fw; 4941 4743 if (btn->features & QStyleOptionButton::AutoDefaultButton){ 4942 int dbw = p ixelMetric(PM_ButtonDefaultIndicator, btn, widget) * 2;4744 int dbw = proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget) * 2; 4943 4745 w += dbw; 4944 4746 h += dbw; … … 4952 4754 bool isRadio = (ct == CT_RadioButton); 4953 4755 4954 int w = p ixelMetric(isRadio ? PM_ExclusiveIndicatorWidth4756 int w = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorWidth 4955 4757 : PM_IndicatorWidth, btn, widget); 4956 int h = p ixelMetric(isRadio ? PM_ExclusiveIndicatorHeight4758 int h = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight 4957 4759 : PM_IndicatorHeight, btn, widget); 4958 4760 … … 4960 4762 // we add 4 pixels for label margins 4961 4763 if (btn->icon.isNull() || !btn->text.isEmpty()) 4962 margins = 4 + p ixelMetric(isRadio ? PM_RadioButtonLabelSpacing4764 margins = 4 + proxy()->pixelMetric(isRadio ? PM_RadioButtonLabelSpacing 4963 4765 : PM_CheckBoxLabelSpacing, opt, widget); 4964 4766 sz += QSize(w + margins, 4); … … 4978 4780 h = mi->fontMetrics.height() + 8; 4979 4781 if (!mi->icon.isNull()) { 4980 int iconExtent = p ixelMetric(PM_SmallIconSize);4782 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); 4981 4783 h = qMax(h, mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() + 4); 4982 4784 } … … 5003 4805 case CT_ComboBox: 5004 4806 if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { 5005 int fw = cmb->frame ? p ixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0;5006 const int textMargins = 2*(p ixelMetric(PM_FocusFrameHMargin) + 1);4807 int fw = cmb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0; 4808 const int textMargins = 2*(proxy()->pixelMetric(PM_FocusFrameHMargin) + 1); 5007 4809 // QItemDelegate::sizeHint expands the textMargins two times, thus the 2*textMargins... 5008 int other = qMax(23, 2*textMargins + p ixelMetric(QStyle::PM_ScrollBarExtent, opt, widget));4810 int other = qMax(23, 2*textMargins + proxy()->pixelMetric(QStyle::PM_ScrollBarExtent, opt, widget)); 5009 4811 sz = QSize(sz.width() + fw + other, sz.height() + fw); 5010 4812 } … … 5014 4816 if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { 5015 4817 bool nullIcon = hdr->icon.isNull(); 5016 int margin = p ixelMetric(QStyle::PM_HeaderMargin, hdr, widget);5017 int iconSize = nullIcon ? 0 : p ixelMetric(QStyle::PM_SmallIconSize, hdr, widget);4818 int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, hdr, widget); 4819 int iconSize = nullIcon ? 0 : proxy()->pixelMetric(QStyle::PM_SmallIconSize, hdr, widget); 5018 4820 QSize txt = hdr->fontMetrics.size(0, hdr->text); 5019 4821 sz.setHeight(margin + qMax(iconSize, txt.height()) + margin); … … 5213 5015 if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { 5214 5016 mask->region = widget->rect(); 5215 int vmargin = p ixelMetric(QStyle::PM_FocusFrameVMargin),5216 hmargin = p ixelMetric(QStyle::PM_FocusFrameHMargin);5017 int vmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameVMargin), 5018 hmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin); 5217 5019 mask->region -= QRect(widget->rect().adjusted(hmargin, vmargin, -hmargin, -vmargin)); 5218 5020 } … … 5227 5029 if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) { 5228 5030 mask->region = opt->rect; 5229 int margin = p ixelMetric(PM_DefaultFrameWidth) * 2;5031 int margin = proxy()->pixelMetric(PM_DefaultFrameWidth) * 2; 5230 5032 mask->region -= opt->rect.adjusted(margin, margin, -margin, -margin); 5231 5033 } … … 5255 5057 5256 5058 case SH_ItemView_ActivateItemOnSingleClick: 5257 ret = false;5059 ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ItemView_ActivateItemOnSingleClick); 5258 5060 break; 5259 5061 … … 5283 5085 break; 5284 5086 case SH_DialogButtonBox_ButtonsHaveIcons: 5087 #ifdef Q_WS_X11 5088 return true; 5089 #endif 5285 5090 ret = 0; 5286 5091 break; … … 5345 5150 ret = true; 5346 5151 break; 5152 case SH_ToolButtonStyle: 5153 ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ToolButtonStyle); 5154 break; 5155 case SH_RequestSoftwareInputPanel: 5156 ret = RSIP_OnMouseClickAndAlreadyFocused; 5157 break; 5347 5158 default: 5348 5159 ret = 0; … … 5357 5168 const QWidget *widget) const 5358 5169 { 5170 const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); 5359 5171 #ifdef QT_NO_IMAGEFORMAT_PNG 5360 Q_UNUSED(option);5361 5172 Q_UNUSED(widget); 5362 5173 Q_UNUSED(sp); 5363 5174 #else 5364 #ifdef Q_WS_X115365 Q_D(const QCommonStyle);5366 5175 QPixmap pixmap; 5367 if (qApp->desktopSettingsAware()) { 5368 d->lookupIconTheme();5176 5177 if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { 5369 5178 switch (sp) { 5179 case SP_DialogYesButton: 5180 case SP_DialogOkButton: 5181 pixmap = QIcon::fromTheme(QLatin1String("dialog-ok")).pixmap(16); 5182 break; 5183 case SP_DialogApplyButton: 5184 pixmap = QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(16); 5185 break; 5186 case SP_DialogDiscardButton: 5187 pixmap = QIcon::fromTheme(QLatin1String("edit-delete")).pixmap(16); 5188 break; 5189 case SP_DialogCloseButton: 5190 pixmap = QIcon::fromTheme(QLatin1String("dialog-close")).pixmap(16); 5191 break; 5370 5192 case SP_DirHomeIcon: 5371 { 5372 pixmap = d->findIcon(16, QLatin1String("folder_home.png")); 5373 if (!pixmap.isNull()) 5374 return pixmap; 5375 break; 5376 } 5193 pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16); 5194 break; 5377 5195 case SP_MessageBoxInformation: 5378 { 5379 pixmap = d->findIcon(32, QLatin1String("messagebox_info.png")); 5380 if (!pixmap.isNull()) 5381 return pixmap; 5382 break; 5383 } 5196 pixmap = QIcon::fromTheme(QLatin1String("messagebox_info")).pixmap(16); 5197 break; 5384 5198 case SP_MessageBoxWarning: 5385 { 5386 pixmap = d->findIcon(32, QLatin1String("messagebox_warning.png")); 5387 if (!pixmap.isNull()) 5388 return pixmap; 5389 break; 5390 } 5199 pixmap = QIcon::fromTheme(QLatin1String("messagebox_warning")).pixmap(16); 5200 break; 5391 5201 case SP_MessageBoxCritical: 5392 { 5393 pixmap = d->findIcon(32, QLatin1String("messagebox_critical.png")); 5394 if (!pixmap.isNull()) 5395 return pixmap; 5396 break; 5397 } 5202 pixmap = QIcon::fromTheme(QLatin1String("messagebox_critical")).pixmap(16); 5203 break; 5398 5204 case SP_MessageBoxQuestion: 5399 { 5400 pixmap = d->findIcon(32, QLatin1String("help.png")); 5401 if (!pixmap.isNull()) 5402 return pixmap; 5403 break; 5404 } 5205 pixmap = QIcon::fromTheme(QLatin1String("help")).pixmap(16); 5206 break; 5405 5207 case SP_DialogOpenButton: 5406 5208 case SP_DirOpenIcon: 5407 { 5408 pixmap = d->findIcon(16, QLatin1String("folder-open.png")); 5409 if (pixmap.isNull()) 5410 pixmap = d->findIcon(16, QLatin1String("folder_open.png")); 5411 if (!pixmap.isNull()) 5412 return pixmap; 5413 break; 5414 } 5209 pixmap = QIcon::fromTheme(QLatin1String("folder-open")).pixmap(16); 5210 break; 5415 5211 case SP_FileIcon: 5416 { 5417 pixmap = d->findIcon(16, QLatin1String("text-x-generic.png")); 5418 if (pixmap.isNull()) 5419 pixmap = d->findIcon(16, QLatin1String("empty.png")); 5420 if (!pixmap.isNull()) 5421 return pixmap; 5422 break; 5423 } 5424 case SP_FileLinkIcon: 5425 { 5426 pixmap = d->findIcon(16, QLatin1String("link_overlay.png")); 5427 if (!pixmap.isNull()) { 5428 QPixmap fileIcon = d->findIcon(16, QLatin1String("text-x-generic.png")); 5429 if (fileIcon.isNull()) 5430 fileIcon = d->findIcon(16, QLatin1String("empty.png")); 5431 if (!fileIcon.isNull()) { 5432 QPainter painter(&fileIcon); 5433 painter.drawPixmap(0, 0, 16, 16, pixmap); 5434 return fileIcon; 5435 } 5436 } 5437 break; 5438 } 5212 pixmap = QIcon::fromTheme(QLatin1String("text-x-generic"), 5213 QIcon::fromTheme(QLatin1String("empty"))).pixmap(16); 5214 break; 5439 5215 case SP_DirClosedIcon: 5440 5216 case SP_DirIcon: 5441 { 5442 pixmap = d->findIcon(16, QLatin1String("folder.png")); 5443 if (!pixmap.isNull()) 5444 return pixmap; 5445 break; 5446 } 5217 pixmap = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); 5218 break; 5219 case SP_DriveFDIcon: 5220 pixmap = QIcon::fromTheme(QLatin1String("media-floppy"), 5221 QIcon::fromTheme(QLatin1String("3floppy_unmount"))).pixmap(16); 5222 break; 5223 case SP_ComputerIcon: 5224 pixmap = QIcon::fromTheme(QLatin1String("computer"), 5225 QIcon::fromTheme(QLatin1String("system"))).pixmap(16); 5226 break; 5227 case SP_DesktopIcon: 5228 pixmap = QIcon::fromTheme(QLatin1String("user-desktop"), 5229 QIcon::fromTheme(QLatin1String("desktop"))).pixmap(16); 5230 break; 5231 case SP_TrashIcon: 5232 pixmap = QIcon::fromTheme(QLatin1String("user-trash"), 5233 QIcon::fromTheme(QLatin1String("trashcan_empty"))).pixmap(16); 5234 break; 5235 case SP_DriveCDIcon: 5236 case SP_DriveDVDIcon: 5237 pixmap = QIcon::fromTheme(QLatin1String("media-optical"), 5238 QIcon::fromTheme(QLatin1String("cdrom_unmount"))).pixmap(16); 5239 break; 5240 case SP_DriveHDIcon: 5241 pixmap = QIcon::fromTheme(QLatin1String("drive-harddisk"), 5242 QIcon::fromTheme(QLatin1String("hdd_unmount"))).pixmap(16); 5243 break; 5244 case SP_FileDialogToParent: 5245 pixmap = QIcon::fromTheme(QLatin1String("go-up"), 5246 QIcon::fromTheme(QLatin1String("up"))).pixmap(16); 5247 break; 5248 case SP_FileDialogNewFolder: 5249 pixmap = QIcon::fromTheme(QLatin1String("folder_new")).pixmap(16); 5250 break; 5251 case SP_ArrowUp: 5252 pixmap = QIcon::fromTheme(QLatin1String("go-up"), 5253 QIcon::fromTheme(QLatin1String("up"))).pixmap(16); 5254 break; 5255 case SP_ArrowDown: 5256 pixmap = QIcon::fromTheme(QLatin1String("go-down"), 5257 QIcon::fromTheme(QLatin1String("down"))).pixmap(16); 5258 break; 5259 case SP_ArrowRight: 5260 pixmap = QIcon::fromTheme(QLatin1String("go-next"), 5261 QIcon::fromTheme(QLatin1String("forward"))).pixmap(16); 5262 break; 5263 case SP_ArrowLeft: 5264 pixmap = QIcon::fromTheme(QLatin1String("go-previous"), 5265 QIcon::fromTheme(QLatin1String("back"))).pixmap(16); 5266 break; 5267 case SP_FileDialogDetailedView: 5268 pixmap = QIcon::fromTheme(QLatin1String("view_detailed")).pixmap(16); 5269 break; 5270 case SP_FileDialogListView: 5271 pixmap = QIcon::fromTheme(QLatin1String("view_icon")).pixmap(16); 5272 break; 5273 case SP_BrowserReload: 5274 pixmap = QIcon::fromTheme(QLatin1String("reload")).pixmap(16); 5275 break; 5276 case SP_BrowserStop: 5277 pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(16); 5278 break; 5279 case SP_MediaPlay: 5280 pixmap = QIcon::fromTheme(QLatin1String("media-playback-start")).pixmap(16); 5281 break; 5282 case SP_MediaPause: 5283 pixmap = QIcon::fromTheme(QLatin1String("media-playback-pause")).pixmap(16); 5284 break; 5285 case SP_MediaStop: 5286 pixmap = QIcon::fromTheme(QLatin1String("media-playback-stop")).pixmap(16); 5287 break; 5288 case SP_MediaSeekForward: 5289 pixmap = QIcon::fromTheme(QLatin1String("media-seek-forward")).pixmap(16); 5290 break; 5291 case SP_MediaSeekBackward: 5292 pixmap = QIcon::fromTheme(QLatin1String("media-seek-backward")).pixmap(16); 5293 break; 5294 case SP_MediaSkipForward: 5295 pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); 5296 break; 5297 case SP_MediaSkipBackward: 5298 pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); 5299 break; 5300 case SP_DialogResetButton: 5301 pixmap = QIcon::fromTheme(QLatin1String("edit-clear")).pixmap(24); 5302 break; 5303 case SP_DialogHelpButton: 5304 pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24); 5305 break; 5306 case SP_DialogNoButton: 5307 case SP_DialogCancelButton: 5308 pixmap = QIcon::fromTheme(QLatin1String("dialog-cancel"), 5309 QIcon::fromTheme(QLatin1String("process-stop"))).pixmap(24); 5310 break; 5311 case SP_DialogSaveButton: 5312 pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24); 5313 break; 5314 case SP_FileLinkIcon: 5315 pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); 5316 if (!pixmap.isNull()) { 5317 QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16); 5318 if (fileIcon.isNull()) 5319 fileIcon = QIcon::fromTheme(QLatin1String("empty")).pixmap(16); 5320 if (!fileIcon.isNull()) { 5321 QPainter painter(&fileIcon); 5322 painter.drawPixmap(0, 0, 16, 16, pixmap); 5323 return fileIcon; 5324 } 5325 } 5326 break; 5447 5327 case SP_DirLinkIcon: 5448 { 5449 pixmap = d->findIcon(16, QLatin1String("link_overlay.png")); 5328 pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); 5450 5329 if (!pixmap.isNull()) { 5451 QPixmap dirIcon = d->findIcon(16, QLatin1String("folder.png"));5330 QPixmap dirIcon = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); 5452 5331 if (!dirIcon.isNull()) { 5453 5332 QPainter painter(&dirIcon); … … 5457 5336 } 5458 5337 break; 5459 }5460 case SP_DriveFDIcon:5461 {5462 pixmap = d->findIcon(16, QLatin1String("media-floppy.png"));5463 if (pixmap.isNull())5464 pixmap = d->findIcon(16, QLatin1String("3floppy_unmount.png"));5465 if (!pixmap.isNull())5466 return pixmap;5467 break;5468 }5469 case SP_ComputerIcon:5470 {5471 pixmap = d->findIcon(16, QLatin1String("computer.png"));5472 if (pixmap.isNull())5473 pixmap = d->findIcon(16, QLatin1String("system.png"));5474 if (!pixmap.isNull())5475 return pixmap;5476 break;5477 }5478 case SP_DesktopIcon:5479 {5480 pixmap = d->findIcon(16, QLatin1String("user-desktop.png"));5481 if (pixmap.isNull())5482 pixmap = d->findIcon(16, QLatin1String("desktop.png"));5483 if (!pixmap.isNull())5484 return pixmap;5485 break;5486 }5487 case SP_TrashIcon:5488 {5489 pixmap = d->findIcon(16, QLatin1String("user-trash.png"));5490 if (pixmap.isNull())5491 pixmap = d->findIcon(16, QLatin1String("trashcan_empty.png"));5492 if (!pixmap.isNull())5493 return pixmap;5494 break;5495 }5496 case SP_DriveCDIcon:5497 case SP_DriveDVDIcon:5498 {5499 pixmap = d->findIcon(16, QLatin1String("media-optical.png"));5500 if (pixmap.isNull())5501 pixmap = d->findIcon(16, QLatin1String("cdrom_unmount.png"));5502 if (!pixmap.isNull())5503 return pixmap;5504 break;5505 }5506 case SP_DriveHDIcon:5507 {5508 pixmap = d->findIcon(16, QLatin1String("drive-harddisk.png"));5509 if (pixmap.isNull())5510 pixmap = d->findIcon(16, QLatin1String("hdd_unmount.png"));5511 if (!pixmap.isNull())5512 return pixmap;5513 break;5514 }5515 case SP_FileDialogToParent:5516 {5517 pixmap = d->findIcon(32, QLatin1String("go-up.png"));5518 if (pixmap.isNull())5519 pixmap = d->findIcon(32, QLatin1String("up.png"));5520 if (!pixmap.isNull())5521 return pixmap;5522 break;5523 }5524 case SP_FileDialogNewFolder:5525 {5526 pixmap = d->findIcon(16, QLatin1String("folder_new.png"));5527 if (!pixmap.isNull())5528 return pixmap;5529 break;5530 }5531 case SP_ArrowUp:5532 {5533 pixmap = d->findIcon(32, QLatin1String("go-up.png"));5534 if (pixmap.isNull())5535 pixmap = d->findIcon(32, QLatin1String("up.png"));5536 if (!pixmap.isNull())5537 return pixmap;5538 break;5539 }5540 case SP_ArrowDown:5541 {5542 pixmap = d->findIcon(32, QLatin1String("go-down.png"));5543 if (pixmap.isNull())5544 pixmap = d->findIcon(32, QLatin1String("down.png"));5545 if (!pixmap.isNull())5546 return pixmap;5547 break;5548 }5549 case SP_ArrowRight:5550 {5551 pixmap = d->findIcon(32, QLatin1String("go-next.png"));5552 if (pixmap.isNull())5553 pixmap = d->findIcon(32, QLatin1String("forward.png"));5554 if (!pixmap.isNull())5555 return pixmap;5556 break;5557 }5558 case SP_ArrowLeft:5559 {5560 pixmap = d->findIcon(32, QLatin1String("go-previous.png"));5561 if (pixmap.isNull())5562 pixmap = d->findIcon(32, QLatin1String("back.png"));5563 if (!pixmap.isNull())5564 return pixmap;5565 break;5566 }5567 case SP_FileDialogDetailedView:5568 {5569 pixmap = d->findIcon(16, QLatin1String("view_detailed.png"));5570 if (!pixmap.isNull())5571 return pixmap;5572 break;5573 }5574 5575 case SP_FileDialogListView:5576 {5577 pixmap = d->findIcon(16, QLatin1String("view_icon.png"));5578 if (!pixmap.isNull())5579 return pixmap;5580 break;5581 }5582 case SP_BrowserReload:5583 {5584 pixmap = d->findIcon(32, QLatin1String("reload.png"));5585 if (!pixmap.isNull())5586 return pixmap;5587 break;5588 }5589 case SP_BrowserStop:5590 {5591 pixmap = d->findIcon(32, QLatin1String("stop.png"));5592 if (!pixmap.isNull())5593 return pixmap;5594 break;5595 }5596 case SP_MediaPlay:5597 {5598 pixmap = d->findIcon(16, QLatin1String("player_play.png"));5599 if (!pixmap.isNull())5600 return pixmap;5601 break;5602 }5603 case SP_MediaPause:5604 {5605 pixmap = d->findIcon(16, QLatin1String("player_pause.png"));5606 if (!pixmap.isNull())5607 return pixmap;5608 break;5609 }5610 case SP_MediaStop:5611 {5612 pixmap = d->findIcon(16, QLatin1String("player_stop.png"));5613 if (!pixmap.isNull())5614 return pixmap;5615 break;5616 }5617 case SP_MediaSeekForward:5618 {5619 pixmap = d->findIcon(16, QLatin1String("player_fwd.png"));5620 if (!pixmap.isNull())5621 return pixmap;5622 break;5623 }5624 case SP_MediaSeekBackward:5625 {5626 pixmap = d->findIcon(16, QLatin1String("player_rew.png"));5627 if (!pixmap.isNull())5628 return pixmap;5629 break;5630 }5631 case SP_MediaSkipForward:5632 {5633 pixmap = d->findIcon(16, QLatin1String("player_end.png"));5634 if (!pixmap.isNull())5635 return pixmap;5636 break;5637 }5638 case SP_MediaSkipBackward:5639 {5640 pixmap = d->findIcon(16, QLatin1String("player_start.png"));5641 if (!pixmap.isNull())5642 return pixmap;5643 break;5644 }5645 5646 5338 default: 5647 5339 break; 5648 5340 } 5649 5341 } 5650 #endif //Q_WS_X11 5342 5343 if (!pixmap.isNull()) 5344 return pixmap; 5651 5345 #endif //QT_NO_IMAGEFORMAT_PNG 5652 5346 switch (sp) { 5653 5347 #ifndef QT_NO_IMAGEFORMAT_XPM 5654 5348 case SP_ToolBarHorizontalExtensionButton: 5655 if ( QApplication::layoutDirection() == Qt::RightToLeft) {5349 if (rtl) { 5656 5350 QImage im(tb_extension_arrow_h_xpm); 5657 5351 im = im.convertToFormat(QImage::Format_ARGB32).mirrored(true, false); … … 5669 5363 case SP_CommandLink: 5670 5364 case SP_ArrowForward: 5671 if ( QApplication::layoutDirection() == Qt::RightToLeft)5672 return standardPixmap(SP_ArrowLeft, option, widget);5673 return standardPixmap(SP_ArrowRight, option, widget);5365 if (rtl) 5366 return proxy()->standardPixmap(SP_ArrowLeft, option, widget); 5367 return proxy()->standardPixmap(SP_ArrowRight, option, widget); 5674 5368 case SP_ArrowBack: 5675 if ( QApplication::layoutDirection() == Qt::RightToLeft)5676 return standardPixmap(SP_ArrowRight, option, widget);5677 return standardPixmap(SP_ArrowLeft, option, widget);5369 if (rtl) 5370 return proxy()->standardPixmap(SP_ArrowRight, option, widget); 5371 return proxy()->standardPixmap(SP_ArrowLeft, option, widget); 5678 5372 case SP_ArrowLeft: 5679 5373 return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/left-16.png")); … … 5685 5379 return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/down-16.png")); 5686 5380 case SP_FileDialogToParent: 5687 return standardPixmap(SP_ArrowUp, option, widget);5381 return proxy()->standardPixmap(SP_ArrowUp, option, widget); 5688 5382 case SP_FileDialogNewFolder: 5689 5383 return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/newdirectory-16.png")); … … 5697 5391 return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/viewlist-16.png")); 5698 5392 case SP_FileDialogBack: 5699 return standardPixmap(SP_ArrowBack, option, widget);5393 return proxy()->standardPixmap(SP_ArrowBack, option, widget); 5700 5394 case SP_DriveHDIcon: 5701 5395 return QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/harddrive-16.png")); … … 5784 5478 { 5785 5479 QIcon icon; 5786 #ifdef Q_WS_X11 5787 Q_D(const QCommonStyle); 5788 if (qApp->desktopSettingsAware()) { 5789 d->lookupIconTheme(); 5790 QPixmap pixmap; 5480 const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); 5481 if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { 5791 5482 switch (standardIcon) { 5792 5483 case SP_DirHomeIcon: 5793 { 5794 icon = d->createIcon(QLatin1String("folder_home.png")); 5795 break; 5796 } 5484 icon = QIcon::fromTheme(QLatin1String("user-home")); 5485 break; 5797 5486 case SP_MessageBoxInformation: 5798 { 5799 icon = d->createIcon(QLatin1String("dialog-information.png")); 5800 if (icon.isNull()) 5801 icon = d->createIcon(QLatin1String("messagebox_info.png")); 5802 break; 5803 } 5487 icon = QIcon::fromTheme(QLatin1String("dialog-information")); 5488 break; 5804 5489 case SP_MessageBoxWarning: 5805 { 5806 icon = d->createIcon(QLatin1String("dialog-warning.png")); 5807 if (icon.isNull()) 5808 icon = d->createIcon(QLatin1String("messagebox_warning.png")); 5809 break; 5810 } 5490 icon = QIcon::fromTheme(QLatin1String("dialog-warning")); 5491 break; 5811 5492 case SP_MessageBoxCritical: 5812 { 5813 icon = d->createIcon(QLatin1String("dialog-error.png")); 5814 if (icon.isNull()) 5815 icon = d->createIcon(QLatin1String("messagebox_critical.png")); 5816 break; 5817 } 5493 icon = QIcon::fromTheme(QLatin1String("dialog-error")); 5494 break; 5818 5495 case SP_MessageBoxQuestion: 5819 { 5820 icon = d->createIcon(QLatin1String("help.png")); 5821 break; 5822 } 5496 icon = QIcon::fromTheme(QLatin1String("dialog-question")); 5497 break; 5823 5498 case SP_DialogOpenButton: 5824 5499 case SP_DirOpenIcon: 5825 { 5826 icon = d->createIcon(QLatin1String("folder-open.png")); 5827 if (icon.isNull()) 5828 icon = d->createIcon(QLatin1String("folder_open.png")); 5829 break; 5830 } 5500 icon = QIcon::fromTheme(QLatin1String("folder-open")); 5501 break; 5502 case SP_DialogSaveButton: 5503 icon = QIcon::fromTheme(QLatin1String("document-save")); 5504 break; 5505 case SP_DialogApplyButton: 5506 icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); 5507 break; 5508 case SP_DialogYesButton: 5509 case SP_DialogOkButton: 5510 icon = QIcon::fromTheme(QLatin1String("dialog-ok")); 5511 break; 5512 case SP_DialogDiscardButton: 5513 icon = QIcon::fromTheme(QLatin1String("edit-delete")); 5514 break; 5515 case SP_DialogResetButton: 5516 icon = QIcon::fromTheme(QLatin1String("edit-clear")); 5517 break; 5518 case SP_DialogHelpButton: 5519 icon = QIcon::fromTheme(QLatin1String("help-contents")); 5520 break; 5831 5521 case SP_FileIcon: 5832 { 5833 icon = d->createIcon(QLatin1String("text-x-generic.png")); 5834 if (icon.isNull()) 5835 icon = d->createIcon(QLatin1String("empty.png")); 5836 break; 5837 } 5522 icon = QIcon::fromTheme(QLatin1String("text-x-generic")); 5523 break; 5838 5524 case SP_DirClosedIcon: 5839 5525 case SP_DirIcon: 5840 { 5841 icon = d->createIcon(QLatin1String("folder.png")); 5842 break; 5843 } 5526 icon = QIcon::fromTheme(QLatin1String("folder")); 5527 break; 5844 5528 case SP_DriveFDIcon: 5845 { 5846 icon = d->createIcon(QLatin1String("floppy_unmount.png")); 5847 break; 5848 } 5529 icon = QIcon::fromTheme(QLatin1String("floppy_unmount")); 5530 break; 5849 5531 case SP_ComputerIcon: 5850 { 5851 icon = d->createIcon(QLatin1String("computer.png")); 5852 if (icon.isNull()) 5853 icon = d->createIcon(QLatin1String("system.png")); 5854 break; 5855 } 5532 icon = QIcon::fromTheme(QLatin1String("computer"), 5533 QIcon::fromTheme(QLatin1String("system"))); 5534 break; 5856 5535 case SP_DesktopIcon: 5857 { 5858 icon = d->createIcon(QLatin1String("user-desktop.png")); 5859 break; 5860 } 5536 icon = QIcon::fromTheme(QLatin1String("user-desktop")); 5537 break; 5861 5538 case SP_TrashIcon: 5862 { 5863 icon = d->createIcon(QLatin1String("user-trash.png")); 5864 break; 5865 } 5539 icon = QIcon::fromTheme(QLatin1String("user-trash")); 5540 break; 5866 5541 case SP_DriveCDIcon: 5867 5542 case SP_DriveDVDIcon: 5543 icon = QIcon::fromTheme(QLatin1String("media-optical")); 5544 break; 5545 case SP_DriveHDIcon: 5546 icon = QIcon::fromTheme(QLatin1String("drive-harddisk")); 5547 break; 5548 case SP_FileDialogToParent: 5549 icon = QIcon::fromTheme(QLatin1String("go-up")); 5550 break; 5551 case SP_FileDialogNewFolder: 5552 icon = QIcon::fromTheme(QLatin1String("folder-new")); 5553 break; 5554 case SP_ArrowUp: 5555 icon = QIcon::fromTheme(QLatin1String("go-up")); 5556 break; 5557 case SP_ArrowDown: 5558 icon = QIcon::fromTheme(QLatin1String("go-down")); 5559 break; 5560 case SP_ArrowRight: 5561 icon = QIcon::fromTheme(QLatin1String("go-next")); 5562 break; 5563 case SP_ArrowLeft: 5564 icon = QIcon::fromTheme(QLatin1String("go-previous")); 5565 break; 5566 case SP_DialogCancelButton: 5567 icon = QIcon::fromTheme(QLatin1String("dialog-cancel"), 5568 QIcon::fromTheme(QLatin1String("process-stop"))); 5569 break; 5570 case SP_DialogCloseButton: 5571 icon = QIcon::fromTheme(QLatin1String("window-close")); 5572 break; 5573 case SP_FileDialogDetailedView: 5574 icon = QIcon::fromTheme(QLatin1String("view-list-details")); 5575 break; 5576 case SP_FileDialogListView: 5577 icon = QIcon::fromTheme(QLatin1String("view-list-icons")); 5578 break; 5579 case SP_BrowserReload: 5580 icon = QIcon::fromTheme(QLatin1String("view-refresh")); 5581 break; 5582 case SP_BrowserStop: 5583 icon = QIcon::fromTheme(QLatin1String("process-stop")); 5584 break; 5585 case SP_MediaPlay: 5586 icon = QIcon::fromTheme(QLatin1String("media-playback-start")); 5587 break; 5588 case SP_MediaPause: 5589 icon = QIcon::fromTheme(QLatin1String("media-playback-pause")); 5590 break; 5591 case SP_MediaStop: 5592 icon = QIcon::fromTheme(QLatin1String("media-playback-stop")); 5593 break; 5594 case SP_MediaSeekForward: 5595 icon = QIcon::fromTheme(QLatin1String("media-seek-forward")); 5596 break; 5597 case SP_MediaSeekBackward: 5598 icon = QIcon::fromTheme(QLatin1String("media-seek-backward")); 5599 break; 5600 case SP_MediaSkipForward: 5601 icon = QIcon::fromTheme(QLatin1String("media-skip-forward")); 5602 break; 5603 case SP_MediaSkipBackward: 5604 icon = QIcon::fromTheme(QLatin1String("media-skip-backward")); 5605 break; 5606 case SP_MediaVolume: 5607 icon = QIcon::fromTheme(QLatin1String("audio-volume-medium")); 5608 break; 5609 case SP_MediaVolumeMuted: 5610 icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); 5611 break; 5612 case SP_ArrowForward: 5613 if (rtl) 5614 return standardIconImplementation(SP_ArrowLeft, option, widget); 5615 return standardIconImplementation(SP_ArrowRight, option, widget); 5616 case SP_ArrowBack: 5617 if (rtl) 5618 return standardIconImplementation(SP_ArrowRight, option, widget); 5619 return standardIconImplementation(SP_ArrowLeft, option, widget); 5620 case SP_FileLinkIcon: 5868 5621 { 5869 icon = d->createIcon(QLatin1String("media-optical.png")); 5870 if (icon.isNull()) 5871 icon = d->createIcon(QLatin1String("cdrom_unmount.png")); 5872 break; 5873 } 5874 case SP_DriveHDIcon: 5622 QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); 5623 if (!linkIcon.isNull()) { 5624 QIcon baseIcon = standardIconImplementation(SP_FileIcon, option, widget); 5625 const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); 5626 for (int i = 0 ; i < sizes.size() ; ++i) { 5627 int size = sizes[i].width(); 5628 QPixmap basePixmap = baseIcon.pixmap(size); 5629 QPixmap linkPixmap = linkIcon.pixmap(size/2); 5630 QPainter painter(&basePixmap); 5631 painter.drawPixmap(size/2, size/2, linkPixmap); 5632 icon.addPixmap(basePixmap); 5633 } 5634 } 5635 } 5636 break; 5637 case SP_DirLinkIcon: 5875 5638 { 5876 icon = d->createIcon(QLatin1String("drive-harddisk.png")); 5877 if (icon.isNull()) 5878 icon = d->createIcon(QLatin1String("hdd_unmount.png")); 5879 break; 5880 } 5881 case SP_FileDialogToParent: 5882 { 5883 icon = d->createIcon(QLatin1String("go-up.png")); 5884 if (icon.isNull()) 5885 icon = d->createIcon(QLatin1String("up.png")); 5886 break; 5887 } 5888 case SP_FileDialogNewFolder: 5889 { 5890 icon = d->createIcon(QLatin1String("folder_new.png")); 5891 break; 5892 } 5893 case SP_ArrowUp: 5894 { 5895 icon = d->createIcon(QLatin1String("go-up.png")); 5896 if (icon.isNull()) 5897 icon = d->createIcon(QLatin1String("up.png")); 5898 break; 5899 } 5900 case SP_ArrowDown: 5901 { 5902 icon = d->createIcon(QLatin1String("go-down.png")); 5903 if (icon.isNull()) 5904 icon = d->createIcon(QLatin1String("down.png")); 5905 break; 5906 } 5907 case SP_ArrowRight: 5908 { 5909 icon = d->createIcon(QLatin1String("go-next.png")); 5910 if (icon.isNull()) 5911 icon = d->createIcon(QLatin1String("forward.png")); 5912 break; 5913 } 5914 case SP_ArrowLeft: 5915 { 5916 icon = d->createIcon(QLatin1String("go-previous.png")); 5917 if (icon.isNull()) 5918 icon = d->createIcon(QLatin1String("back.png")); 5919 break; 5920 } 5921 case SP_FileDialogDetailedView: 5922 { 5923 icon = d->createIcon(QLatin1String("view-list-details.png")); 5924 if (icon.isNull()) 5925 icon = d->createIcon(QLatin1String("view_detailed.png")); 5926 break; 5927 } 5928 case SP_FileDialogListView: 5929 { 5930 icon = d->createIcon(QLatin1String("view-list-icons.png")); 5931 if (icon.isNull()) 5932 icon = d->createIcon(QLatin1String("view_icon.png")); 5933 break; 5934 } 5935 case SP_BrowserReload: 5936 { 5937 icon = d->createIcon(QLatin1String("view-refresh.png")); 5938 if (icon.isNull()) 5939 icon = d->createIcon(QLatin1String("reload.png")); 5940 break; 5941 } 5942 case SP_BrowserStop: 5943 { 5944 icon = d->createIcon(QLatin1String("process-stop.png")); 5945 if (icon.isNull()) 5946 icon = d->createIcon(QLatin1String("stop.png")); 5947 break; 5948 } 5949 case SP_MediaPlay: 5950 { 5951 icon = d->createIcon(QLatin1String("media-playback-start.png")); 5952 if (icon.isNull()) 5953 icon = d->createIcon(QLatin1String("player_play.png")); 5954 break; 5955 } 5956 case SP_MediaPause: 5957 { 5958 icon = d->createIcon(QLatin1String("media-playback-pause.png")); 5959 if (icon.isNull()) 5960 icon = d->createIcon(QLatin1String("player_pause.png")); 5961 break; 5962 } 5963 case SP_MediaStop: 5964 { 5965 icon = d->createIcon(QLatin1String("media-playback-stop.png")); 5966 if (icon.isNull()) 5967 icon = d->createIcon(QLatin1String("player_stop.png")); 5968 break; 5969 } 5970 case SP_MediaSeekForward: 5971 { 5972 icon = d->createIcon(QLatin1String("media-skip-forward.png")); 5973 if (icon.isNull()) 5974 icon = d->createIcon(QLatin1String("player_fwd.png")); 5975 break; 5976 } 5977 case SP_MediaSeekBackward: 5978 { 5979 icon = d->createIcon(QLatin1String("media-skip-backward.png")); 5980 if (icon.isNull()) 5981 icon = d->createIcon(QLatin1String("player_rew.png")); 5982 break; 5983 } 5984 case SP_MediaSkipForward: 5985 { 5986 icon = d->createIcon(QLatin1String("media-skip-forward.png")); 5987 if (icon.isNull()) 5988 icon = d->createIcon(QLatin1String("player_end.png")); 5989 break; 5990 } 5991 case SP_MediaSkipBackward: 5992 { 5993 icon = d->createIcon(QLatin1String("media-skip-backward.png")); 5994 if (icon.isNull()) 5995 icon = d->createIcon(QLatin1String("player_start.png")); 5996 break; 5997 } 5998 5999 case SP_FileLinkIcon: { 6000 icon = QIcon(standardPixmap(standardIcon, option, widget)); 6001 QPixmap pixmap = d->findIcon(32, QLatin1String("link_overlay.png")); 6002 if (!pixmap.isNull()) { 6003 QPixmap fileIcon = d->findIcon(32, QLatin1String("text-x-generic.png")); 6004 if (fileIcon.isNull()) 6005 fileIcon = d->findIcon(32, QLatin1String("empty.png")); 6006 if (!fileIcon.isNull()) { 6007 QPainter painter(&fileIcon); 6008 painter.drawPixmap(0, 0, 32, 32, pixmap); 6009 icon.addPixmap(fileIcon); 6010 } 6011 } 6012 } 6013 break; 6014 case SP_DirLinkIcon: { 6015 icon = QIcon(standardPixmap(standardIcon, option, widget)); 6016 QPixmap pixmap = d->findIcon(32, QLatin1String("link_overlay.png")); 6017 if (!pixmap.isNull()) { 6018 QPixmap fileIcon = d->findIcon(32, QLatin1String("folder.png")); 6019 if (!fileIcon.isNull()) { 6020 QPainter painter(&fileIcon); 6021 painter.drawPixmap(0, 0, 32, 32, pixmap); 6022 icon.addPixmap(fileIcon); 6023 } 6024 } 5639 QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); 5640 if (!linkIcon.isNull()) { 5641 QIcon baseIcon = standardIconImplementation(SP_DirIcon, option, widget); 5642 const QList<QSize> sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); 5643 for (int i = 0 ; i < sizes.size() ; ++i) { 5644 int size = sizes[i].width(); 5645 QPixmap basePixmap = baseIcon.pixmap(size); 5646 QPixmap linkPixmap = linkIcon.pixmap(size/2); 5647 QPainter painter(&basePixmap); 5648 painter.drawPixmap(size/2, size/2, linkPixmap); 5649 icon.addPixmap(basePixmap); 5650 } 5651 } 6025 5652 } 6026 5653 break; … … 6028 5655 break; 6029 5656 } 5657 } // if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) 6030 5658 if (!icon.isNull()) 6031 5659 return icon; 6032 } 6033 #endif//Q_WS_X11 5660 #if defined(Q_WS_MAC) 5661 if (QApplication::desktopSettingsAware()) { 5662 OSType iconType = 0; 5663 switch (standardIcon) { 5664 case QStyle::SP_MessageBoxQuestion: 5665 case QStyle::SP_MessageBoxInformation: 5666 case QStyle::SP_MessageBoxWarning: 5667 case QStyle::SP_MessageBoxCritical: 5668 iconType = kGenericApplicationIcon; 5669 break; 5670 case SP_DesktopIcon: 5671 iconType = kDesktopIcon; 5672 break; 5673 case SP_TrashIcon: 5674 iconType = kTrashIcon; 5675 break; 5676 case SP_ComputerIcon: 5677 iconType = kComputerIcon; 5678 break; 5679 case SP_DriveFDIcon: 5680 iconType = kGenericFloppyIcon; 5681 break; 5682 case SP_DriveHDIcon: 5683 iconType = kGenericHardDiskIcon; 5684 break; 5685 case SP_DriveCDIcon: 5686 case SP_DriveDVDIcon: 5687 iconType = kGenericCDROMIcon; 5688 break; 5689 case SP_DriveNetIcon: 5690 iconType = kGenericNetworkIcon; 5691 break; 5692 case SP_DirOpenIcon: 5693 iconType = kOpenFolderIcon; 5694 break; 5695 case SP_DirClosedIcon: 5696 case SP_DirLinkIcon: 5697 iconType = kGenericFolderIcon; 5698 break; 5699 case SP_FileLinkIcon: 5700 case SP_FileIcon: 5701 iconType = kGenericDocumentIcon; 5702 break; 5703 case SP_DirIcon: { 5704 // A rather special case 5705 QIcon closeIcon = QStyle::standardIcon(SP_DirClosedIcon, option, widget); 5706 QIcon openIcon = QStyle::standardIcon(SP_DirOpenIcon, option, widget); 5707 closeIcon.addPixmap(openIcon.pixmap(16, 16), QIcon::Normal, QIcon::On); 5708 closeIcon.addPixmap(openIcon.pixmap(32, 32), QIcon::Normal, QIcon::On); 5709 closeIcon.addPixmap(openIcon.pixmap(64, 64), QIcon::Normal, QIcon::On); 5710 closeIcon.addPixmap(openIcon.pixmap(128, 128), QIcon::Normal, QIcon::On); 5711 return closeIcon; 5712 } 5713 case SP_TitleBarNormalButton: 5714 case SP_TitleBarCloseButton: { 5715 QIcon titleBarIcon; 5716 if (standardIcon == SP_TitleBarCloseButton) { 5717 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-16.png")); 5718 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On); 5719 } else { 5720 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-16.png")); 5721 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On); 5722 } 5723 return titleBarIcon; 5724 } 5725 default: 5726 break; 5727 } 5728 if (iconType != 0) { 5729 QIcon retIcon; 5730 IconRef icon; 5731 IconRef overlayIcon = 0; 5732 if (iconType != kGenericApplicationIcon) { 5733 GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon); 5734 } else { 5735 FSRef fsRef; 5736 ProcessSerialNumber psn = { 0, kCurrentProcess }; 5737 GetProcessBundleLocation(&psn, &fsRef); 5738 GetIconRefFromFileInfo(&fsRef, 0, 0, 0, 0, kIconServicesNormalUsageFlag, &icon, 0); 5739 if (standardIcon == SP_MessageBoxCritical) { 5740 overlayIcon = icon; 5741 GetIconRef(kOnSystemDisk, kSystemIconsCreator, kAlertCautionIcon, &icon); 5742 } 5743 } 5744 if (icon) { 5745 qt_mac_constructQIconFromIconRef(icon, overlayIcon, &retIcon, standardIcon); 5746 ReleaseIconRef(icon); 5747 } 5748 if (overlayIcon) 5749 ReleaseIconRef(overlayIcon); 5750 return retIcon; 5751 } 5752 } // if (QApplication::desktopSettingsAware()) 5753 #endif // Q_WS_MAC 6034 5754 6035 5755 switch (standardIcon) { … … 6120 5840 break; 6121 5841 case SP_ArrowForward: 6122 if ( QApplication::layoutDirection() == Qt::RightToLeft)5842 if (rtl) 6123 5843 return standardIconImplementation(SP_ArrowLeft, option, widget); 6124 5844 return standardIconImplementation(SP_ArrowRight, option, widget); 6125 5845 case SP_ArrowBack: 6126 if ( QApplication::layoutDirection() == Qt::RightToLeft)5846 if (rtl) 6127 5847 return standardIconImplementation(SP_ArrowRight, option, widget); 6128 5848 return standardIconImplementation(SP_ArrowLeft, option, widget); … … 6231 5951 #endif // QT_NO_IMAGEFORMAT_PNG 6232 5952 default: 6233 icon.addPixmap( standardPixmap(standardIcon, option, widget));5953 icon.addPixmap(proxy()->standardPixmap(standardIcon, option, widget)); 6234 5954 break; 6235 5955 } -
trunk/src/gui/styles/qcommonstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qcommonstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 62 62 63 63 class QStringList; 64 65 #ifdef Q_WS_X1166 class QIconTheme67 {68 public:69 QIconTheme(QHash <int, QString> dirList, QStringList parents) :70 _dirList(dirList), _parents(parents), _valid(true){ }71 QIconTheme() : _valid(false){ }72 73 QHash <int, QString> dirList() {return _dirList;}74 QStringList parents() {return _parents;}75 bool isValid() {return _valid;}76 77 private:78 QHash <int, QString> _dirList;79 QStringList _parents;80 bool _valid;81 };82 #endif83 64 84 65 // Private class … … 123 104 #endif 124 105 mutable QIcon tabBarcloseButtonIcon; 125 126 //icon detection on X11 127 #ifdef Q_WS_X11 128 void lookupIconTheme() const; 129 QIcon createIcon(const QString &) const; 130 QPixmap findIcon(int size, const QString &) const; 131 QPixmap findIconHelper(int size, const QString &, const QString &, QStringList &visited) const; 132 QIconTheme parseIndexFile(const QString &themeName) const; 133 mutable QString themeName; 134 mutable QStringList iconDirs; 135 mutable QHash <QString, QIconTheme> themeList; 106 #ifndef QT_NO_TABBAR 107 void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const; 136 108 #endif 137 138 109 }; 139 110 -
trunk/src/gui/styles/qcommonstylepixmaps_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qgtkpainter.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 109 109 QRect pixmapRect(0, 0, rect.width(), rect.height()); \ 110 110 { \ 111 GdkPixmap *pixmap = QGtk ::gdk_pixmap_new((GdkDrawable*)(m_window->window), \111 GdkPixmap *pixmap = QGtkStylePrivate::gdk_pixmap_new((GdkDrawable*)(m_window->window), \ 112 112 rect.width(), rect.height(), -1); \ 113 113 if (!pixmap) \ 114 114 return; \ 115 style = QGtk ::gtk_style_attach (style, m_window->window); \116 QGtk ::gdk_draw_rectangle(pixmap, m_alpha ? style->black_gc : *style->bg_gc, true, \115 style = QGtkStylePrivate::gtk_style_attach (style, m_window->window); \ 116 QGtkStylePrivate::gdk_draw_rectangle(pixmap, m_alpha ? style->black_gc : *style->bg_gc, true, \ 117 117 0, 0, rect.width(), rect.height()); \ 118 118 draw_func; \ 119 GdkPixbuf *imgb = QGtk ::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.width(), rect.height());\119 GdkPixbuf *imgb = QGtkStylePrivate::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect.width(), rect.height());\ 120 120 if (!imgb) \ 121 121 return; \ 122 imgb = QGtk ::gdk_pixbuf_get_from_drawable(imgb, pixmap, NULL, 0, 0, 0, 0, \122 imgb = QGtkStylePrivate::gdk_pixbuf_get_from_drawable(imgb, pixmap, NULL, 0, 0, 0, 0, \ 123 123 rect.width(), rect.height()); \ 124 uchar* bdata = (uchar*)QGtk ::gdk_pixbuf_get_pixels(imgb); \124 uchar* bdata = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(imgb); \ 125 125 if (m_alpha) { \ 126 QGtk ::gdk_draw_rectangle(pixmap, style->white_gc, true, 0, 0, rect.width(), rect.height()); \126 QGtkStylePrivate::gdk_draw_rectangle(pixmap, style->white_gc, true, 0, 0, rect.width(), rect.height()); \ 127 127 draw_func; \ 128 GdkPixbuf *imgw = QGtk ::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect. \128 GdkPixbuf *imgw = QGtkStylePrivate::gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, rect. \ 129 129 width(), rect.height()); \ 130 130 if (!imgw) \ 131 131 return; \ 132 imgw = QGtk ::gdk_pixbuf_get_from_drawable(imgw, pixmap, NULL, 0, 0, 0, 0, \132 imgw = QGtkStylePrivate::gdk_pixbuf_get_from_drawable(imgw, pixmap, NULL, 0, 0, 0, 0, \ 133 133 rect.width(), rect.height()); \ 134 uchar* wdata = (uchar*)QGtk ::gdk_pixbuf_get_pixels(imgw); \134 uchar* wdata = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(imgw); \ 135 135 cache = renderTheme(bdata, wdata, rect); \ 136 QGtk ::gdk_pixbuf_unref(imgw); \136 QGtkStylePrivate::gdk_pixbuf_unref(imgw); \ 137 137 } else { \ 138 138 cache = renderTheme(bdata, 0, rect); \ 139 139 } \ 140 QGtk ::gdk_drawable_unref(pixmap); \141 QGtk ::gdk_pixbuf_unref(imgb); \140 QGtkStylePrivate::gdk_drawable_unref(pixmap); \ 141 QGtkStylePrivate::gdk_pixbuf_unref(imgb); \ 142 142 } 143 143 144 144 QGtkPainter::QGtkPainter(QPainter *_painter) 145 : m_window(QGtk ::gtkWidget(QLatin1String("GtkWindow")))145 : m_window(QGtkStylePrivate::gtkWidget(QLatin1String("GtkWindow"))) 146 146 , m_painter(_painter) 147 147 , m_alpha(true) … … 186 186 QPixmap QGtkPainter::getIcon(const char* iconName, GtkIconSize size) 187 187 { 188 GtkStyle *style = QGtk ::gtkStyle();189 GtkIconSet* iconSet = QGtk ::gtk_icon_factory_lookup_default (iconName);190 GdkPixbuf* icon = QGtk ::gtk_icon_set_render_icon(iconSet,188 GtkStyle *style = QGtkStylePrivate::gtkStyle(); 189 GtkIconSet* iconSet = QGtkStylePrivate::gtk_icon_factory_lookup_default (iconName); 190 GdkPixbuf* icon = QGtkStylePrivate::gtk_icon_set_render_icon(iconSet, 191 191 style, 192 192 GTK_TEXT_DIR_LTR, … … 195 195 NULL, 196 196 "button"); 197 uchar* data = (uchar*)QGtk ::gdk_pixbuf_get_pixels(icon);198 int width = QGtk ::gdk_pixbuf_get_width(icon);199 int height = QGtk ::gdk_pixbuf_get_height(icon);197 uchar* data = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(icon); 198 int width = QGtkStylePrivate::gdk_pixbuf_get_width(icon); 199 int height = QGtkStylePrivate::gdk_pixbuf_get_height(icon); 200 200 QImage converted(width, height, QImage::Format_ARGB32); 201 201 uchar* tdata = (uchar*)converted.bits(); … … 209 209 } 210 210 211 QGtk ::gdk_pixbuf_unref(icon);211 QGtkStylePrivate::gdk_pixbuf_unref(icon); 212 212 213 213 // should we free iconset? … … 241 241 242 242 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 243 DRAW_TO_CACHE(QGtk ::gtk_paint_box_gap (style,243 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box_gap (style, 244 244 pixmap, 245 245 state, … … 306 306 307 307 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 308 DRAW_TO_CACHE(QGtk ::gtk_paint_box (style,308 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box (style, 309 309 pixmap, 310 310 state, … … 357 357 + hLineExtras + pmKey; 358 358 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 359 DRAW_TO_CACHE(QGtk ::gtk_paint_hline (style,359 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_hline (style, 360 360 pixmap, 361 361 state, … … 384 384 gtkWidget) + vLineExtras +pmKey; 385 385 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 386 DRAW_TO_CACHE(QGtk ::gtk_paint_vline (style,386 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_vline (style, 387 387 pixmap, 388 388 state, … … 411 411 gtkWidget) + QString::number(expander_state) + pmKey; 412 412 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 413 DRAW_TO_CACHE(QGtk ::gtk_paint_expander (style, pixmap,413 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_expander (style, pixmap, 414 414 state, NULL, 415 415 gtkWidget, part, … … 434 434 QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) + pmKey; 435 435 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 436 DRAW_TO_CACHE(QGtk ::gtk_paint_focus (style, pixmap, state, NULL,436 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_focus (style, pixmap, state, NULL, 437 437 gtkWidget, 438 438 part, … … 459 459 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey; 460 460 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 461 DRAW_TO_CACHE(QGtk ::gtk_paint_resize_grip (style, pixmap, state,461 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_resize_grip (style, pixmap, state, 462 462 NULL, gtkWidget, 463 463 part, edge, 0, 0, … … 489 489 int yOffset = m_cliprect.isValid() ? arrowrect.y() - m_cliprect.y() : 0; 490 490 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 491 DRAW_TO_CACHE(QGtk ::gtk_paint_arrow (style, pixmap, state, shadow,491 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_arrow (style, pixmap, state, shadow, 492 492 >kCliprect, 493 493 gtkWidget, … … 516 516 + QString::number(orientation); 517 517 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 518 DRAW_TO_CACHE(QGtk ::gtk_paint_handle (style,518 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_handle (style, 519 519 pixmap, 520 520 state, … … 544 544 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey; 545 545 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 546 DRAW_TO_CACHE(QGtk ::gtk_paint_slider (style,546 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_slider (style, 547 547 pixmap, 548 548 state, … … 575 575 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey; 576 576 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 577 DRAW_TO_CACHE(QGtk ::gtk_paint_shadow(style, pixmap, state, shadow, NULL,577 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_shadow(style, pixmap, state, shadow, NULL, 578 578 gtkWidget, part, 0, 0, rect.width(), rect.height())); 579 579 if (m_usePixmapCache) … … 594 594 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey; 595 595 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 596 DRAW_TO_CACHE(QGtk ::gtk_paint_flat_box (style,596 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_flat_box (style, 597 597 pixmap, 598 598 state, … … 623 623 624 624 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 625 DRAW_TO_CACHE(QGtk ::gtk_paint_extension (style, pixmap, state, shadow,625 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_extension (style, pixmap, state, shadow, 626 626 NULL, gtkWidget, 627 627 (gchar*)part, 0, 0, … … 652 652 int yOffset = m_cliprect.isValid() ? radiorect.y() - m_cliprect.y() : 0; 653 653 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 654 DRAW_TO_CACHE(QGtk ::gtk_paint_option(style, pixmap,654 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_option(style, pixmap, 655 655 state, shadow, 656 656 >kCliprect, … … 684 684 int yOffset = m_cliprect.isValid() ? checkrect.y() - m_cliprect.y() : 0; 685 685 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 686 DRAW_TO_CACHE(QGtk ::gtk_paint_check (style,686 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_check (style, 687 687 pixmap, 688 688 state, -
trunk/src/gui/styles/qgtkpainter_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 57 57 #if !defined(QT_NO_STYLE_GTK) 58 58 59 #include "gtksymbols_p.h"60 59 #include <QtGui/QCleanlooksStyle> 61 60 #include <QtGui/QPainter> 62 61 #include <QtGui/QPalette> 63 62 #include <QtGui/QFont> 63 #include <private/qgtkstyle_p.h> 64 64 65 65 QT_BEGIN_NAMESPACE -
trunk/src/gui/styles/qgtkstyle.cpp
r2 r561 1 /******* 1 /**************************************************************************** 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 70 70 #include <qpixmapcache.h> 71 71 #undef signals // Collides with GTK stymbols 72 #include "qgtkpainter_p.h" 73 72 #include <private/qgtkpainter_p.h> 73 #include <private/qstylehelper_p.h> 74 #include <private/qgtkstyle_p.h> 74 75 #include <private/qcleanlooksstyle_p.h> 75 76 76 77 77 78 QT_BEGIN_NAMESPACE 78 79 typedef QStringList (*_qt_filedialog_open_filenames_hook)(QWidget * parent, const QString &caption, const QString &dir,80 const QString &filter, QString *selectedFilter, QFileDialog::Options options);81 typedef QString (*_qt_filedialog_open_filename_hook) (QWidget * parent, const QString &caption, const QString &dir,82 const QString &filter, QString *selectedFilter, QFileDialog::Options options);83 typedef QString (*_qt_filedialog_save_filename_hook) (QWidget * parent, const QString &caption, const QString &dir,84 const QString &filter, QString *selectedFilter, QFileDialog::Options options);85 typedef QString (*_qt_filedialog_existing_directory_hook)(QWidget *parent, const QString &caption, const QString &dir,86 QFileDialog::Options options);87 88 extern Q_GUI_EXPORT _qt_filedialog_open_filename_hook qt_filedialog_open_filename_hook;89 extern Q_GUI_EXPORT _qt_filedialog_open_filenames_hook qt_filedialog_open_filenames_hook;90 extern Q_GUI_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_hook;91 extern Q_GUI_EXPORT _qt_filedialog_existing_directory_hook qt_filedialog_existing_directory_hook;92 79 93 80 static const char * const dock_widget_close_xpm[] = … … 137 124 }; 138 125 139 140 class QGtkStyleFilter : public QObject141 {142 public:143 QGtkStyleFilter() {144 qApp->installEventFilter(this);145 }146 147 private:148 bool eventFilter(QObject *obj, QEvent *e);149 };150 151 bool QGtkStyleFilter::eventFilter(QObject *obj, QEvent *e)152 {153 if (e->type() == QEvent::ApplicationPaletteChange) {154 // Only do this the first time since this will also155 // generate applicationPaletteChange events156 extern QHash<QByteArray, QPalette> *qt_app_palettes_hash(); //qapplication.cpp157 if (!qt_app_palettes_hash() || qt_app_palettes_hash()->isEmpty()) {158 QGtk::applyCustomPaletteHash();159 }160 }161 return QObject::eventFilter(obj, e);162 }163 164 class QGtkStylePrivate : public QCleanlooksStylePrivate165 {166 Q_DECLARE_PUBLIC(QGtkStyle)167 public:168 QGtkStylePrivate()169 : QCleanlooksStylePrivate()170 {}171 QGtkStyleFilter filter;172 };173 174 126 static const int groupBoxBottomMargin = 2; // space below the groupbox 175 127 static const int groupBoxTitleMargin = 6; // space between contents and title 176 128 static const int groupBoxTopMargin = 2; 177 static bool UsePixmapCache = true; 178 179 // Get size of the arrow controls in a GtkSpinButton 180 static int spinboxArrowSize() 129 130 /*! 131 Returns the configuration string for \a value. 132 Returns \a fallback if \a value is not found. 133 */ 134 QString QGtkStyle::getGConfString(const QString &value, const QString &fallback) 181 135 { 182 const int MIN_ARROW_WIDTH = 6; 183 GtkWidget *spinButton = QGtk::gtkWidget(QLS("GtkSpinButton")); 184 GtkStyle *style = spinButton->style; 185 gint size = QGtk::pango_font_description_get_size (style->font_desc); 186 gint arrow_size; 187 arrow_size = qMax(PANGO_PIXELS (size), MIN_ARROW_WIDTH) + style->xthickness; 188 arrow_size += arrow_size%2 + 1; 189 return arrow_size; 136 return QGtkStylePrivate::getGConfString(value, fallback); 137 } 138 139 /*! 140 Returns the configuration boolean for \a key. 141 Returns \a fallback if \a key is not found. 142 */ 143 bool QGtkStyle::getGConfBool(const QString &key, bool fallback) 144 { 145 return QGtkStylePrivate::getGConfBool(key, fallback); 190 146 } 191 147 … … 209 165 } 210 166 211 // Note this is different from uniqueName as used in QGtkPainter212 static QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)213 {214 QString tmp;215 const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);216 tmp.sprintf("%s-%d-%d-%d-%lld-%dx%d", key.toLatin1().constData(), uint(option->state),217 option->direction, complexOption ? uint(complexOption->activeSubControls) : uint(0),218 option->palette.cacheKey(), size.width(), size.height());219 return tmp;220 }221 222 167 /*! 223 168 \class QGtkStyle … … 244 189 : QCleanlooksStyle(*new QGtkStylePrivate) 245 190 { 246 QGtk::initGtkWidgets(); 191 Q_D(QGtkStyle); 192 d->init(); 247 193 } 194 195 /*! 196 \internal 197 198 Constructs a QGtkStyle object. 199 */ 200 QGtkStyle::QGtkStyle(QGtkStylePrivate &dd) 201 : QCleanlooksStyle(dd) 202 { 203 Q_D(QGtkStyle); 204 d->init(); 205 } 206 248 207 249 208 /*! … … 259 218 QPalette QGtkStyle::standardPalette() const 260 219 { 220 Q_D(const QGtkStyle); 221 261 222 QPalette palette = QCleanlooksStyle::standardPalette(); 262 if ( QGtk::isThemeAvailable()) {263 GtkStyle *style = QGtk::gtkStyle();264 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));265 GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry"));223 if (d->isThemeAvailable()) { 224 GtkStyle *style = d->gtkStyle(); 225 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 226 GtkWidget *gtkEntry = d->getTextColorWidget(); 266 227 267 228 GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg; … … 293 254 294 255 QColor alternateRowColor = palette.base().color().lighter(93); // ref gtkstyle.c draw_flat_box 295 GtkWidget *gtkTreeView = QGtk::gtkWidget(QLS("GtkTreeView"));256 GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView")); 296 257 GdkColor *gtkAltBase = NULL; 297 QGtk::gtk_widget_style_get(gtkTreeView, "odd-row-color", >kAltBase, NULL);258 d->gtk_widget_style_get(gtkTreeView, "odd-row-color", >kAltBase, NULL); 298 259 if (gtkAltBase) { 299 260 alternateRowColor = QColor(gtkAltBase->red>>8, gtkAltBase->green>>8, gtkAltBase->blue>>8); 300 QGtk::gdk_color_free(gtkAltBase);261 d->gdk_color_free(gtkAltBase); 301 262 } 302 263 palette.setColor(QPalette::AlternateBase, alternateRowColor); … … 318 279 palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight); 319 280 palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText); 320 style = QGtk::gtk_rc_get_style_by_paths(QGtk::gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", Q_GTK_TYPE_WINDOW); 281 style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", 282 d->gtk_window_get_type()); 321 283 if (style) { 322 284 gdkText = style->fg[GTK_STATE_NORMAL]; … … 333 295 void QGtkStyle::polish(QPalette &palette) 334 296 { 297 Q_D(QGtkStyle); 298 335 299 // QCleanlooksStyle will alter the palette, hence we do 336 300 // not want to polish the palette unless we are using it as 337 301 // the fallback 338 if (! QGtk::isThemeAvailable())302 if (!d->isThemeAvailable()) 339 303 QCleanlooksStyle::polish(palette); 340 304 else … … 347 311 void QGtkStyle::polish(QApplication *app) 348 312 { 313 Q_D(QGtkStyle); 314 349 315 QCleanlooksStyle::polish(app); 350 316 // Custom fonts and palettes with QtConfig are intentionally 351 317 // not supported as these should be entirely determined by 352 318 // current Gtk settings 353 if (app->desktopSettingsAware() && QGtk::isThemeAvailable()) {319 if (app->desktopSettingsAware() && d->isThemeAvailable()) { 354 320 QApplicationPrivate::setSystemPalette(standardPalette()); 355 QApplicationPrivate::setSystemFont( QGtk::getThemeFont());356 QGtk::applyCustomPaletteHash();357 if (! QGtk::isKDE4Session()) {358 qt_filedialog_open_filename_hook = &QGtk ::openFilename;359 qt_filedialog_save_filename_hook = &QGtk ::saveFilename;360 qt_filedialog_open_filenames_hook = &QGtk ::openFilenames;361 qt_filedialog_existing_directory_hook = &QGtk ::openDirectory;321 QApplicationPrivate::setSystemFont(d->getThemeFont()); 322 d->applyCustomPaletteHash(); 323 if (!d->isKDE4Session()) { 324 qt_filedialog_open_filename_hook = &QGtkStylePrivate::openFilename; 325 qt_filedialog_save_filename_hook = &QGtkStylePrivate::saveFilename; 326 qt_filedialog_open_filenames_hook = &QGtkStylePrivate::openFilenames; 327 qt_filedialog_existing_directory_hook = &QGtkStylePrivate::openDirectory; 362 328 } 363 329 } … … 369 335 void QGtkStyle::unpolish(QApplication *app) 370 336 { 337 Q_D(QGtkStyle); 338 371 339 QCleanlooksStyle::unpolish(app); 372 340 QPixmapCache::clear(); 373 341 374 if (app->desktopSettingsAware() && QGtk::isThemeAvailable()375 && ! QGtk::isKDE4Session()) {342 if (app->desktopSettingsAware() && d->isThemeAvailable() 343 && !d->isKDE4Session()) { 376 344 qt_filedialog_open_filename_hook = 0; 377 345 qt_filedialog_save_filename_hook = 0; … … 387 355 void QGtkStyle::polish(QWidget *widget) 388 356 { 357 Q_D(QGtkStyle); 358 389 359 QCleanlooksStyle::polish(widget); 390 if (! QGtk::isThemeAvailable())360 if (!d->isThemeAvailable()) 391 361 return; 392 362 if (qobject_cast<QAbstractButton*>(widget) … … 416 386 */ 417 387 int QGtkStyle::pixelMetric(PixelMetric metric, 418 419 388 const QStyleOption *option, 420 389 const QWidget *widget) const 421 390 { 422 if (!QGtk::isThemeAvailable()) 391 Q_D(const QGtkStyle); 392 393 if (!d->isThemeAvailable()) 423 394 return QCleanlooksStyle::pixelMetric(metric, option, widget); 424 395 … … 427 398 if (qobject_cast<const QFrame*>(widget)) { 428 399 if (GtkStyle *style = 429 QGtk::gtk_rc_get_style_by_paths(QGtk::gtk_settings_get_default(),400 d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), 430 401 "*.GtkScrolledWindow", 431 402 "*.GtkScrolledWindow", 432 Q_GTK_TYPE_WINDOW))403 d->gtk_window_get_type())) 433 404 return qMax(style->xthickness, style->ythickness); 434 405 } … … 451 422 452 423 case PM_ButtonShiftHorizontal: { 453 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));424 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 454 425 guint horizontal_shift; 455 QGtk::gtk_widget_style_get(gtkButton, "child-displacement-x", &horizontal_shift, NULL);426 d->gtk_widget_style_get(gtkButton, "child-displacement-x", &horizontal_shift, NULL); 456 427 return horizontal_shift; 457 428 } 458 429 459 430 case PM_ButtonShiftVertical: { 460 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));431 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 461 432 guint vertical_shift; 462 QGtk::gtk_widget_style_get(gtkButton, "child-displacement-y", &vertical_shift, NULL);433 d->gtk_widget_style_get(gtkButton, "child-displacement-y", &vertical_shift, NULL); 463 434 return vertical_shift; 464 435 } … … 468 439 469 440 case PM_MenuPanelWidth: { 470 GtkWidget *gtkMenu = QGtk::gtkWidget(QLS("GtkMenu"));441 GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu")); 471 442 guint horizontal_padding = 0; 472 443 // horizontal-padding is used by Maemo to get thicker borders 473 if (! QGtk::gtk_check_version(2, 10, 0))474 QGtk::gtk_widget_style_get(gtkMenu, "horizontal-padding", &horizontal_padding, NULL);444 if (!d->gtk_check_version(2, 10, 0)) 445 d->gtk_widget_style_get(gtkMenu, "horizontal-padding", &horizontal_padding, NULL); 475 446 int padding = qMax<int>(gtkMenu->style->xthickness, horizontal_padding); 476 447 return padding; … … 479 450 case PM_ButtonIconSize: { 480 451 int retVal = 24; 481 GtkSettings *settings = QGtk::gtk_settings_get_default();452 GtkSettings *settings = d->gtk_settings_get_default(); 482 453 gchararray icon_sizes; 483 454 g_object_get(settings, "gtk-icon-sizes", &icon_sizes, NULL); … … 525 496 case PM_SliderThickness: 526 497 case PM_SliderControlThickness: { 527 GtkWidget *gtkScale = QGtk::gtkWidget(QLS("GtkHScale"));498 GtkWidget *gtkScale = d->gtkWidget(QLS("GtkHScale")); 528 499 gint val; 529 QGtk::gtk_widget_style_get(gtkScale, "slider-width", &val, NULL);500 d->gtk_widget_style_get(gtkScale, "slider-width", &val, NULL); 530 501 if (metric == PM_SliderControlThickness) 531 502 return val + 2*gtkScale->style->ythickness; … … 536 507 gint sliderLength; 537 508 gint trough_border; 538 GtkWidget *hScrollbar = QGtk::gtkWidget(QLS("GtkHScrollbar"));539 QGtk::gtk_widget_style_get(hScrollbar,509 GtkWidget *hScrollbar = d->gtkWidget(QLS("GtkHScrollbar")); 510 d->gtk_widget_style_get(hScrollbar, 540 511 "trough-border", &trough_border, 541 512 "slider-width", &sliderLength, … … 549 520 case PM_SliderLength: 550 521 gint val; 551 QGtk::gtk_widget_style_get(QGtk::gtkWidget(QLS("GtkHScale")), "slider-length", &val, NULL);522 d->gtk_widget_style_get(d->gtkWidget(QLS("GtkHScale")), "slider-length", &val, NULL); 552 523 return val; 553 524 … … 556 527 case PM_IndicatorWidth: 557 528 case PM_IndicatorHeight: { 558 GtkWidget *gtkCheckButton = QGtk::gtkWidget(QLS("GtkCheckButton"));529 GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); 559 530 gint size, spacing; 560 QGtk::gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, "indicator-size", &size, NULL);531 d->gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, "indicator-size", &size, NULL); 561 532 return size + 2 * spacing; 562 533 } 563 534 564 535 case PM_MenuBarVMargin: { 565 GtkWidget *gtkMenubar = QGtk::gtkWidget(QLS("GtkMenuBar"));536 GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar")); 566 537 return qMax(0, gtkMenubar->style->ythickness); 567 538 } … … 569 540 { 570 541 gint spacing = 3; 571 GtkWidget *gtkScrollWindow = QGtk::gtkWidget(QLS("GtkScrolledWindow"));542 GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow")); 572 543 Q_ASSERT(gtkScrollWindow); 573 QGtk::gtk_widget_style_get(gtkScrollWindow, "scrollbar-spacing", &spacing, NULL);544 d->gtk_widget_style_get(gtkScrollWindow, "scrollbar-spacing", &spacing, NULL); 574 545 return spacing; 575 546 } 576 547 case PM_SubMenuOverlap: { 577 548 gint offset = 0; 578 GtkWidget *gtkMenu = QGtk::gtkWidget(QLS("GtkMenu"));579 QGtk::gtk_widget_style_get(gtkMenu, "horizontal-offset", &offset, NULL);549 GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu")); 550 d->gtk_widget_style_get(gtkMenu, "horizontal-offset", &offset, NULL); 580 551 return offset; 581 552 } … … 592 563 QStyleHintReturn *returnData = 0) const 593 564 { 594 if (!QGtk::isThemeAvailable()) 565 Q_D(const QGtkStyle); 566 567 if (!d->isThemeAvailable()) 595 568 return QCleanlooksStyle::styleHint(hint, option, widget, returnData); 596 569 … … 600 573 int ret = QDialogButtonBox::GnomeLayout; 601 574 gboolean alternateOrder = 0; 602 GtkSettings *settings = QGtk::gtk_settings_get_default();575 GtkSettings *settings = d->gtk_settings_get_default(); 603 576 g_object_get(settings, "gtk-alternative-button-order", &alternateOrder, NULL); 604 577 … … 611 584 break; 612 585 586 case SH_ToolButtonStyle: 587 { 588 if (d->isKDE4Session()) 589 return QCleanlooksStyle::styleHint(hint, option, widget, returnData); 590 GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar")); 591 GtkToolbarStyle toolbar_style = GTK_TOOLBAR_ICONS; 592 g_object_get(gtkToolbar, "toolbar-style", &toolbar_style, NULL); 593 switch (toolbar_style) { 594 case GTK_TOOLBAR_TEXT: 595 return Qt::ToolButtonTextOnly; 596 case GTK_TOOLBAR_BOTH: 597 return Qt::ToolButtonTextUnderIcon; 598 case GTK_TOOLBAR_BOTH_HORIZ: 599 return Qt::ToolButtonTextBesideIcon; 600 case GTK_TOOLBAR_ICONS: 601 default: 602 return Qt::ToolButtonIconOnly; 603 } 604 } 605 break; 613 606 case SH_SpinControls_DisableOnBounds: 614 607 return int(true); … … 618 611 619 612 case SH_ComboBox_Popup: { 620 GtkWidget *gtkComboBox = QGtk::gtkWidget(QLS("GtkComboBox"));613 GtkWidget *gtkComboBox = d->gtkWidget(QLS("GtkComboBox")); 621 614 gboolean appears_as_list; 622 QGtk::gtk_widget_style_get((GtkWidget*)gtkComboBox, "appears-as-list", &appears_as_list, NULL);615 d->gtk_widget_style_get((GtkWidget*)gtkComboBox, "appears-as-list", &appears_as_list, NULL); 623 616 return appears_as_list ? 0 : 1; 624 617 } … … 632 625 case SH_Menu_SubMenuPopupDelay: { 633 626 gint delay = 225; 634 GtkSettings *settings = QGtk::gtk_settings_get_default();627 GtkSettings *settings = d->gtk_settings_get_default(); 635 628 g_object_get(settings, "gtk-menu-popup-delay", &delay, NULL); 636 629 return delay; … … 641 634 if (widget && widget->isWindow()) 642 635 scrollbars_within_bevel = true; 643 else if (! QGtk::gtk_check_version(2, 12, 0)) {644 GtkWidget *gtkScrollWindow = QGtk::gtkWidget(QLS("GtkScrolledWindow"));645 QGtk::gtk_widget_style_get(gtkScrollWindow, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL);636 else if (!d->gtk_check_version(2, 12, 0)) { 637 GtkWidget *gtkScrollWindow = d->gtkWidget(QLS("GtkScrolledWindow")); 638 d->gtk_widget_style_get(gtkScrollWindow, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL); 646 639 } 647 640 return !scrollbars_within_bevel; 641 } 642 643 case SH_DialogButtonBox_ButtonsHaveIcons: { 644 static bool buttonsHaveIcons = d->getGConfBool(QLS("/desktop/gnome/interface/buttons_have_icons")); 645 return buttonsHaveIcons; 646 } 647 648 case SH_UnderlineShortcut: { 649 gboolean underlineShortcut = true; 650 if (!d->gtk_check_version(2, 12, 0)) { 651 GtkSettings *settings = d->gtk_settings_get_default(); 652 g_object_get(settings, "gtk-enable-mnemonics", &underlineShortcut, NULL); 653 } 654 return underlineShortcut; 648 655 } 649 656 … … 657 664 */ 658 665 void QGtkStyle::drawPrimitive(PrimitiveElement element, 659 660 666 const QStyleOption *option, 661 667 QPainter *painter, 662 668 const QWidget *widget) const 663 669 { 664 if (!QGtk::isThemeAvailable()) { 670 Q_D(const QGtkStyle); 671 672 if (!d->isThemeAvailable()) { 665 673 QCleanlooksStyle::drawPrimitive(element, option, painter, widget); 666 674 return; 667 675 } 668 676 669 GtkStyle* style = QGtk::gtkStyle();677 GtkStyle* style = d->gtkStyle(); 670 678 QGtkPainter gtkPainter(painter); 671 679 … … 675 683 QStyleOption copy = *option; 676 684 copy.state |= State_Raised; 677 drawPrimitive(PE_PanelMenu, ©, painter, widget);685 proxy()->drawPrimitive(PE_PanelMenu, ©, painter, widget); 678 686 break; 679 687 } … … 682 690 // thin rectangular images 683 691 const int pmSize = 64; 684 const int border = p ixelMetric(PM_DefaultFrameWidth, option, widget);692 const int border = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); 685 693 const QString pmKey = QString(QLS("windowframe %0")).arg(option->state); 686 694 687 695 QPixmap pixmap; 688 QPixmapCache::find(pmKey, pixmap);689 696 QRect pmRect(QPoint(0,0), QSize(pmSize, pmSize)); 690 697 691 698 // Only draw through style once 692 if ( pixmap.isNull()) {699 if (!QPixmapCache::find(pmKey, pixmap)) { 693 700 pixmap = QPixmap(pmSize, pmSize); 694 701 pixmap.fill(Qt::transparent); … … 703 710 shadow_type = GTK_SHADOW_OUT; 704 711 705 GtkStyle *style = QGtk::gtk_rc_get_style_by_paths(QGtk::gtk_settings_get_default(),706 "*.GtkScrolledWindow", "*.GtkScrolledWindow", Q_GTK_TYPE_WINDOW);712 GtkStyle *style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), 713 "*.GtkScrolledWindow", "*.GtkScrolledWindow", d->gtk_window_get_type()); 707 714 if (style) 708 gtkFramePainter.paintShadow( QGtk::gtkWidget(QLS("GtkFrame")), "viewport", pmRect,715 gtkFramePainter.paintShadow(d->gtkWidget(QLS("GtkFrame")), "viewport", pmRect, 709 716 option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, 710 717 shadow_type, style); … … 733 740 734 741 case PE_PanelTipLabel: { 735 GtkWidget *gtkWindow = QGtk::gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed 736 style = QGtk::gtk_rc_get_style_by_paths(QGtk::gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", Q_GTK_TYPE_WINDOW); 742 GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed 743 style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", 744 d->gtk_window_get_type()); 737 745 gtkPainter.paintFlatBox(gtkWindow, "tooltip", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, style); 738 746 } … … 747 755 } 748 756 GtkShadowType shadow_type; 749 GtkWidget *gtkStatusbarFrame = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame"));750 QGtk::gtk_widget_style_get(gtkStatusbarFrame->parent, "shadow-type", &shadow_type, NULL);757 GtkWidget *gtkStatusbarFrame = d->gtkWidget(QLS("GtkStatusbar.GtkFrame")); 758 d->gtk_widget_style_get(gtkStatusbarFrame->parent, "shadow-type", &shadow_type, NULL); 751 759 gtkPainter.paintShadow(gtkStatusbarFrame, "frame", option->rect, GTK_STATE_NORMAL, 752 760 shadow_type, gtkStatusbarFrame->style); … … 756 764 case PE_IndicatorHeaderArrow: 757 765 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { 758 GtkWidget *gtkTreeHeader = QGtk::gtkWidget(QLS("GtkTreeView.GtkButton"));766 GtkWidget *gtkTreeHeader = d->gtkWidget(QLS("GtkTreeView.GtkButton")); 759 767 GtkStateType state = gtkPainter.gtkState(option); 760 768 style = gtkTreeHeader->style; … … 789 797 if (option->state & State_Children) { 790 798 QRect rect = option->rect; 791 rect = QRect(0, 0, 1 0, 10);799 rect = QRect(0, 0, 12, 12); 792 800 rect.moveCenter(option->rect.center()); 793 801 rect.translate(2, 0); 794 802 GtkExpanderStyle openState = GTK_EXPANDER_EXPANDED; 795 803 GtkExpanderStyle closedState = GTK_EXPANDER_COLLAPSED; 796 GtkWidget *gtkExpander = QGtk::gtkWidget(QLS("GtkExpander")); 797 guint expanderSize; 798 QGtk::gtk_widget_style_get(gtkExpander, "expander-size", &expanderSize, NULL); 799 // Note CleanIce will crash unless a GtkExpander is provided 800 // but providing the expander will enforce the expander-size, which we 801 // don't neccessarily have room for 804 GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView")); 805 802 806 GtkStateType state = GTK_STATE_NORMAL; 803 807 if (!(option->state & State_Enabled)) … … 805 809 else if (option->state & State_MouseOver) 806 810 state = GTK_STATE_PRELIGHT; 807 gtkPainter.paintExpander(expanderSize <= 10 ? gtkExpander : NULL, "expander", rect, state, 808 option->state & State_Open ? openState : closedState , gtkExpander->style); 811 812 gtkPainter.paintExpander(gtkTreeView, "treeview", rect, state, 813 option->state & State_Open ? openState : closedState , gtkTreeView->style); 809 814 } 810 815 break; … … 833 838 { 834 839 const int margin = 6; 835 GtkWidget *gtkSeparator = QGtk::gtkWidget(QLS("GtkToolbar.GtkSeparatorToolItem"));840 GtkWidget *gtkSeparator = d->gtkWidget(QLS("GtkToolbar.GtkSeparatorToolItem")); 836 841 if (option->state & State_Horizontal) { 837 842 const int offset = option->rect.width()/2; … … 853 858 854 859 case PE_IndicatorToolBarHandle: { 855 GtkWidget *gtkToolbar = QGtk::gtkWidget(QLS("GtkToolbar"));860 GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar")); 856 861 GtkShadowType shadow_type; 857 QGtk::gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);862 d->gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL); 858 863 //Note when the toolbar is horizontal, the handle is vertical 859 864 painter->setClipRect(option->rect); … … 893 898 int bsx = 0, bsy = 0; 894 899 if (option->state & State_Sunken) { 895 bsx = p ixelMetric(PM_ButtonShiftHorizontal);896 bsy = p ixelMetric(PM_ButtonShiftVertical);900 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); 901 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); 897 902 } 898 903 QRect arrowRect = option->rect.adjusted(border + bsx, border + bsy, -border + bsx, -border + bsy); … … 901 906 902 907 QColor arrowColor = option->palette.buttonText().color(); 903 GtkWidget *gtkArrow = QGtk::gtkWidget(QLS("GtkArrow"));908 GtkWidget *gtkArrow = d->gtkWidget(QLS("GtkArrow")); 904 909 GdkColor color = fromQColor(arrowColor); 905 QGtk::gtk_widget_modify_fg (gtkArrow, state, &color);910 d->gtk_widget_modify_fg (gtkArrow, state, &color); 906 911 gtkPainter.paintArrow(gtkArrow, "button", arrowRect, 907 912 type, state, shadow, FALSE, gtkArrow->style, 908 913 QString::number(arrowColor.rgba(), 16)); 909 914 // Passing NULL will revert the color change 910 QGtk::gtk_widget_modify_fg (gtkArrow, state, NULL);915 d->gtk_widget_modify_fg (gtkArrow, state, NULL); 911 916 } 912 917 break; … … 917 922 918 923 case PE_PanelMenu: { 919 GtkWidget *gtkMenu = QGtk::gtkWidget(QLS("GtkMenu"));924 GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu")); 920 925 gtkPainter.setAlphaSupport(false); // Note, alpha disabled for performance reasons 921 926 gtkPainter.paintBox(gtkMenu, "menu", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, gtkMenu->style, QString()); … … 929 934 // This is only used by floating tool bars 930 935 if (qobject_cast<const QToolBar *>(widget)) { 931 GtkWidget *gtkMenubar = QGtk::gtkWidget(QLS("GtkMenuBar"));936 GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar")); 932 937 gtkPainter.paintBox( gtkMenubar, "toolbar", option->rect, 933 938 GTK_STATE_NORMAL, GTK_SHADOW_OUT, style); … … 938 943 939 944 case PE_FrameLineEdit: { 940 GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry")); 941 942 if (option->state & State_HasFocus) 943 GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 944 else 945 GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 945 GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry")); 946 946 947 947 948 gboolean interior_focus; 948 949 gint focus_line_width; 949 950 QRect rect = option->rect; 950 QGtk::gtk_widget_style_get(gtkEntry,951 d->gtk_widget_style_get(gtkEntry, 951 952 "interior-focus", &interior_focus, 952 953 "focus-line-width", &focus_line_width, NULL); 953 954 955 // See https://bugzilla.mozilla.org/show_bug.cgi?id=405421 for info about this hack 956 g_object_set_data(G_OBJECT(gtkEntry), "transparent-bg-hint", GINT_TO_POINTER(TRUE)); 957 954 958 if (!interior_focus && option->state & State_HasFocus) 955 959 rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); 956 960 961 if (option->state & State_HasFocus) 962 GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 957 963 gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ? 958 964 GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, 959 965 GTK_SHADOW_IN, gtkEntry->style, 960 966 option->state & State_HasFocus ? QLS("focus") : QString()); 961 962 967 if (!interior_focus && option->state & State_HasFocus) 963 968 gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? 964 969 GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, 965 970 GTK_SHADOW_IN, gtkEntry->style, QLS("GtkEntryShadowIn")); 971 972 if (option->state & State_HasFocus) 973 GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 966 974 } 967 975 break; … … 969 977 case PE_PanelLineEdit: 970 978 if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) { 971 GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry"));979 GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry")); 972 980 if (panel->lineWidth > 0) 973 drawPrimitive(PE_FrameLineEdit, option, painter, widget);981 proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget); 974 982 uint resolve_mask = option->palette.resolve(); 975 983 QRect textRect = option->rect.adjusted(gtkEntry->style->xthickness, gtkEntry->style->ythickness, … … 978 986 if (widget && widget->testAttribute(Qt::WA_SetPalette) && 979 987 resolve_mask & (1 << QPalette::Base)) // Palette overridden by user 980 painter->fillRect(textRect, option->palette.base() .color());988 painter->fillRect(textRect, option->palette.base()); 981 989 else 982 990 gtkPainter.paintFlatBox( gtkEntry, "entry_bg", textRect, … … 987 995 case PE_FrameTabWidget: 988 996 if (const QStyleOptionTabWidgetFrame *frame = qstyleoption_cast<const QStyleOptionTabWidgetFrame*>(option)) { 989 GtkWidget *gtkNotebook = QGtk::gtkWidget(QLS("GtkNotebook"));997 GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook")); 990 998 style = gtkPainter.getStyle(gtkNotebook); 991 999 gtkPainter.setAlphaSupport(false); 992 1000 GtkShadowType shadow = GTK_SHADOW_OUT; 993 1001 GtkStateType state = GTK_STATE_NORMAL; // Only state supported by gtknotebook 994 if (const QTabWidget *tabwidget = qobject_cast<const QTabWidget*>(widget)) { 995 // We should introduce QStyleOptionTabWidgetFrameV2 to obtain this information 996 // No gap if we do not show the actual tabs 997 QTabBar *tabBar = tabwidget->findChild<QTabBar*>(); 998 if (tabwidget->count() > 0 && tabBar->isVisible()) { 999 QRect tabRect = tabBar->tabRect(tabBar->currentIndex()); 1000 int begin = 0, size = 0; 1001 GtkPositionType frameType = GTK_POS_TOP; 1002 QTabBar::Shape shape = frame->shape; 1003 if (shape == QTabBar::RoundedNorth || shape == QTabBar::RoundedSouth) { 1004 begin = option->direction == Qt::LeftToRight ? 1005 frame->leftCornerWidgetSize.width() + tabRect.left() : 1006 frame->rect.width() - frame->tabBarSize.width() + tabRect.left() 1007 - frame->rightCornerWidgetSize.width(); 1008 size = tabRect.width(); 1009 frameType = (shape == QTabBar::RoundedNorth) ? GTK_POS_TOP : GTK_POS_BOTTOM; 1010 } else { 1011 begin = frame->leftCornerWidgetSize.height() + tabRect.top(); 1012 size = tabRect.height(); 1013 frameType = (shape == QTabBar::RoundedWest) ? GTK_POS_LEFT : GTK_POS_RIGHT; 1014 } 1015 gtkPainter.paintBoxGap(gtkNotebook, "notebook", option->rect, state, shadow, frameType, 1016 begin, size, style); 1017 break; // done 1002 bool reverse = (option->direction == Qt::RightToLeft); 1003 QGtkStylePrivate::gtk_widget_set_direction(gtkNotebook, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 1004 if (const QStyleOptionTabWidgetFrameV2 *tabframe = qstyleoption_cast<const QStyleOptionTabWidgetFrameV2*>(option)) { 1005 GtkPositionType frameType = GTK_POS_TOP; 1006 QTabBar::Shape shape = frame->shape; 1007 int gapStart = 0; 1008 int gapSize = 0; 1009 if (shape == QTabBar::RoundedNorth || shape == QTabBar::RoundedSouth) { 1010 frameType = (shape == QTabBar::RoundedNorth) ? GTK_POS_TOP : GTK_POS_BOTTOM; 1011 gapStart = tabframe->selectedTabRect.left(); 1012 gapSize = tabframe->selectedTabRect.width(); 1013 } else { 1014 frameType = (shape == QTabBar::RoundedWest) ? GTK_POS_LEFT : GTK_POS_RIGHT; 1015 gapStart = tabframe->selectedTabRect.y(); 1016 gapSize = tabframe->selectedTabRect.height(); 1018 1017 } 1019 } 1018 gtkPainter.paintBoxGap(gtkNotebook, "notebook", option->rect, state, shadow, frameType, 1019 gapStart, gapSize, style); 1020 break; // done 1021 } 1022 1020 1023 // Note this is only the fallback option 1021 1024 gtkPainter.paintBox(gtkNotebook, "notebook", option->rect, state, shadow, style); … … 1023 1026 break; 1024 1027 1025 case PE_PanelButtonCommand: { 1028 case PE_PanelButtonCommand: 1029 case PE_PanelButtonTool: { 1026 1030 bool isDefault = false; 1031 bool isTool = (element == PE_PanelButtonTool); 1027 1032 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton*>(option)) 1028 1033 isDefault = btn->features & QStyleOptionButton::DefaultButton; 1034 1035 // don't draw a frame for tool buttons that have the autoRaise flag and are not enabled or on 1036 if (isTool && !(option->state & State_Enabled || option->state & State_On) && (option->state & State_AutoRaise)) 1037 break; 1038 // don't draw a frame for dock widget buttons, unless we are hovering 1039 if (widget && widget->inherits("QDockWidgetTitleButton") && !(option->state & State_MouseOver)) 1040 break; 1029 1041 1030 1042 GtkStateType state = gtkPainter.gtkState(option); 1031 1043 if (option->state & State_On || option->state & State_Sunken) 1032 1044 state = GTK_STATE_ACTIVE; 1033 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));1045 GtkWidget *gtkButton = d->gtkWidget(isTool ? QLS("GtkToolButton.GtkButton") : QLS("GtkButton")); 1034 1046 gint focusWidth, focusPad; 1035 1047 gboolean interiorFocus = false; 1036 QGtk::gtk_widget_style_get (gtkButton,1048 d->gtk_widget_style_get (gtkButton, 1037 1049 "focus-line-width", &focusWidth, 1038 1050 "focus-padding", &focusPad, … … 1049 1061 gtkPainter.paintBox(gtkButton, "buttondefault", buttonRect, state, GTK_SHADOW_IN, 1050 1062 style, isDefault ? QLS("d") : QString()); 1051 } else 1052 GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT); 1063 } 1053 1064 1054 1065 bool hasFocus = option->state & State_HasFocus; … … 1057 1068 key += QLS("def"); 1058 1069 GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_FOCUS); 1059 1060 } else {1061 GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS);1062 1070 } 1063 1071 … … 1070 1078 gtkPainter.paintBox(gtkButton, "button", buttonRect, state, shadow, 1071 1079 style, key); 1080 if (isDefault) 1081 GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT); 1082 if (hasFocus) 1083 GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS); 1072 1084 } 1073 1085 break; … … 1087 1099 shadow = GTK_SHADOW_OUT; 1088 1100 1089 GtkWidget *gtkRadioButton = QGtk::gtkWidget(QLS("GtkRadioButton"));1101 GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton")); 1090 1102 gint spacing; 1091 QGtk::gtk_widget_style_get(gtkRadioButton, "indicator-spacing", &spacing, NULL);1103 d->gtk_widget_style_get(gtkRadioButton, "indicator-spacing", &spacing, NULL); 1092 1104 QRect buttonRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); 1093 1105 gtkPainter.setClipRect(option->rect); 1094 1106 // ### Note: Ubuntulooks breaks when the proper widget is passed 1095 1107 // Murrine engine requires a widget not to get RGBA check - warnings 1096 GtkWidget *gtkCheckButton = QGtk::gtkWidget(QLS("GtkCheckButton"));1108 GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); 1097 1109 gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton")); 1098 1110 … … 1116 1128 int spacing; 1117 1129 1118 GtkWidget *gtkCheckButton = QGtk::gtkWidget(QLS("GtkCheckButton"));1130 GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); 1119 1131 1120 1132 // Some styles such as aero-clone assume they can paint in the spacing area 1121 1133 gtkPainter.setClipRect(option->rect); 1122 1134 1123 QGtk::gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, NULL);1135 d->gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, NULL); 1124 1136 1125 1137 QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); … … 1188 1200 QPainter *painter, const QWidget *widget) const 1189 1201 { 1190 if (!QGtk::isThemeAvailable()) { 1202 Q_D(const QGtkStyle); 1203 1204 if (!d->isThemeAvailable()) { 1191 1205 QCleanlooksStyle::drawComplexControl(control, option, painter, widget); 1192 1206 return; 1193 1207 } 1194 1208 1195 GtkStyle* style = QGtk::gtkStyle();1209 GtkStyle* style = d->gtkStyle(); 1196 1210 QGtkPainter gtkPainter(painter); 1197 1211 QColor button = option->palette.button().color(); … … 1242 1256 1243 1257 if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) { 1244 QRect textRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget);1245 QRect checkBoxRect = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget);1258 QRect textRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); 1259 QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget); 1246 1260 // Draw title 1247 1261 1248 1262 if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { 1249 1263 // Draw prelight background 1250 GtkWidget *gtkCheckButton = QGtk::gtkWidget(QLS("GtkCheckButton"));1264 GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); 1251 1265 1252 1266 if (option->state & State_MouseOver) { … … 1258 1272 if (!groupBox->text.isEmpty()) { 1259 1273 int alignment = int(groupBox->textAlignment); 1260 if (! styleHint(QStyle::SH_UnderlineShortcut, option, widget))1274 if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, option, widget)) 1261 1275 alignment |= Qt::TextHideMnemonic; 1262 1276 QColor textColor = groupBox->textColor; // Note: custom textColor is currently ignored … … 1283 1297 box.QStyleOption::operator=(*groupBox); 1284 1298 box.rect = checkBoxRect; 1285 drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget);1299 proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); 1286 1300 } 1287 1301 } … … 1306 1320 QColor buttonShadow = option->palette.dark().color(); 1307 1321 GtkStateType state = gtkPainter.gtkState(option); 1308 int appears_as_list = ! styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget);1322 int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget); 1309 1323 QPixmap cache; 1310 1324 QString pixmapName; … … 1314 1328 bool reverse = (option->direction == Qt::RightToLeft); 1315 1329 QRect rect = option->rect; 1316 QRect arrowButtonRect = subControlRect(CC_ComboBox, &comboBoxCopy,1330 QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, 1317 1331 SC_ComboBoxArrow, widget); 1318 QRect editRect = subControlRect(CC_ComboBox, &comboBoxCopy,1332 QRect editRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, 1319 1333 SC_ComboBoxEditField, widget); 1320 1334 … … 1324 1338 1325 1339 // We use the gtk widget to position arrows and separators for us 1326 GtkWidget *gtkCombo = QGtk::gtkWidget(comboBoxPath);1340 GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath); 1327 1341 GtkAllocation geometry = {0, 0, option->rect.width(), option->rect.height()}; 1328 QGtk::gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);1329 QGtk::gtk_widget_size_allocate(gtkCombo, &geometry);1342 d->gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 1343 d->gtk_widget_size_allocate(gtkCombo, &geometry); 1330 1344 1331 1345 QString buttonPath = comboBoxPath + QLS(".GtkToggleButton"); 1332 GtkWidget *gtkToggleButton = QGtk::gtkWidget(buttonPath);1333 QGtk::gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);1346 GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath); 1347 d->gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 1334 1348 if (gtkToggleButton && (appears_as_list || comboBox->editable)) { 1349 if (focus) 1350 GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); 1335 1351 // Draw the combo box as a line edit with a button next to it 1336 1352 if (comboBox->editable || appears_as_list) { 1337 1353 GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state; 1338 1354 QString entryPath = QLS(comboBox->editable ? "GtkComboBoxEntry.GtkEntry" : "GtkComboBox.GtkFrame"); 1339 GtkWidget *gtkEntry = QGtk::gtkWidget(entryPath);1340 QGtk::gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);1355 GtkWidget *gtkEntry = d->gtkWidget(entryPath); 1356 d->gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 1341 1357 QRect frameRect = option->rect; 1342 1358 … … 1345 1361 else 1346 1362 frameRect.setRight(arrowButtonRect.left()); 1347 1348 // Required for inner blue highlight with clearlooks1349 if (focus) {1350 GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS);1351 GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);1352 1353 } else {1354 GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS);1355 GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);1356 }1357 1363 1358 1364 // Fill the line edit background … … 1362 1368 int yt = gtkEntry->style->ythickness; 1363 1369 QRect contentRect = frameRect.adjusted(xt, yt, -xt, -yt); 1370 // Required for inner blue highlight with clearlooks 1371 if (focus) 1372 GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 1373 1364 1374 if (widget && widget->testAttribute(Qt::WA_SetPalette) && 1365 1375 resolve_mask & (1 << QPalette::Base)) // Palette overridden by user … … 1368 1378 gtkCachedPainter.paintFlatBox(gtkEntry, "entry_bg", contentRect, 1369 1379 option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, 1370 GTK_SHADOW_NONE, style, entryPath + QString::number(focus));1380 GTK_SHADOW_NONE, gtkCombo->style, entryPath + QString::number(focus)); 1371 1381 } 1372 1382 … … 1375 1385 QString::number(focus) + QString::number(comboBox->editable) + 1376 1386 QString::number(option->direction)); 1387 if (focus) 1388 GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); 1377 1389 } 1378 1390 … … 1393 1405 shadow, gtkToggleButton->style, buttonPath + 1394 1406 QString::number(focus) + QString::number(option->direction)); 1395 1407 if (focus) 1408 GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); 1396 1409 } else { 1397 1410 // Draw combo box as a button 1398 1411 QRect buttonRect = option->rect; 1399 1412 1400 if (focus) {// Clearlooks actually check the widget for the default state1413 if (focus) // Clearlooks actually check the widget for the default state 1401 1414 GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); 1402 1403 } else {1404 GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS);1405 }1406 1407 1415 gtkCachedPainter.paintBox(gtkToggleButton, "button", 1408 1416 buttonRect, state, 1409 1417 shadow, gtkToggleButton->style, 1410 1418 buttonPath + QString::number(focus)); 1419 if (focus) 1420 GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); 1421 1411 1422 // Draw the separator between label and arrows 1412 1423 QString vSeparatorPath = buttonPath + QLS(".GtkHBox.GtkVSeparator"); 1413 1424 1414 if (GtkWidget *gtkVSeparator = QGtk::gtkWidget(vSeparatorPath)) {1425 if (GtkWidget *gtkVSeparator = d->gtkWidget(vSeparatorPath)) { 1415 1426 QRect vLineRect(gtkVSeparator->allocation.x, 1416 1427 gtkVSeparator->allocation.y, … … 1424 1435 1425 1436 gint interiorFocus = true; 1426 QGtk::gtk_widget_style_get(gtkToggleButton, "interior-focus", &interiorFocus, NULL);1437 d->gtk_widget_style_get(gtkToggleButton, "interior-focus", &interiorFocus, NULL); 1427 1438 int xt = interiorFocus ? gtkToggleButton->style->xthickness : 0; 1428 1439 int yt = interiorFocus ? gtkToggleButton->style->ythickness : 0; 1429 if ( (focus && (option->state & State_KeyboardFocusChange)))1440 if (focus && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) 1430 1441 gtkCachedPainter.paintFocus(gtkToggleButton, "button", 1431 1442 option->rect.adjusted(xt, yt, -xt, -yt), … … 1448 1459 : ".GtkToggleButton.GtkHBox.GtkArrow"); 1449 1460 1450 GtkWidget *gtkArrow = QGtk::gtkWidget(arrowPath);1461 GtkWidget *gtkArrow = d->gtkWidget(arrowPath); 1451 1462 gfloat scale = 0.7; 1452 1463 gint minSize = 15; 1453 1464 QRect arrowWidgetRect; 1454 1465 1455 if (gtkArrow && ! QGtk::gtk_check_version(2, 12, 0)) {1456 QGtk::gtk_widget_style_get(gtkArrow, "arrow-scaling", &scale, NULL);1457 QGtk::gtk_widget_style_get(gtkCombo, "arrow-size", &minSize, NULL);1466 if (gtkArrow && !d->gtk_check_version(2, 12, 0)) { 1467 d->gtk_widget_style_get(gtkArrow, "arrow-scaling", &scale, NULL); 1468 d->gtk_widget_style_get(gtkCombo, "arrow-size", &minSize, NULL); 1458 1469 } 1459 1470 if (gtkArrow) { … … 1473 1484 if (sunken) { 1474 1485 int xoff, yoff; 1475 GtkWidget *gtkButton = QGtk::gtkWidget(comboBoxPath + QLS(".GtkToggleButton"));1476 QGtk::gtk_widget_style_get(gtkButton, "child-displacement-x", &xoff, NULL);1477 QGtk::gtk_widget_style_get(gtkButton, "child-displacement-y", &yoff, NULL);1486 GtkWidget *gtkButton = d->gtkWidget(comboBoxPath + QLS(".GtkToggleButton")); 1487 d->gtk_widget_style_get(gtkButton, "child-displacement-x", &xoff, NULL); 1488 d->gtk_widget_style_get(gtkButton, "child-displacement-y", &yoff, NULL); 1478 1489 arrowRect = arrowRect.adjusted(xoff, yoff, xoff, yoff); 1479 1490 } … … 1498 1509 = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { 1499 1510 QRect button, menuarea; 1500 button = subControlRect(control, toolbutton, SC_ToolButton, widget);1501 menuarea = subControlRect(control, toolbutton, SC_ToolButtonMenu, widget);1511 button = proxy()->subControlRect(control, toolbutton, SC_ToolButton, widget); 1512 menuarea = proxy()->subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); 1502 1513 State bflags = toolbutton->state & ~(State_Sunken | State_MouseOver); 1503 1514 … … 1528 1539 tool.rect = button; 1529 1540 tool.state = bflags; 1530 drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);1541 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); 1531 1542 } 1532 1543 } … … 1539 1550 QStyleOptionFocusRect fr; 1540 1551 fr.QStyleOption::operator=(*toolbutton); 1541 fr.rect = subControlRect(CC_ToolButton, toolbutton, SC_ToolButton, widget);1552 fr.rect = proxy()->subControlRect(CC_ToolButton, toolbutton, SC_ToolButton, widget); 1542 1553 fr.rect.adjust(1, 1, -1, -1); 1543 drawPrimitive(PE_FrameFocusRect, &fr, painter, widget);1554 proxy()->drawPrimitive(PE_FrameFocusRect, &fr, painter, widget); 1544 1555 } 1545 1556 1546 1557 QStyleOptionToolButton label = *toolbutton; 1547 1558 label.state = bflags; 1548 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));1559 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton")); 1549 1560 QPalette pal = toolbutton->palette; 1550 1561 if (option->state & State_Enabled && … … 1557 1568 label.rect = button.adjusted(style->xthickness, style->ythickness, 1558 1569 -style->xthickness - popupArrowSize, -style->ythickness); 1559 drawControl(CE_ToolButtonLabel, &label, painter, widget);1570 proxy()->drawControl(CE_ToolButtonLabel, &label, painter, widget); 1560 1571 1561 1572 if (toolbutton->subControls & SC_ToolButtonMenu) { … … 1563 1574 tool.state = mflags; 1564 1575 if ((mflags & State_Enabled && (mflags & (State_Sunken | State_Raised | State_MouseOver))) || !(mflags & State_AutoRaise)) 1565 drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget);1566 1567 drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);1576 proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget); 1577 1578 proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget); 1568 1579 1569 1580 } else if (drawMenuArrow) { … … 1571 1582 QStyleOptionToolButton newBtn = *toolbutton; 1572 1583 newBtn.rect = QRect(ir.right() - popupArrowSize - style->xthickness - 3, ir.height()/2 - 1, popupArrowSize, popupArrowSize); 1573 drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget);1584 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); 1574 1585 } 1575 1586 } … … 1581 1592 case CC_ScrollBar: 1582 1593 if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 1583 GtkWidget *gtkHScrollBar = QGtk::gtkWidget(QLS("GtkHScrollbar"));1584 GtkWidget *gtkVScrollBar = QGtk::gtkWidget(QLS("GtkVScrollbar"));1594 GtkWidget *gtkHScrollBar = d->gtkWidget(QLS("GtkHScrollbar")); 1595 GtkWidget *gtkVScrollBar = d->gtkWidget(QLS("GtkVScrollbar")); 1585 1596 1586 1597 // Fill background in case the scrollbar is partially transparent … … 1588 1599 1589 1600 QRect rect = scrollBar->rect; 1590 QRect scrollBarSubLine = subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget);1591 QRect scrollBarAddLine = subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget);1592 QRect scrollBarSlider = subControlRect(control, scrollBar, SC_ScrollBarSlider, widget);1593 QRect grooveRect = subControlRect(control, scrollBar, SC_ScrollBarGroove, widget);1601 QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); 1602 QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); 1603 QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); 1604 QRect grooveRect = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); 1594 1605 bool horizontal = scrollBar->orientation == Qt::Horizontal; 1595 1606 GtkWidget * scrollbarWidget = horizontal ? gtkHScrollBar : gtkVScrollBar; … … 1599 1610 gboolean stepper_size = 14; 1600 1611 gint trough_border = 1; 1601 if (! QGtk::gtk_check_version(2, 10, 0)) {1602 QGtk::gtk_widget_style_get((GtkWidget*)(scrollbarWidget),1612 if (!d->gtk_check_version(2, 10, 0)) { 1613 d->gtk_widget_style_get((GtkWidget*)(scrollbarWidget), 1603 1614 "trough-border", &trough_border, 1604 1615 "trough-side-details", &trough_side_details, … … 1624 1635 else if (scrollBar->sliderPosition > scrollBar->minimum) 1625 1636 fakePos = maximum - 1; 1626 GtkObject *adjustment = QGtk::gtk_adjustment_new(fakePos, 0, maximum, 0, 0, 0);1637 GtkObject *adjustment = d->gtk_adjustment_new(fakePos, 0, maximum, 0, 0, 0); 1627 1638 1628 1639 if (horizontal) 1629 QGtk::gtk_range_set_adjustment((GtkRange*)(gtkHScrollBar), (GtkAdjustment*)(adjustment));1640 d->gtk_range_set_adjustment((GtkRange*)(gtkHScrollBar), (GtkAdjustment*)(adjustment)); 1630 1641 else 1631 QGtk::gtk_range_set_adjustment((GtkRange*)(gtkVScrollBar), (GtkAdjustment*)(adjustment));1642 d->gtk_range_set_adjustment((GtkRange*)(gtkVScrollBar), (GtkAdjustment*)(adjustment)); 1632 1643 1633 1644 if (scrollBar->subControls & SC_ScrollBarGroove) { … … 1726 1737 case CC_SpinBox: 1727 1738 if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { 1728 GtkWidget *gtkSpinButton = QGtk::gtkWidget(QLS("GtkSpinButton"));1739 GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton")); 1729 1740 bool isEnabled = (spinBox->state & State_Enabled); 1730 1741 bool hover = isEnabled && (spinBox->state & State_MouseOver); … … 1735 1746 1736 1747 //### Move this to subControlRect 1737 QRect upRect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);1748 QRect upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); 1738 1749 upRect.setTop(option->rect.top()); 1739 1750 … … 1743 1754 upRect.setRight(option->rect.right()); 1744 1755 1745 QRect editRect = subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget);1746 QRect downRect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);1756 QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget); 1757 QRect downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); 1747 1758 downRect.setBottom(option->rect.bottom()); 1748 1759 … … 1774 1785 style = gtkPainter.getStyle(gtkSpinButton); 1775 1786 1776 if (option->state & State_HasFocus) 1787 1788 QString key; 1789 1790 if (option->state & State_HasFocus) { 1791 key += QLatin1Char('f'); 1777 1792 GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); 1778 else 1779 GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); 1780 1781 QString key; 1782 1783 if (option->state & State_HasFocus) 1784 key = QLS("f"); 1793 } 1785 1794 1786 1795 uint resolve_mask = option->palette.resolve(); … … 1815 1824 else 1816 1825 gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); 1826 1827 if (option->state & State_HasFocus) 1828 GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); 1817 1829 } 1818 1830 … … 1840 1852 1841 1853 } else { 1842 int size = spinboxArrowSize();1854 int size = d->getSpinboxArrowSize(); 1843 1855 int w = size / 2 - 1; 1844 1856 w -= w % 2 - 1; // force odd … … 1872 1884 case CC_Slider: 1873 1885 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 1874 GtkWidget *hScaleWidget = QGtk::gtkWidget(QLS("GtkHScale"));1875 GtkWidget *vScaleWidget = QGtk::gtkWidget(QLS("GtkVScale"));1876 1877 QRect groove = subControlRect(CC_Slider, option, SC_SliderGroove, widget);1878 QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget);1879 QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);1886 GtkWidget *hScaleWidget = d->gtkWidget(QLS("GtkHScale")); 1887 GtkWidget *vScaleWidget = d->gtkWidget(QLS("GtkVScale")); 1888 1889 QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); 1890 QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); 1891 QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); 1880 1892 1881 1893 bool horizontal = slider->orientation == Qt::Horizontal; … … 1897 1909 1898 1910 if ((option->subControls & SC_SliderGroove) && groove.isValid()) { 1899 GtkObject *adjustment = QGtk::gtk_adjustment_new(slider->sliderPosition,1911 GtkObject *adjustment = d->gtk_adjustment_new(slider->sliderPosition, 1900 1912 slider->minimum, 1901 1913 slider->maximum, … … 1904 1916 slider->pageStep); 1905 1917 int outerSize; 1906 QGtk::gtk_range_set_adjustment ((GtkRange*)(scaleWidget), (GtkAdjustment*)(adjustment));1907 QGtk::gtk_range_set_inverted((GtkRange*)(scaleWidget), !horizontal);1908 QGtk::gtk_widget_style_get(scaleWidget, "trough-border", &outerSize, NULL);1918 d->gtk_range_set_adjustment ((GtkRange*)(scaleWidget), (GtkAdjustment*)(adjustment)); 1919 d->gtk_range_set_inverted((GtkRange*)(scaleWidget), !horizontal); 1920 d->gtk_widget_style_get(scaleWidget, "trough-border", &outerSize, NULL); 1909 1921 outerSize++; 1910 1922 … … 1914 1926 -focusFrameMargin, -outerSize - focusFrameMargin); 1915 1927 1916 gtkPainter.paintBox( scaleWidget, "trough", grooveRect, state,1917 GTK_SHADOW_IN, style, QString(QLS("p%0")).arg(slider->sliderPosition));1918 1919 1928 gboolean trough_side_details = false; // Indicates if the upper or lower scale background differs 1920 if (!QGtk::gtk_check_version(2, 10, 0)) 1921 QGtk::gtk_widget_style_get((GtkWidget*)(scaleWidget), "trough-side-details", &trough_side_details, NULL); 1922 1923 if (trough_side_details && horizontal) { //### Vertical sliders look broken with this for some reason 1929 if (!d->gtk_check_version(2, 10, 0)) 1930 d->gtk_widget_style_get((GtkWidget*)(scaleWidget), "trough-side-details", &trough_side_details, NULL); 1931 1932 if (!trough_side_details) { 1933 gtkPainter.paintBox( scaleWidget, "trough", grooveRect, state, 1934 GTK_SHADOW_IN, style, QString(QLS("p%0")).arg(slider->sliderPosition)); 1935 } else { 1936 QRect upperGroove = grooveRect; 1924 1937 QRect lowerGroove = grooveRect; 1925 lowerGroove.setRight(handle.center().x()); 1938 1939 if (horizontal) { 1940 upperGroove.setLeft(handle.center().x()); 1941 lowerGroove.setRight(handle.center().x()); 1942 } else { 1943 upperGroove.setBottom(handle.center().y()); 1944 lowerGroove.setTop(handle.center().y()); 1945 } 1946 1947 gtkPainter.paintBox( scaleWidget, "trough-upper", upperGroove, state, 1948 GTK_SHADOW_IN, style, QString(QLS("p%0")).arg(slider->sliderPosition)); 1926 1949 gtkPainter.paintBox( scaleWidget, "trough-lower", lowerGroove, state, 1927 1950 GTK_SHADOW_IN, style, QString(QLS("p%0")).arg(slider->sliderPosition)); 1928 1951 } 1929 1930 1952 } 1931 1953 1932 1954 if (option->subControls & SC_SliderTickmarks) { 1933 1955 painter->setPen(darkOutline); 1934 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);1935 int available = p ixelMetric(PM_SliderSpaceAvailable, slider, widget);1956 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 1957 int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); 1936 1958 int interval = slider->tickInterval; 1937 1959 … … 1950 1972 1951 1973 int v = slider->minimum; 1952 int len = p ixelMetric(PM_SliderLength, slider, widget);1974 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 1953 1975 while (v <= slider->maximum + 1) { 1954 1976 if (v == slider->maximum + 1 && interval == 1) … … 2011 2033 fropt.rect.setRight(handle.right() + 3); 2012 2034 } 2013 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);2035 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 2014 2036 } 2015 2037 gtkPainter.paintSlider( scaleWidget, horizontal ? "hscale" : "vscale", handle, state, shadow, style, … … 2040 2062 const QWidget *widget) const 2041 2063 { 2042 if (!QGtk::isThemeAvailable()) { 2064 Q_D(const QGtkStyle); 2065 2066 if (!d->isThemeAvailable()) { 2043 2067 QCleanlooksStyle::drawControl(element, option, painter, widget); 2044 2068 return; 2045 2069 } 2046 2070 2047 GtkStyle* style = QGtk::gtkStyle();2071 GtkStyle* style = d->gtkStyle(); 2048 2072 QGtkPainter gtkPainter(painter); 2049 2073 … … 2051 2075 case CE_ProgressBarLabel: 2052 2076 if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { 2053 GtkWidget *gtkProgressBar = QGtk::gtkWidget(QLS("GtkProgressBar"));2077 GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar")); 2054 2078 if (!gtkProgressBar) 2055 2079 return; … … 2070 2094 if (vertical) 2071 2095 rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height 2072 const int progressIndicatorPos = static_cast<int>((bar->progress - qint64(bar->minimum)) /2073 qMax(double(1.0), double(qint64(bar->maximum) - qint64(bar->minimum))) * rect.width());2096 const int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) * rect.width() / 2097 qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); 2074 2098 if (progressIndicatorPos >= 0 && progressIndicatorPos <= rect.width()) 2075 2099 leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); … … 2101 2125 if (option->state & State_Sunken) 2102 2126 buttonShift = QPoint(pixelMetric(PM_ButtonShiftHorizontal, option, widget), 2103 p ixelMetric(PM_ButtonShiftVertical, option, widget));2104 2105 if ( styleHint(SH_UnderlineShortcut, button, widget))2127 proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); 2128 2129 if (proxy()->styleHint(SH_UnderlineShortcut, button, widget)) 2106 2130 tf |= Qt::TextShowMnemonic; 2107 2131 else … … 2154 2178 ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0); 2155 2179 2156 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));2180 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 2157 2181 QPalette pal = button->palette; 2158 2182 int labelState = GTK_STATE_INSENSITIVE; … … 2164 2188 QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); 2165 2189 pal.setBrush(QPalette::ButtonText, textColor); 2166 drawItemText(painter, ir, tf, pal, (button->state & State_Enabled),2190 proxy()->drawItemText(painter, ir, tf, pal, (button->state & State_Enabled), 2167 2191 button->text, QPalette::ButtonText); 2168 2192 } … … 2175 2199 2176 2200 // Draw prelight background 2177 GtkWidget *gtkRadioButton = QGtk::gtkWidget(QLS("GtkRadioButton"));2201 GtkWidget *gtkRadioButton = d->gtkWidget(QLS("GtkRadioButton")); 2178 2202 2179 2203 if (option->state & State_MouseOver) { … … 2185 2209 subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator 2186 2210 : SE_CheckBoxIndicator, btn, widget); 2187 drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox,2211 proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, 2188 2212 &subopt, painter, widget); 2189 2213 subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents … … 2199 2223 pal.setBrush(QPalette::WindowText, textColor); 2200 2224 subopt.palette = pal; 2201 drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget);2225 proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); 2202 2226 2203 2227 if (btn->state & State_HasFocus) { … … 2206 2230 fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect 2207 2231 : SE_CheckBoxFocusRect, btn, widget); 2208 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);2232 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 2209 2233 } 2210 2234 } … … 2215 2239 case CE_ComboBoxLabel: 2216 2240 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { 2217 QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget);2218 bool appearsAsList = ! styleHint(QStyle::SH_ComboBox_Popup, cb, widget);2241 QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); 2242 bool appearsAsList = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, cb, widget); 2219 2243 painter->save(); 2220 2244 painter->setClipRect(editRect); … … 2234 2258 painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); 2235 2259 2236 drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap);2260 proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); 2237 2261 2238 2262 if (cb->direction == Qt::RightToLeft) … … 2243 2267 2244 2268 if (!cb->currentText.isEmpty() && !cb->editable) { 2245 GtkWidget *gtkCombo = QGtk::gtkWidget(QLS("GtkComboBox"));2269 GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox")); 2246 2270 QPalette pal = cb->palette; 2247 2271 int labelState = GTK_STATE_INSENSITIVE; … … 2256 2280 pal.setBrush(QPalette::ButtonText, textColor); 2257 2281 2258 drawItemText(painter, editRect.adjusted(1, 0, -1, 0),2282 proxy()->drawItemText(painter, editRect.adjusted(1, 0, -1, 0), 2259 2283 visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), 2260 2284 pal, cb->state & State_Enabled, cb->currentText, QPalette::ButtonText); … … 2302 2326 = painter->fontMetrics().elidedText(dwOpt->title, 2303 2327 Qt::ElideRight, titleRect.width()); 2304 drawItemText(painter,2328 proxy()->drawItemText(painter, 2305 2329 titleRect, 2306 2330 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, … … 2320 2344 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { 2321 2345 Q_UNUSED(header); 2322 GtkWidget *gtkTreeView = QGtk::gtkWidget(QLS("GtkTreeView"));2346 GtkWidget *gtkTreeView = d->gtkWidget(QLS("GtkTreeView")); 2323 2347 // Get the middle column 2324 GtkTreeViewColumn *column = QGtk::gtk_tree_view_get_column((GtkTreeView*)gtkTreeView, 1);2348 GtkTreeViewColumn *column = d->gtk_tree_view_get_column((GtkTreeView*)gtkTreeView, 1); 2325 2349 Q_ASSERT(column); 2326 2350 … … 2341 2365 2342 2366 case CE_SizeGrip: { 2343 GtkWidget *gtkStatusbar = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame"));2367 GtkWidget *gtkStatusbar = d->gtkWidget(QLS("GtkStatusbar.GtkFrame")); 2344 2368 QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness); 2345 gtkPainter.paintResizeGrip( gtkStatusbar, " window", gripRect, GTK_STATE_NORMAL,2369 gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL, 2346 2370 GTK_SHADOW_OUT, QApplication::isRightToLeft() ? 2347 2371 GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST, … … 2353 2377 2354 2378 case CE_MenuBarEmptyArea: { 2355 GtkWidget *gtkMenubar = QGtk::gtkWidget(QLS("GtkMenuBar"));2379 GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar")); 2356 2380 GdkColor gdkBg = gtkMenubar->style->bg[GTK_STATE_NORMAL]; // Theme can depend on transparency 2357 2381 painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8)); … … 2363 2387 QGtkPainter gtkMenuBarPainter(&pmPainter); 2364 2388 GtkShadowType shadow_type; 2365 QGtk::gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, NULL);2389 d->gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, NULL); 2366 2390 gtkMenuBarPainter.paintBox( gtkMenubar, "menubar", menuBarRect, 2367 2391 GTK_STATE_NORMAL, shadow_type, gtkMenubar->style); … … 2376 2400 2377 2401 if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { 2378 GtkWidget *gtkMenubarItem = QGtk::gtkWidget(QLS("GtkMenuBar.GtkMenuItem"));2379 GtkWidget *gtkMenubar = QGtk::gtkWidget(QLS("GtkMenuBar"));2402 GtkWidget *gtkMenubarItem = d->gtkWidget(QLS("GtkMenuBar.GtkMenuItem")); 2403 GtkWidget *gtkMenubar = d->gtkWidget(QLS("GtkMenuBar")); 2380 2404 2381 2405 style = gtkMenubarItem->style; … … 2392 2416 QGtkPainter menubarPainter(&pmPainter); 2393 2417 GtkShadowType shadow_type; 2394 QGtk::gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, NULL);2418 d->gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, NULL); 2395 2419 GdkColor gdkBg = gtkMenubar->style->bg[GTK_STATE_NORMAL]; // Theme can depend on transparency 2396 2420 painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8)); … … 2416 2440 if (act) { 2417 2441 GtkShadowType shadowType = GTK_SHADOW_NONE; 2418 QGtk::gtk_widget_style_get (gtkMenubarItem, "selected-shadow-type", &shadowType, NULL);2442 d->gtk_widget_style_get (gtkMenubarItem, "selected-shadow-type", &shadowType, NULL); 2419 2443 gtkPainter.paintBox(gtkMenubarItem, "menuitem", option->rect.adjusted(0, 0, 0, 3), 2420 2444 GTK_STATE_PRELIGHT, shadowType, gtkMenubarItem->style); … … 2423 2447 uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 2424 2448 2425 if (! QCleanlooksStyle::styleHint(SH_UnderlineShortcut, mbi, widget))2449 if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) 2426 2450 alignment |= Qt::TextHideMnemonic; 2427 2451 2428 drawItemText(painter, item.rect, alignment, item.palette, mbi->state & State_Enabled, mbi->text, textRole);2452 proxy()->drawItemText(painter, item.rect, alignment, item.palette, mbi->state & State_Enabled, mbi->text, textRole); 2429 2453 } 2430 2454 } … … 2433 2457 2434 2458 case CE_Splitter: { 2435 GtkWidget *gtkWindow = QGtk::gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed2459 GtkWidget *gtkWindow = d->gtkWidget(QLS("GtkWindow")); // The Murrine Engine currently assumes a widget is passed 2436 2460 gtkPainter.paintHandle(gtkWindow, "splitter", option->rect, gtkPainter.gtkState(option), GTK_SHADOW_NONE, 2437 2461 !(option->state & State_Horizontal) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, … … 2453 2477 rect.adjust(0, 0, 1, 0); 2454 2478 2455 GtkWidget *gtkToolbar = QGtk::gtkWidget(QLS("GtkToolbar"));2479 GtkWidget *gtkToolbar = d->gtkWidget(QLS("GtkToolbar")); 2456 2480 GtkShadowType shadow_type = GTK_SHADOW_NONE; 2457 QGtk::gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL);2481 d->gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, NULL); 2458 2482 gtkPainter.paintBox( gtkToolbar, "toolbar", rect, 2459 2483 GTK_STATE_NORMAL, shadow_type, gtkToolbar->style); … … 2472 2496 const int windowsItemVMargin = 26; // menu item ver text margin 2473 2497 const int windowsRightBorder = 15; // right border on windows 2474 GtkWidget *gtkMenu = QGtk::gtkWidget(QLS("GtkMenu"));2475 GtkWidget *gtkMenuItem = menuItem->checked ? QGtk::gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) :2476 QGtk::gtkWidget(QLS("GtkMenu.GtkMenuItem"));2498 GtkWidget *gtkMenu = d->gtkWidget(QLS("GtkMenu")); 2499 GtkWidget *gtkMenuItem = menuItem->checked ? d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")) : 2500 d->gtkWidget(QLS("GtkMenu.GtkMenuItem")); 2477 2501 2478 2502 style = gtkPainter.getStyle(gtkMenuItem); … … 2481 2505 2482 2506 if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { 2483 GtkWidget *gtkMenuSeparator = QGtk::gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));2507 GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem")); 2484 2508 painter->setPen(shadow.lighter(106)); 2485 2509 gboolean wide_separators = 0; 2486 2510 gint separator_height = 0; 2487 2511 guint horizontal_padding = 3; 2488 if (! QGtk::gtk_check_version(2, 10, 0)) {2489 QGtk::gtk_widget_style_get(gtkMenuSeparator,2512 if (!d->gtk_check_version(2, 10, 0)) { 2513 d->gtk_widget_style_get(gtkMenuSeparator, 2490 2514 "wide-separators", &wide_separators, 2491 2515 "separator-height", &separator_height, … … 2507 2531 2508 2532 if (selected) { 2509 QRect rect = option->rect.adjusted(0, 0, -1, -1);2533 QRect rect = option->rect.adjusted(0, 0, 0, -1); 2510 2534 #ifndef QT_NO_COMBOBOX 2511 2535 if (qobject_cast<const QComboBox*>(widget)) … … 2521 2545 2522 2546 gint checkSize; 2523 QGtk::gtk_widget_style_get(QGtk::gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);2547 d->gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL); 2524 2548 2525 2549 int checkcol = qMax(menuItem->maxIconWidth, qMax(20, checkSize)); … … 2598 2622 2599 2623 QPixmap pixmap; 2600 int smallIconSize = p ixelMetric(PM_SmallIconSize, option, widget);2624 int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); 2601 2625 QSize iconSize(smallIconSize, smallIconSize); 2602 2626 … … 2614 2638 int pixh = pixmap.height(); 2615 2639 QRect pmr(0, 0, pixw, pixh); 2616 pmr.moveCenter(vCheckRect.center() );2640 pmr.moveCenter(vCheckRect.center() - QPoint(0, 1)); 2617 2641 painter->setPen(menuItem->palette.text().color()); 2618 2642 if (!ignoreCheckMark && checkable && checked) { … … 2626 2650 opt.state |= State_Sunken; 2627 2651 opt.rect = vCheckRect; 2628 drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget);2652 proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); 2629 2653 } 2630 2654 painter->drawPixmap(pmr.topLeft(), pixmap); … … 2656 2680 int tab = menuitem->tabWidth; 2657 2681 int xm = windowsItemFrame + checkcol + windowsItemHMargin; 2658 int xpos = menuitem->rect.x() + xm ;2659 QRect textRect(xpos, y + windowsItemVMargin , w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);2682 int xpos = menuitem->rect.x() + xm + 1; 2683 QRect textRect(xpos, y + windowsItemVMargin - 1, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); 2660 2684 QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); 2661 2685 QString s = menuitem->text; … … 2666 2690 int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 2667 2691 2668 if (! styleHint(SH_UnderlineShortcut, menuitem, widget))2692 if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) 2669 2693 text_flags |= Qt::TextHideMnemonic; 2670 2694 … … 2699 2723 if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow 2700 2724 QPoint buttonShift(pixelMetric(PM_ButtonShiftHorizontal, option, widget), 2701 p ixelMetric(PM_ButtonShiftVertical, option, widget));2725 proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); 2702 2726 2703 2727 QFontMetrics fm(menuitem->font); 2704 2728 int arrow_size = fm.ascent() + fm.descent() - 2 * gtkMenuItem->style->ythickness; 2705 2729 gfloat arrow_scaling = 0.8; 2706 2707 // "arrow-scaling" is actually hardcoded and fails on hardy (see gtk+-2.12/gtkmenuitem.c) 2708 // though the current documentation states otherwise 2730 int extra = 0; 2731 if (!d->gtk_check_version(2, 16, 0)) { 2732 // "arrow-scaling" is actually hardcoded and fails on hardy (see gtk+-2.12/gtkmenuitem.c) 2733 // though the current documentation states otherwise 2734 d->gtk_widget_style_get(gtkMenuItem, "arrow-scaling", &arrow_scaling, NULL); 2735 // in versions < 2.16 ythickness was previously subtracted from the arrow_size 2736 extra = 2 * gtkMenuItem->style->ythickness; 2737 } 2738 2709 2739 int horizontal_padding; 2710 QGtk::gtk_widget_style_get(gtkMenuItem, "horizontal-padding", &horizontal_padding, NULL);2711 2712 const int dim = static_cast<int>(arrow_size * arrow_scaling) ;2740 d->gtk_widget_style_get(gtkMenuItem, "horizontal-padding", &horizontal_padding, NULL); 2741 2742 const int dim = static_cast<int>(arrow_size * arrow_scaling) + extra; 2713 2743 int xpos = menuItem->rect.left() + menuItem->rect.width() - horizontal_padding - dim; 2714 2744 QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, … … 2726 2756 case CE_PushButton: 2727 2757 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { 2728 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));2729 drawControl(CE_PushButtonBevel, btn, painter, widget);2758 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 2759 proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget); 2730 2760 QStyleOptionButton subopt = *btn; 2731 2761 subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); 2732 2762 gint interiorFocus = true; 2733 QGtk::gtk_widget_style_get(gtkButton, "interior-focus", &interiorFocus, NULL);2763 d->gtk_widget_style_get(gtkButton, "interior-focus", &interiorFocus, NULL); 2734 2764 int xt = interiorFocus ? gtkButton->style->xthickness : 0; 2735 2765 int yt = interiorFocus ? gtkButton->style->ythickness : 0; … … 2737 2767 if (btn->features & QStyleOptionButton::Flat && btn->state & State_HasFocus) 2738 2768 // The normal button focus rect does not work well for flat buttons in Clearlooks 2739 drawPrimitive(PE_FrameFocusRect, option, painter, widget);2769 proxy()->drawPrimitive(PE_FrameFocusRect, option, painter, widget); 2740 2770 else if (btn->state & State_HasFocus) 2741 2771 gtkPainter.paintFocus(gtkButton, "button", … … 2744 2774 gtkButton->style); 2745 2775 2746 drawControl(CE_PushButtonLabel, &subopt, painter, widget);2776 proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget); 2747 2777 } 2748 2778 break; … … 2752 2782 case CE_TabBarTabShape: 2753 2783 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { 2754 GtkWidget *gtkNotebook = QGtk::gtkWidget(QLS("GtkNotebook"));2784 GtkWidget *gtkNotebook = d->gtkWidget(QLS("GtkNotebook")); 2755 2785 style = gtkPainter.getStyle(gtkNotebook); 2756 2786 … … 2761 2791 state = GTK_STATE_NORMAL; 2762 2792 2763 bool first = tab->position == QStyleOptionTab::Beginning || tab->position == QStyleOptionTab::OnlyOneTab;2764 bool last = tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab;2765 2793 bool selected = (tab->state & State_Selected); 2766 if (option->direction == Qt::RightToLeft) { 2794 bool first = false, last = false; 2795 if (widget) { 2796 // This is most accurate and avoids resizing tabs while moving 2797 first = tab->rect.left() == widget->rect().left(); 2798 last = tab->rect.right() == widget->rect().right(); 2799 } else if (option->direction == Qt::RightToLeft) { 2767 2800 bool tmp = first; 2768 2801 first = last; … … 2816 2849 if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { 2817 2850 Q_UNUSED(bar); 2818 GtkWidget *gtkProgressBar = QGtk::gtkWidget(QLS("GtkProgressBar"));2851 GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar")); 2819 2852 GtkStateType state = gtkPainter.gtkState(option); 2820 2853 gtkPainter.paintBox( gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, gtkProgressBar->style); … … 2826 2859 if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { 2827 2860 GtkStateType state = option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE; 2828 GtkWidget *gtkProgressBar = QGtk::gtkWidget(QLS("GtkProgressBar"));2861 GtkWidget *gtkProgressBar = d->gtkWidget(QLS("GtkProgressBar")); 2829 2862 style = gtkProgressBar->style; 2830 2863 gtkPainter.paintBox( gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, style); … … 2848 2881 rect.translate(xt, -yt * 2); 2849 2882 rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // Flip width and height 2850 QTransform m; 2851 m.translate(rect.height(), 0); 2883 QTransform m = QTransform::fromTranslate(rect.height(), 0); 2852 2884 m.rotate(90.0); 2853 2885 painter->setTransform(m); … … 2875 2907 fakePos = maximum - 1; 2876 2908 2877 GtkObject *adjustment = QGtk::gtk_adjustment_new(fakePos, 0, maximum, 0, 0, 0);2878 QGtk::gtk_progress_set_adjustment((GtkProgress*)(gtkProgressBar), (GtkAdjustment*)(adjustment));2909 GtkObject *adjustment = d->gtk_adjustment_new(fakePos, 0, maximum, 0, 0, 0); 2910 d->gtk_progress_set_adjustment((GtkProgress*)(gtkProgressBar), (GtkAdjustment*)(adjustment)); 2879 2911 2880 2912 QRect progressBar; … … 2916 2948 SubControl subControl, const QWidget *widget) const 2917 2949 { 2950 Q_D(const QGtkStyle); 2951 2918 2952 QRect rect = QWindowsStyle::subControlRect(control, option, subControl, widget); 2919 if (! QGtk::isThemeAvailable())2953 if (!d->isThemeAvailable()) 2920 2954 return QCleanlooksStyle::subControlRect(control, option, subControl, widget); 2921 2955 … … 2959 2993 QFontMetrics fontMetrics(font); 2960 2994 QSize textRect = fontMetrics.boundingRect(groupBoxWidget->title()).size() + QSize(4, 4); 2961 int indicatorWidth = p ixelMetric(PM_IndicatorWidth, option, widget);2962 int indicatorHeight = p ixelMetric(PM_IndicatorHeight, option, widget);2995 int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); 2996 int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); 2963 2997 2964 2998 if (subControl == SC_GroupBoxCheckBox) { … … 2983 3017 case CC_SpinBox: 2984 3018 if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { 2985 GtkWidget *gtkSpinButton = QGtk::gtkWidget(QLS("GtkSpinButton"));3019 GtkWidget *gtkSpinButton = d->gtkWidget(QLS("GtkSpinButton")); 2986 3020 int center = spinbox->rect.height() / 2; 2987 3021 int xt = spinbox->frame ? gtkSpinButton->style->xthickness : 0; … … 2991 3025 QSize bs; 2992 3026 bs.setHeight(qMax(8, spinbox->rect.height()/2 - y)); 2993 bs.setWidth( spinboxArrowSize());3027 bs.setWidth(d->getSpinboxArrowSize()); 2994 3028 int x, lx, rx; 2995 3029 x = spinbox->rect.width() - y - bs.width() + 2; … … 3037 3071 // We employ the gtk widget to position arrows and separators for us 3038 3072 QString comboBoxPath = box->editable ? QLS("GtkComboBoxEntry") : QLS("GtkComboBox"); 3039 GtkWidget *gtkCombo = QGtk::gtkWidget(comboBoxPath);3040 QGtk::gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);3073 GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath); 3074 d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 3041 3075 GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())}; 3042 QGtk::gtk_widget_size_allocate(gtkCombo, &geometry);3043 int appears_as_list = ! styleHint(QStyle::SH_ComboBox_Popup, option, widget);3076 d->gtk_widget_size_allocate(gtkCombo, &geometry); 3077 int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget); 3044 3078 QString arrowPath = comboBoxPath + QLS(".GtkToggleButton"); 3045 3079 … … 3047 3081 arrowPath += QLS(".GtkHBox.GtkArrow"); 3048 3082 3049 GtkWidget *arrowWidget = QGtk::gtkWidget(arrowPath);3083 GtkWidget *arrowWidget = d->gtkWidget(arrowPath); 3050 3084 if (!arrowWidget) 3051 3085 return QCleanlooksStyle::subControlRect(control, option, subControl, widget); 3052 3086 3053 QRect buttonRect(arrowWidget->allocation.x, arrowWidget->allocation.y, 3087 QRect buttonRect(option->rect.left() + arrowWidget->allocation.x, 3088 option->rect.top() + arrowWidget->allocation.y, 3054 3089 arrowWidget->allocation.width, arrowWidget->allocation.height); 3055 3090 … … 3058 3093 case SC_ComboBoxArrow: // Note: this indicates the arrowbutton for editable combos 3059 3094 rect = buttonRect; 3060 3061 3095 break; 3062 3096 … … 3092 3126 */ 3093 3127 QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, 3094 3095 3128 const QSize &size, const QWidget *widget) const 3096 3129 { 3130 Q_D(const QGtkStyle); 3097 3131 3098 3132 QSize newSize = QCleanlooksStyle::sizeFromContents(type, option, size, widget); 3099 if (! QGtk::isThemeAvailable())3133 if (!d->isThemeAvailable()) 3100 3134 return newSize; 3101 3135 … … 3104 3138 case CT_ToolButton: 3105 3139 if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { 3106 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));3107 newSize = size + QSize(2 * gtkButton->style->xthickness, 1+ 2 * gtkButton->style->ythickness);3140 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkToolButton.GtkButton")); 3141 newSize = size + QSize(2 * gtkButton->style->xthickness, 2 + 2 * gtkButton->style->ythickness); 3108 3142 if (widget && qobject_cast<QToolBar *>(widget->parentWidget())) { 3109 3143 QSize minSize(0, 25); … … 3112 3146 newSize = newSize.expandedTo(minSize); 3113 3147 } 3114 3148 3115 3149 if (toolbutton->features & QStyleOptionToolButton::HasMenu) 3116 3150 newSize += QSize(6, 0); … … 3123 3157 3124 3158 if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) { 3125 GtkWidget *gtkMenuSeparator = QGtk::gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem"));3159 GtkWidget *gtkMenuSeparator = d->gtkWidget(QLS("GtkMenu.GtkSeparatorMenuItem")); 3126 3160 gboolean wide_separators; 3127 3161 gint separator_height; 3128 QGtk::gtk_widget_style_get(gtkMenuSeparator,3162 d->gtk_widget_style_get(gtkMenuSeparator, 3129 3163 "wide-separators", &wide_separators, 3130 3164 "separator-height", &separator_height, … … 3135 3169 } 3136 3170 3137 GtkWidget *gtkMenuItem = QGtk::gtkWidget(QLS("GtkMenu.GtkMenuItem"));3171 GtkWidget *gtkMenuItem = d->gtkWidget(QLS("GtkMenu.GtkMenuItem")); 3138 3172 GtkStyle* style = gtkMenuItem->style; 3139 newSize += QSize(textMargin + style->xthickness - 2, style->ythickness - 4);3173 newSize += QSize(textMargin + style->xthickness - 1, style->ythickness - 3); 3140 3174 3141 3175 // Cleanlooks assumes a check column of 20 pixels so we need to 3142 3176 // expand it a bit 3143 3177 gint checkSize; 3144 QGtk::gtk_widget_style_get(QGtk::gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL);3178 d->gtk_widget_style_get(d->gtkWidget(QLS("GtkMenu.GtkCheckMenuItem")), "indicator-size", &checkSize, NULL); 3145 3179 newSize.setHeight(qMax(newSize.height(), checkSize + 2)); 3146 3180 newSize.setWidth(newSize.width() + qMax(0, checkSize - 20)); … … 3157 3191 case CT_SpinBox: 3158 3192 // QSpinBox does some nasty things that depends on CT_LineEdit 3159 newSize = size + QSize(0, - QGtk::gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2 +2);3193 newSize = size + QSize(0, -d->gtkWidget(QLS("GtkSpinButton"))->style->ythickness * 2); 3160 3194 break; 3161 3195 3162 3196 case CT_PushButton: 3163 3197 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { 3164 GtkWidget *gtkButton = QGtk::gtkWidget(QLS("GtkButton"));3198 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 3165 3199 gint focusPadding, focusWidth; 3166 QGtk::gtk_widget_style_get(gtkButton, "focus-padding", &focusPadding, NULL);3167 QGtk::gtk_widget_style_get(gtkButton, "focus-line-width", &focusWidth, NULL);3200 d->gtk_widget_style_get(gtkButton, "focus-padding", &focusPadding, NULL); 3201 d->gtk_widget_style_get(gtkButton, "focus-line-width", &focusWidth, NULL); 3168 3202 newSize = size; 3169 3203 newSize += QSize(2*gtkButton->style->xthickness + 4, 2*gtkButton->style->ythickness); 3170 3204 newSize += QSize(2*(focusWidth + focusPadding + 2), 2*(focusWidth + focusPadding)); 3171 3205 3172 GtkWidget *gtkButtonBox = QGtk::gtkWidget(QLS("GtkHButtonBox"));3206 GtkWidget *gtkButtonBox = d->gtkWidget(QLS("GtkHButtonBox")); 3173 3207 gint minWidth = 85, minHeight = 0; 3174 QGtk::gtk_widget_style_get(gtkButtonBox, "child-min-width", &minWidth,3208 d->gtk_widget_style_get(gtkButtonBox, "child-min-width", &minWidth, 3175 3209 "child-min-height", &minHeight, NULL); 3176 3210 if (!btn->text.isEmpty() && newSize.width() < minWidth) … … 3183 3217 3184 3218 case CT_Slider: { 3185 GtkWidget *gtkSlider = QGtk::gtkWidget(QLS("GtkHScale"));3219 GtkWidget *gtkSlider = d->gtkWidget(QLS("GtkHScale")); 3186 3220 newSize = size + QSize(2*gtkSlider->style->xthickness, 2*gtkSlider->style->ythickness); 3187 3221 } 3188 3222 break; 3189 3223 3190 case CT_MenuBarItem://cleanlooks adds 2 pixels3191 newSize = QWindowsStyle::sizeFromContents(type, option, size, widget) + QSize(0, 1);3192 break;3193 3194 3224 case CT_LineEdit: { 3195 GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry"));3196 newSize = size + QSize(2*gtkEntry->style->xthickness, 2 *gtkEntry->style->ythickness);3225 GtkWidget *gtkEntry = d->gtkWidget(QLS("GtkEntry")); 3226 newSize = size + QSize(2*gtkEntry->style->xthickness, 2 + 2*gtkEntry->style->ythickness); 3197 3227 } 3198 3228 break; … … 3204 3234 case CT_ComboBox: 3205 3235 if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { 3206 GtkWidget *gtkCombo = QGtk::gtkWidget(QLS("GtkComboBox"));3207 QRect arrowButtonRect = subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget);3236 GtkWidget *gtkCombo = d->gtkWidget(QLS("GtkComboBox")); 3237 QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget); 3208 3238 newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkCombo->style->xthickness, 4 + 2*gtkCombo->style->ythickness); 3209 3239 3210 3240 if (!(widget && qobject_cast<QToolBar *>(widget->parentWidget()))) 3211 newSize += QSize(0, 3);3241 newSize += QSize(0, 2); 3212 3242 } 3213 3243 break; … … 3222 3252 newSize += QSize(6, 0); 3223 3253 } 3224 newSize += QSize(1, 0);3254 newSize += QSize(1, 1); 3225 3255 break; 3226 3256 … … 3231 3261 return newSize; 3232 3262 } 3263 3233 3264 3234 3265 /*! \reimp */ … … 3236 3267 const QWidget *widget) const 3237 3268 { 3238 if (!QGtk::isThemeAvailable()) 3269 Q_D(const QGtkStyle); 3270 3271 if (!d->isThemeAvailable()) 3239 3272 return QCleanlooksStyle::standardPixmap(sp, option, widget); 3240 3273 … … 3264 3297 break; 3265 3298 3266 case SP_DialogDiscardButton: {3299 case SP_DialogDiscardButton: 3267 3300 return QGtkPainter::getIcon(GTK_STOCK_DELETE); 3268 } 3269 3270 case SP_DialogOkButton: { 3301 case SP_DialogOkButton: 3271 3302 return QGtkPainter::getIcon(GTK_STOCK_OK); 3272 } 3273 3274 case SP_DialogCancelButton: { 3303 case SP_DialogCancelButton: 3275 3304 return QGtkPainter::getIcon(GTK_STOCK_CANCEL); 3276 } 3277 3278 case SP_DialogYesButton: { 3305 case SP_DialogYesButton: 3279 3306 return QGtkPainter::getIcon(GTK_STOCK_YES); 3280 } 3281 3282 case SP_DialogNoButton: { 3307 case SP_DialogNoButton: 3283 3308 return QGtkPainter::getIcon(GTK_STOCK_NO); 3284 } 3285 3286 case SP_DialogOpenButton: { 3309 case SP_DialogOpenButton: 3287 3310 return QGtkPainter::getIcon(GTK_STOCK_OPEN); 3288 } 3289 3290 case SP_DialogCloseButton: { 3311 case SP_DialogCloseButton: 3291 3312 return QGtkPainter::getIcon(GTK_STOCK_CLOSE); 3292 } 3293 3294 case SP_DialogApplyButton: { 3313 case SP_DialogApplyButton: 3295 3314 return QGtkPainter::getIcon(GTK_STOCK_APPLY); 3296 } 3297 3298 case SP_DialogSaveButton: { 3315 case SP_DialogSaveButton: 3299 3316 return QGtkPainter::getIcon(GTK_STOCK_SAVE); 3300 } 3301 3302 case SP_MessageBoxWarning: { 3317 case SP_MessageBoxWarning: 3303 3318 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); 3304 } 3305 3306 case SP_MessageBoxQuestion: { 3319 case SP_MessageBoxQuestion: 3307 3320 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); 3308 } 3309 3310 case SP_MessageBoxInformation: { 3321 case SP_MessageBoxInformation: 3311 3322 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG); 3312 } 3313 3314 case SP_MessageBoxCritical: { 3323 case SP_MessageBoxCritical: 3315 3324 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG); 3316 }3317 3318 3325 default: 3319 3326 return QCleanlooksStyle::standardPixmap(sp, option, widget); 3320 3327 } 3321 3322 return QPixmap(); 3328 return pixmap; 3323 3329 } 3330 3331 /*! 3332 \internal 3333 */ 3334 QIcon QGtkStyle::standardIconImplementation(StandardPixmap standardIcon, 3335 const QStyleOption *option, 3336 const QWidget *widget) const 3337 { 3338 Q_D(const QGtkStyle); 3339 3340 if (!d->isThemeAvailable()) 3341 return QCleanlooksStyle::standardIconImplementation(standardIcon, option, widget); 3342 switch (standardIcon) { 3343 case SP_DialogDiscardButton: 3344 return QGtkPainter::getIcon(GTK_STOCK_DELETE); 3345 case SP_DialogOkButton: 3346 return QGtkPainter::getIcon(GTK_STOCK_OK); 3347 case SP_DialogCancelButton: 3348 return QGtkPainter::getIcon(GTK_STOCK_CANCEL); 3349 case SP_DialogYesButton: 3350 return QGtkPainter::getIcon(GTK_STOCK_YES); 3351 case SP_DialogNoButton: 3352 return QGtkPainter::getIcon(GTK_STOCK_NO); 3353 case SP_DialogOpenButton: 3354 return QGtkPainter::getIcon(GTK_STOCK_OPEN); 3355 case SP_DialogCloseButton: 3356 return QGtkPainter::getIcon(GTK_STOCK_CLOSE); 3357 case SP_DialogApplyButton: 3358 return QGtkPainter::getIcon(GTK_STOCK_APPLY); 3359 case SP_DialogSaveButton: 3360 return QGtkPainter::getIcon(GTK_STOCK_SAVE); 3361 case SP_MessageBoxWarning: 3362 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); 3363 case SP_MessageBoxQuestion: 3364 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); 3365 case SP_MessageBoxInformation: 3366 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG); 3367 case SP_MessageBoxCritical: 3368 return QGtkPainter::getIcon(GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG); 3369 default: 3370 return QCleanlooksStyle::standardIconImplementation(standardIcon, option, widget); 3371 } 3372 } 3373 3324 3374 3325 3375 /*! \reimp */ 3326 3376 QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const 3327 3377 { 3378 Q_D(const QGtkStyle); 3379 3328 3380 QRect r = QCleanlooksStyle::subElementRect(element, option, widget); 3329 3381 switch (element) { … … 3332 3384 case SE_ProgressBarGroove: 3333 3385 return option->rect; 3386 case SE_PushButtonContents: 3387 if (!d->gtk_check_version(2, 10, 0)) { 3388 GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton")); 3389 GtkBorder *border = 0; 3390 d->gtk_widget_style_get(gtkButton, "inner-border", &border, NULL); 3391 if (border) { 3392 r = option->rect.adjusted(border->left, border->top, -border->right, -border->bottom); 3393 d->gtk_border_free(border); 3394 } else { 3395 r = option->rect.adjusted(1, 1, -1, -1); 3396 } 3397 r = visualRect(option->direction, option->rect, r); 3398 } 3399 break; 3334 3400 default: 3335 3401 break; -
trunk/src/gui/styles/qgtkstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 46 46 #include <QtGui/QPalette> 47 47 #include <QtGui/QFont> 48 #include <QtGui/QFileDialog> 48 49 49 50 QT_BEGIN_HEADER … … 65 66 public: 66 67 QGtkStyle(); 68 QGtkStyle(QGtkStylePrivate &dd); 69 67 70 ~QGtkStyle(); 68 71 … … 107 110 void unpolish(QWidget *widget); 108 111 void unpolish(QApplication *app); 112 113 static bool getGConfBool(const QString &key, bool fallback = 0); 114 static QString getGConfString(const QString &key, const QString &fallback = QString()); 115 116 117 protected Q_SLOTS: 118 QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, 119 const QWidget *widget = 0) const; 109 120 }; 110 111 121 112 122 #endif //!defined(QT_NO_STYLE_QGTK) -
trunk/src/gui/styles/qmacstyle_mac.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qmacstyle_mac.mm
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** 40 40 ****************************************************************************/ 41 41 42 /* 43 Note: The qdoc comments for QMacStyle are contained in 44 .../doc/src/qstyles.qdoc. 45 */ 46 42 47 #include "qmacstyle_mac.h" 43 48 … … 46 51 //#define DEBUG_SIZE_CONSTRAINT 47 52 53 #include <private/qapplication_p.h> 48 54 #include <private/qcombobox_p.h> 49 55 #include <private/qmacstylepixmaps_mac_p.h> … … 51 57 #include <private/qpainter_p.h> 52 58 #include <private/qprintengine_mac_p.h> 59 #include <private/qstylehelper_p.h> 53 60 #include <qapplication.h> 54 61 #include <qbitmap.h> … … 98 105 99 106 extern QRegion qt_mac_convert_mac_region(RgnHandle); //qregion_mac.cpp 100 extern QHash<QByteArray, QFont> *qt_app_fonts_hash(); // qapplication.cpp101 107 102 108 // The following constants are used for adjusting the size … … 126 132 static const QColor mainWindowGradientEnd(200, 200, 200); 127 133 134 #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) 135 enum { 136 kThemePushButtonTextured = 31, 137 kThemePushButtonTexturedSmall = 32, 138 kThemePushButtonTexturedMini = 33 139 }; 140 141 /* Search fields */ 142 enum { 143 kHIThemeFrameTextFieldRound = 1000, 144 kHIThemeFrameTextFieldRoundSmall = 1001, 145 kHIThemeFrameTextFieldRoundMini = 1002 146 }; 147 #endif 128 148 129 149 // Resolve these at run-time, since the functions was moved in Leopard. … … 323 343 } 324 344 p->setPen(borderHighlightTop); 325 p->drawLine( 0, 0, width, 0);345 p->drawLine(tabRect.x(), 0, width, 0); 326 346 p->setPen(borderTop); 327 p->drawLine( 0, 1, width, 1);347 p->drawLine(tabRect.x(), 1, width, 1); 328 348 329 349 // center block 330 QRect centralRect( 0, 2, width, height - 2);350 QRect centralRect(tabRect.x(), 2, width, height - 2); 331 351 if (active) { 332 352 QColor mainColor = QColor(120, 120, 120); … … 351 371 } 352 372 p->setPen(borderHighlightBottom); 353 p->drawLine( 0, height - 2, width, height - 2);373 p->drawLine(tabRect.x(), height - 2, width, height - 2); 354 374 p->setPen(borderBottom); 355 p->drawLine( 0, height - 1, width, height - 1);375 p->drawLine(tabRect.x(), height - 1, width, height - 1); 356 376 } 357 377 … … 487 507 QPainter *p, const QStyleOption *opt) const; 488 508 489 void drawPantherTab(const QStyleOptionTab *tab, QPainter *p, const QWidget *w = 0) const;490 491 509 QSize pushButtonSizeFromContents(const QStyleOptionButton *btn) const; 492 510 … … 541 559 *****************************************************************************/ 542 560 extern CGContextRef qt_mac_cg_context(const QPaintDevice *); //qpaintdevice_mac.cpp 543 extern QPixmap qt_mac_convert_iconref(const IconRef, int, int); //qpixmap_mac.cpp544 561 extern QRegion qt_mac_convert_mac_region(HIShapeRef); //qregion_mac.cpp 545 562 void qt_mac_dispose_rgn(RgnHandle r); //qregion_mac.cpp … … 550 567 *****************************************************************************/ 551 568 const int qt_mac_hitheme_version = 0; //the HITheme version we speak 552 const int macSpinBoxSep = 5; // distance between spinwidget and the lineedit553 569 const int macItemFrame = 2; // menu item frame width 554 570 const int macItemHMargin = 3; // menu item hor text margin … … 563 579 static inline int qt_mac_hitheme_tab_version() 564 580 { 565 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 566 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) 567 return 1; 568 #endif 569 return 0; 581 return 1; 570 582 } 571 583 … … 833 845 break; 834 846 case QStyle::CT_HeaderSection: 835 if ( sz == QAquaSizeLarge &&isTreeView(widg))847 if (isTreeView(widg)) 836 848 ret = QSize(-1, qt_mac_aqua_get_metric(kThemeMetricListHeaderHeight)); 837 849 break; … … 1033 1045 csz.setWidth(iconSize.width() + textRect.width() 1034 1046 + ((btn->features & QStyleOptionButton::HasMenu) 1035 ? q->p ixelMetric(QStyle::PM_MenuButtonIndicator, btn, 0) : 0));1047 ? q->proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, 0) : 0)); 1036 1048 csz.setHeight(qMax(iconSize.height(), textRect.height())); 1037 1049 return csz; … … 1453 1465 1454 1466 // Tiger broke reverse scroll bars so put them back and "fake it" 1455 if (isScrollbar && (tdi->attributes & kThemeTrackRightToLeft) 1456 && QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { 1467 if (isScrollbar && (tdi->attributes & kThemeTrackRightToLeft)) { 1457 1468 tdi->attributes &= ~kThemeTrackRightToLeft; 1458 1469 tdi->value = tdi->max - slider->sliderPosition; … … 1535 1546 if ((defaultButton || !progressBars.isEmpty()) && timerID <= -1) 1536 1547 timerID = startTimer(animateSpeed(AquaListViewItemOpen)); 1537 }1538 1539 enum { TabNormalLeft, TabNormalMid, TabNormalRight, TabSelectedActiveLeft,1540 TabSelectedActiveMid, TabSelectedActiveRight, TabSelectedInactiveLeft,1541 TabSelectedInactiveMid, TabSelectedInactiveRight, TabSelectedActiveGraphiteLeft,1542 TabSelectedActiveGraphiteMid, TabSelectedActiveGraphiteRight,1543 TabPressedLeft, TabPressedMid, TabPressedRight };1544 1545 static const char * const * const PantherTabXpms[] = {1546 qt_mac_tabnrm_left,1547 qt_mac_tabnrm_mid,1548 qt_mac_tabnrm_right,1549 qt_mac_tabselected_active_left,1550 qt_mac_tabselected_active_mid,1551 qt_mac_tabselected_active_right,1552 qt_mac_tabselected_inactive_left,1553 qt_mac_tabselected_inactive_mid,1554 qt_mac_tabselected_inactive_right,1555 qt_mac_tab_selected_active_graph_left,1556 qt_mac_tab_selected_active_graph_mid,1557 qt_mac_tab_selected_active_graph_right,1558 qt_mac_tab_press_left,1559 qt_mac_tab_press_mid,1560 qt_mac_tab_press_right};1561 1562 void QMacStylePrivate::drawPantherTab(const QStyleOptionTab *tabOpt, QPainter *p,1563 const QWidget *) const1564 {1565 QString tabKey = QLatin1String("$qt_mac_style_tab_");1566 int pantherTabStart;1567 int pantherTabMid;1568 int pantherTabEnd;1569 1570 ThemeTabDirection ttd = getTabDirection(tabOpt->shape);1571 1572 if (tabOpt->state & QStyle::State_Selected) {1573 if (!(tabOpt->state & QStyle::State_Active)) {1574 pantherTabStart = TabSelectedInactiveLeft;1575 } else {1576 // Draw into a pixmap to determine which version we use, Aqua or Graphite.1577 QPixmap tabPix(20, 20);1578 QPainter pixPainter(&tabPix);1579 HIThemeTabDrawInfo tdi;1580 tdi.version = 0;1581 tdi.style = kThemeTabFront;1582 tdi.direction = kThemeTabNorth;1583 tdi.size = kHIThemeTabSizeNormal;1584 tdi.adornment = kHIThemeTabAdornmentNone;1585 HIRect inRect = CGRectMake(0.0f, 0.0f, 20.0f, 20.0f);1586 HIThemeDrawTab(&inRect, &tdi, QMacCGContext(&pixPainter), kHIThemeOrientationNormal, 0);1587 pixPainter.end();1588 const QRgb GraphiteColor = 0xffa7b0ba;1589 QRgb pmColor = tabPix.toImage().pixel(10, 10);1590 if (qAbs(qRed(pmColor) - qRed(GraphiteColor)) < 3 &&1591 qAbs(qGreen(pmColor) - qGreen(GraphiteColor)) < 31592 && qAbs(qBlue(pmColor) - qBlue(GraphiteColor)) < 3)1593 pantherTabStart = TabSelectedActiveGraphiteLeft;1594 else1595 pantherTabStart = TabSelectedActiveLeft;1596 }1597 } else if (tabOpt->state & QStyle::State_Sunken) {1598 pantherTabStart = TabPressedLeft;1599 } else {1600 pantherTabStart = TabNormalLeft;1601 }1602 1603 1604 bool doLine;1605 bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;1606 1607 QStyleOptionTab::TabPosition tp = tabOpt->position;1608 if (ttd == kThemeTabWest1609 || ((ttd == kThemeTabNorth || ttd == kThemeTabSouth)1610 && tabOpt->direction == Qt::RightToLeft)) {1611 if (tp == QStyleOptionTab::Beginning)1612 tp = QStyleOptionTab::End;1613 else if (tp == QStyleOptionTab::End)1614 tp = QStyleOptionTab::Beginning;1615 }1616 1617 switch (tp) {1618 default: // Stupid GCC, being overly pedantic1619 case QStyleOptionTab::Beginning:1620 doLine = false;1621 pantherTabMid = pantherTabEnd = pantherTabStart + 1;1622 break;1623 case QStyleOptionTab::Middle:1624 doLine = true;1625 pantherTabMid = pantherTabEnd = ++pantherTabStart;1626 break;1627 case QStyleOptionTab::End:1628 doLine = true;1629 pantherTabMid = ++pantherTabStart;1630 pantherTabEnd = pantherTabMid + 1;1631 break;1632 case QStyleOptionTab::OnlyOneTab:1633 doLine = false;1634 pantherTabMid = pantherTabStart + 1;1635 pantherTabEnd = pantherTabMid + 1;1636 break;1637 }1638 1639 QPixmap pmStart;1640 if (!QPixmapCache::find(tabKey + QString::number(pantherTabStart), pmStart)) {1641 pmStart = QPixmap(PantherTabXpms[pantherTabStart]);1642 QPixmapCache::insert(tabKey + QString::number(pantherTabStart), pmStart);1643 }1644 1645 QPixmap pmMid;1646 if (!QPixmapCache::find(tabKey + QString::number(pantherTabMid), pmMid)) {1647 pmMid = QPixmap(PantherTabXpms[pantherTabMid]);1648 QPixmapCache::insert(tabKey + QString::number(pantherTabMid), pmMid);1649 }1650 1651 QPixmap pmEnd;1652 if (!QPixmapCache::find(tabKey + QString::number(pantherTabEnd), pmEnd)) {1653 pmEnd = QPixmap(PantherTabXpms[pantherTabEnd]);1654 QPixmapCache::insert(tabKey + QString::number(pantherTabEnd), pmEnd);1655 }1656 QRect tr = tabOpt->rect;1657 if (verticalTabs) {1658 p->save();1659 int newX, newY, newRot;1660 if (tabOpt->shape == QTabBar::RoundedEast || tabOpt->shape == QTabBar::TriangularEast) {1661 newX = tr.width();1662 newY = tr.y();1663 newRot = 90;1664 } else {1665 newX = 0;1666 newY = tr.y() + tr.height();1667 newRot = -90;1668 }1669 tr.setRect(0, 0, tr.height(), tr.width());1670 QMatrix m;1671 if (ttd == kThemeTabEast) {1672 // It's lame but Apple inverts these on the East side.1673 m.scale(-1, 1);1674 m.translate(-tabOpt->rect.width(), 0);1675 }1676 m.translate(newX, newY);1677 m.rotate(newRot);1678 p->setMatrix(m, true);1679 }1680 1681 int x = tr.x();1682 int y = tr.y();1683 int endX = x + tr.width() - pmEnd.width();1684 1685 p->drawPixmap(x, y, pmStart.width(), tr.height(), pmStart);1686 if (doLine) {1687 QPen oldPen = p->pen();1688 p->setPen(QColor(0, 0, 0, 0x35));1689 p->drawLine(x, y + (verticalTabs ? 0 : 1), x, tr.height() - 2);1690 }1691 1692 for (x = x + pmStart.width(); x < endX; x += pmMid.width())1693 p->drawPixmap(x, y, pmMid.width(), tr.height(), pmMid);1694 p->drawPixmap(endX, y, pmEnd.width(), tr.height(), pmEnd);1695 if (verticalTabs)1696 p->restore();1697 1548 } 1698 1549 … … 1990 1841 } 1991 1842 1992 /*!1993 \class QMacStyle1994 \brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager.1995 1996 \ingroup appearance1997 1998 This class is implemented as a wrapper to the HITheme1999 APIs, allowing applications to be styled according to the current2000 theme in use on Mac OS X. This is done by having primitives2001 in QStyle implemented in terms of what Mac OS X would normally theme.2002 2003 \warning This style is only available on Mac OS X because it relies on the2004 HITheme APIs.2005 2006 There are additional issues that should be taken2007 into consideration to make an application compatible with the2008 \link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html2009 Apple Human Interface Guidelines \endlink. Some of these issues are outlined2010 below.2011 2012 \list2013 2014 \i Layout - The restrictions on window layout are such that some2015 aspects of layout that are style-dependent cannot be achieved2016 using QLayout. Changes are being considered (and feedback would be2017 appreciated) to make layouts QStyle-able. Some of the restrictions2018 involve horizontal and vertical widget alignment and widget size2019 (covered below).2020 2021 \i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt2022 does not fully implement this behavior so as to maintain cross-platform2023 compatibility. As a result some widgets sizes may be inappropriate (and2024 subsequently not rendered correctly by the HITheme APIs).The2025 QWidget::sizeHint() will return the appropriate size for many2026 managed widgets (widgets enumerated in \l QStyle::ContentsType).2027 2028 \i Effects - QMacStyle uses HITheme for performing most of the drawing, but2029 also uses emulation in a few cases where HITheme does not provide the2030 required functionality (for example, tab bars on Panther, the toolbar2031 separator, etc). We tried to make the emulation as close to the original as2032 possible. Please report any issues you see in effects or non-standard2033 widgets.2034 2035 \endlist2036 2037 There are other issues that need to be considered in the feel of2038 your application (including the general color scheme to match the2039 Aqua colors). The Guidelines mentioned above will remain current2040 with new advances and design suggestions for Mac OS X.2041 2042 Note that the functions provided by QMacStyle are2043 reimplementations of QStyle functions; see QStyle for their2044 documentation.2045 2046 \img qmacstyle.png2047 \sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle2048 */2049 2050 2051 /*!2052 \enum QMacStyle::WidgetSizePolicy2053 2054 \value SizeSmall2055 \value SizeLarge2056 \value SizeMini2057 \value SizeDefault2058 \omitvalue SizeNone2059 */2060 2061 /*!2062 Constructs a QMacStyle object.2063 */2064 1843 QMacStyle::QMacStyle() 2065 1844 : QWindowsStyle() … … 2068 1847 } 2069 1848 2070 /*!2071 Destructs a QMacStyle object.2072 */2073 1849 QMacStyle::~QMacStyle() 2074 1850 { … … 2084 1860 { 2085 1861 QPixmap px(4, 4); 2086 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 2087 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { 2088 QMacCGContext cg(&px); 2089 HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationNormal); 2090 const CGRect cgRect = CGRectMake(0, 0, px.width(), px.height()); 2091 CGContextFillRect(cg, cgRect); 2092 } else 2093 #endif 2094 { 2095 #ifndef QT_MAC_NO_QUICKDRAW 2096 QMacSavedPortInfo port(&px); 2097 SetThemeBackground(kThemeBrushDialogBackgroundActive, px.depth(), true); 2098 const Rect qdRect = { 0, 0, px.width(), px.height() }; 2099 EraseRect(&qdRect); 2100 #endif 2101 } 1862 QMacCGContext cg(&px); 1863 HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationNormal); 1864 const CGRect cgRect = CGRectMake(0, 0, px.width(), px.height()); 1865 CGContextFillRect(cg, cgRect); 2102 1866 return px; 2103 1867 } … … 2107 1871 HIThemeSetFill us used directly if we are filling with the standard background. 2108 1872 */ 2109 void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, const QBrush &brush) 2110 { 2111 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 1873 void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush) 1874 { 2112 1875 QPoint dummy; 2113 1876 const QPaintDevice *target = painter->device(); 2114 1877 const QPaintDevice *redirected = QPainter::redirected(target, &dummy); 2115 1878 const bool usePainter = redirected && redirected != target; 2116 const QRegion translated = rgn.translated(offset); 2117 2118 if (!usePainter && QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4 && qt_mac_backgroundPattern 1879 1880 if (!usePainter && qt_mac_backgroundPattern 2119 1881 && qt_mac_backgroundPattern->cacheKey() == brush.texture().cacheKey()) { 2120 1882 2121 painter->setClipRegion( translated);1883 painter->setClipRegion(rgn); 2122 1884 2123 1885 CGContextRef cg = qt_mac_cg_context(target); … … 2125 1887 HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationInverted); 2126 1888 2127 const QVector<QRect> &rects = translated.rects();1889 const QVector<QRect> &rects = rgn.rects(); 2128 1890 for (int i = 0; i < rects.size(); ++i) { 2129 1891 const QRect rect(rects.at(i)); … … 2135 1897 2136 1898 CGContextRestoreGState(cg); 2137 } else 2138 #endif 2139 { 2140 const QRect rect(translated.boundingRect()); 2141 painter->setClipRegion(translated); 1899 } else { 1900 const QRect rect(rgn.boundingRect()); 1901 painter->setClipRegion(rgn); 2142 1902 painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); 2143 1903 } 2144 1904 } 2145 1905 2146 /*! \reimp */2147 1906 void QMacStyle::polish(QPalette &pal) 2148 1907 { 2149 if (qt_mac_backgroundPattern == 0) 1908 if (!qt_mac_backgroundPattern) { 1909 if (!qApp) 1910 return; 2150 1911 qt_mac_backgroundPattern = new QPixmap(d->generateBackgroundPattern()); 1912 } 2151 1913 2152 1914 QColor pc(Qt::black); … … 2165 1927 } 2166 1928 2167 /*! \reimp */2168 1929 void QMacStyle::polish(QApplication *) 2169 1930 { 2170 1931 } 2171 1932 2172 /*! \reimp */2173 1933 void QMacStyle::unpolish(QApplication *) 2174 1934 { 2175 1935 } 2176 1936 2177 /*! \reimp */2178 1937 void QMacStyle::polish(QWidget* w) 2179 1938 { … … 2193 1952 if (!w->testAttribute(Qt::WA_SetPalette)) { 2194 1953 QPixmap px(64, 64); 1954 px.fill(Qt::white); 2195 1955 HIThemeMenuDrawInfo mtinfo; 2196 1956 mtinfo.version = qt_mac_hitheme_version; … … 2208 1968 } 2209 1969 2210 // Adjust the lineedit of the editable combo box2211 if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_3) {2212 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(w)) {2213 if (qobject_cast<QComboBox *>(lineEdit->parentWidget())2214 && !lineEdit->testAttribute(Qt::WA_SetFont)) {2215 QFont font = lineEdit->font();2216 font.setPointSize(font.pointSize() - 1);2217 lineEdit->setFont(font);2218 }2219 }2220 }2221 2222 1970 if (QTabBar *tb = qobject_cast<QTabBar*>(w)) { 2223 1971 if (tb->documentMode()) { … … 2239 1987 } 2240 1988 2241 /*! \reimp */2242 1989 void QMacStyle::unpolish(QWidget* w) 2243 1990 { … … 2270 2017 } 2271 2018 2272 /*! \reimp */2273 2019 int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const 2274 2020 { … … 2282 2028 break; 2283 2029 case PM_ToolBarIconSize: 2284 ret = p ixelMetric(PM_LargeIconSize);2030 ret = proxy()->pixelMetric(PM_LargeIconSize); 2285 2031 break; 2286 2032 case PM_FocusFrameVMargin: … … 2374 2120 case PM_SpinBoxFrameWidth: 2375 2121 GetThemeMetric(kThemeMetricEditTextFrameOutset, &ret); 2376 ret += 2; 2122 switch (d->aquaSizeConstrain(opt, widget)) { 2123 default: 2124 ret += 2; 2125 break; 2126 case QAquaSizeMini: 2127 ret += 1; 2128 break; 2129 } 2377 2130 break; 2378 2131 case PM_ButtonShiftHorizontal: … … 2403 2156 QCFType<HIShapeRef> region; 2404 2157 HIRect hirect = qt_hirectForQRect(tb->rect); 2405 if (hirect.size.width == -1)2158 if (hirect.size.width <= 0) 2406 2159 hirect.size.width = 100; 2407 if (hirect.size.height == -1)2160 if (hirect.size.height <= 0) 2408 2161 hirect.size.height = 30; 2409 2162 … … 2449 2202 break; 2450 2203 case QAquaSizeMini: 2451 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) && 02452 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_3) {2453 GetThemeMetric(kThemeMetricMiniScrollBarWidth, &ret);2454 break;2455 }2456 #endif2457 2204 case QAquaSizeSmall: 2458 2205 GetThemeMetric(kThemeMetricSmallScrollBarWidth, &ret); … … 2556 2303 case PM_ToolBarItemSpacing: 2557 2304 ret = 4; 2558 break;2559 case PM_MessageBoxIconSize:2560 ret = 64;2561 2305 break; 2562 2306 case PM_SplitterWidth: … … 2635 2379 ret = 0; 2636 2380 break; 2381 case PM_ToolBarFrameWidth: 2382 ret = 0; 2383 break; 2637 2384 default: 2638 2385 ret = QWindowsStyle::pixelMetric(metric, opt, widget); … … 2642 2389 } 2643 2390 2644 /*! \reimp */2645 2391 QPalette QMacStyle::standardPalette() const 2646 2392 { … … 2652 2398 } 2653 2399 2654 /*! \reimp */2655 2400 int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, 2656 2401 QStyleHintReturn *hret) const … … 2798 2543 pix.fill(QColor(fillR, fillG, fillB)); 2799 2544 QPainter pix_paint(&pix); 2800 drawControl(CE_FocusFrame, opt, &pix_paint, w);2545 proxy()->drawControl(CE_FocusFrame, opt, &pix_paint, w); 2801 2546 pix_paint.end(); 2802 2547 img = pix.toImage(); … … 2947 2692 } 2948 2693 2949 /*! \reimp */2950 2694 QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, 2951 2695 const QStyleOption *opt) const … … 2973 2717 2974 2718 2975 /*! \reimp */2976 2719 QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, 2977 2720 const QWidget *widget) const … … 3004 2747 return icon.pixmap(size, size); 3005 2748 } 3006 /*! 3007 \enum QMacStyle::FocusRectPolicy 3008 3009 This type is used to signify a widget's focus rectangle policy. 3010 3011 \value FocusEnabled show a focus rectangle when the widget has focus. 3012 \value FocusDisabled never show a focus rectangle for the widget. 3013 \value FocusDefault show a focus rectangle when the widget has 3014 focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit, 3015 QListBox, QListView, editable QTextEdit, or one of their 3016 subclasses. 3017 */ 3018 3019 /*! 3020 \obsolete 3021 Sets the focus rectangle policy of \a w. The \a policy can be one of 3022 \l{QMacStyle::FocusRectPolicy}. 3023 3024 This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the 3025 FocusDefault value does nothing anymore. If you want to set a widget back 3026 to its default value, you must save the old value of the attribute before 3027 you change it. 3028 3029 \sa focusRectPolicy() QWidget::setAttribute() 3030 */ 2749 3031 2750 void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy) 3032 2751 { … … 3041 2760 } 3042 2761 3043 /*!3044 \obsolete3045 Returns the focus rectangle policy for the widget \a w.3046 3047 The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}.3048 3049 In 4.3 and up this function will simply test for the3050 Qt::WA_MacShowFocusRect attribute and will never return3051 QMacStyle::FocusDefault.3052 3053 \sa setFocusRectPolicy(), QWidget::testAttribute()3054 */3055 2762 QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w) 3056 2763 { … … 3058 2765 } 3059 2766 3060 /*!3061 \obsolete3062 3063 Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,3064 or Qt::WA_MacNormalSize instead.3065 */3066 2767 void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy) 3067 2768 { … … 3072 2773 } 3073 2774 3074 /*!3075 \obsolete3076 3077 Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,3078 or Qt::WA_MacNormalSize instead.3079 */3080 2775 QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget) 3081 2776 { … … 3093 2788 } 3094 2789 3095 /*! \reimp */3096 2790 void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, 3097 2791 const QWidget *w) const … … 3164 2858 break; 3165 2859 } 3166 drawPrimitive(PE_FrameTabWidget, &twf, p, w);2860 proxy()->drawPrimitive(PE_FrameTabWidget, &twf, p, w); 3167 2861 p->restore(); 3168 2862 } … … 3262 2956 // In HITheme, up is down, down is up and hamburgers eat people. 3263 2957 if (header->sortIndicator != QStyleOptionHeader::None) 3264 drawPrimitive(2958 proxy()->drawPrimitive( 3265 2959 (header->sortIndicator == QStyleOptionHeader::SortDown) ? 3266 2960 PE_IndicatorArrowUp : PE_IndicatorArrowDown, header, p, w); … … 3396 3090 int lw = frame->lineWidth; 3397 3091 if (lw <= 0) 3398 lw = p ixelMetric(PM_DefaultFrameWidth, frame, w);3092 lw = proxy()->pixelMetric(PM_DefaultFrameWidth, frame, w); 3399 3093 { //clear to base color 3400 3094 p->save(); … … 3421 3115 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { 3422 3116 HIRect hirect = qt_hirectForQRect(twf->rect); 3423 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 3424 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) { 3425 HIThemeTabPaneDrawInfo tpdi; 3426 tpdi.version = qt_mac_hitheme_tab_version(); 3427 tpdi.state = tds; 3428 tpdi.direction = getTabDirection(twf->shape); 3429 tpdi.size = kHIThemeTabSizeNormal; 3430 if (tpdi.version == 1) { 3431 tpdi.kind = kHIThemeTabKindNormal; 3432 tpdi.adornment = kHIThemeTabPaneAdornmentNormal; 3433 } 3434 HIThemeDrawTabPane(&hirect, &tpdi, cg, kHIThemeOrientationNormal); 3435 } else 3436 #endif 3437 { 3438 HIThemeGroupBoxDrawInfo gdi; 3439 gdi.version = qt_mac_hitheme_version; 3440 gdi.state = tds; 3441 gdi.kind = kHIThemeGroupBoxKindSecondary; 3442 HIThemeDrawGroupBox(&hirect, &gdi, cg, kHIThemeOrientationNormal); 3443 } 3117 HIThemeTabPaneDrawInfo tpdi; 3118 tpdi.version = qt_mac_hitheme_tab_version(); 3119 tpdi.state = tds; 3120 tpdi.direction = getTabDirection(twf->shape); 3121 tpdi.size = kHIThemeTabSizeNormal; 3122 tpdi.kind = kHIThemeTabKindNormal; 3123 tpdi.adornment = kHIThemeTabPaneAdornmentNormal; 3124 HIThemeDrawTabPane(&hirect, &tpdi, cg, kHIThemeOrientationNormal); 3444 3125 } 3445 3126 break; … … 3465 3146 break; 3466 3147 } 3467 3468 3148 // Use the Leopard style only if the status bar is the status bar for a 3469 3149 // QMainWindow with a unifed toolbar. … … 3526 3206 3527 3207 3528 /*! \reimp */3529 3208 void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, 3530 3209 const QWidget *w) const … … 3610 3289 if (opt->state & State_Enabled) 3611 3290 mode = QIcon::Normal; 3612 QPixmap pixmap = header->icon.pixmap(p ixelMetric(PM_SmallIconSize), mode);3291 QPixmap pixmap = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), mode); 3613 3292 3614 3293 QRect pixr = header->rect; 3615 3294 pixr.setY(header->rect.center().y() - (pixmap.height() - 1) / 2); 3616 drawItemPixmap(p, pixr, Qt::AlignVCenter, pixmap);3295 proxy()->drawItemPixmap(p, pixr, Qt::AlignVCenter, pixmap); 3617 3296 textr.translate(pixmap.width() + 2, 0); 3618 3297 } 3619 3298 3620 drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette,3621 header->state & State_Enabled, header->text, QPalette::ButtonText);3299 proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette, 3300 header->state & State_Enabled, header->text, QPalette::ButtonText); 3622 3301 } 3623 3302 break; … … 3630 3309 int shiftX = 0; 3631 3310 int shiftY = 0; 3632 if (tb->state & (State_Sunken | State_On)) { 3633 shiftX = pixelMetric(PM_ButtonShiftHorizontal, tb, w); 3634 shiftY = pixelMetric(PM_ButtonShiftVertical, tb, w); 3311 bool needText = false; 3312 int alignment = 0; 3313 bool down = tb->state & (State_Sunken | State_On); 3314 if (down) { 3315 shiftX = proxy()->pixelMetric(PM_ButtonShiftHorizontal, tb, w); 3316 shiftY = proxy()->pixelMetric(PM_ButtonShiftVertical, tb, w); 3635 3317 } 3636 3318 // The down state is special for QToolButtons in a toolbar on the Mac … … 3638 3320 // This doesn't really fit into any particular case in QIcon, so we 3639 3321 // do the majority of the work ourselves. 3640 if (tb->state & State_Sunken 3641 && !(tb->features & QStyleOptionToolButton::Arrow)) { 3322 if (!(tb->features & QStyleOptionToolButton::Arrow)) { 3642 3323 Qt::ToolButtonStyle tbstyle = tb->toolButtonStyle; 3643 3324 if (tb->icon.isNull() && !tb->text.isEmpty()) … … 3645 3326 3646 3327 switch (tbstyle) { 3647 case Qt::ToolButtonTextOnly: 3648 drawItemText(p, cr, Qt::AlignCenter, tb->palette,3649 tb->state & State_Enabled, tb->text);3650 break; 3328 case Qt::ToolButtonTextOnly: { 3329 needText = true; 3330 alignment = Qt::AlignCenter; 3331 break; } 3651 3332 case Qt::ToolButtonIconOnly: 3652 3333 case Qt::ToolButtonTextBesideIcon: … … 3654 3335 QRect pr = cr; 3655 3336 QIcon::Mode iconMode = (tb->state & State_Enabled) ? QIcon::Normal 3656 3337 : QIcon::Disabled; 3657 3338 QIcon::State iconState = (tb->state & State_On) ? QIcon::On 3658 3339 : QIcon::Off; 3659 3340 QPixmap pixmap = tb->icon.pixmap(tb->rect.size().boundedTo(tb->iconSize), iconMode, iconState); 3660 3341 3661 3342 // Draw the text if it's needed. 3662 3343 if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { 3663 int alignment = 0;3344 needText = true; 3664 3345 if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { 3665 pr.setHeight(pixmap.size().height() + 6);3666 cr.adjust(0, pr.bottom() , 0, -3);3346 pr.setHeight(pixmap.size().height()); 3347 cr.adjust(0, pr.bottom() + 1, 0, 1); 3667 3348 alignment |= Qt::AlignCenter; 3668 3349 } else { … … 3671 3352 alignment |= Qt::AlignLeft | Qt::AlignVCenter; 3672 3353 } 3354 } 3355 if (opt->state & State_Sunken) { 3356 pr.translate(shiftX, shiftY); 3357 pixmap = darkenPixmap(pixmap); 3358 } 3359 proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pixmap); 3360 break; } 3361 default: 3362 Q_ASSERT(false); 3363 break; 3364 } 3365 3366 if (needText) { 3367 QPalette pal = tb->palette; 3368 QPalette::ColorRole role = QPalette::NoRole; 3369 if (down) 3673 3370 cr.translate(shiftX, shiftY); 3674 drawItemText(p, cr, alignment, tb->palette, 3675 tb->state & State_Enabled, tb->text); 3676 cr.adjust(0, 3, 0, -3); // the drop shadow 3677 drawItemText(p, cr, alignment, tb->palette, 3678 tb->state & State_Enabled, tb->text); 3371 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 3372 && (tbstyle == Qt::ToolButtonTextOnly 3373 || (tbstyle != Qt::ToolButtonTextOnly && !down))) { 3374 QPen pen = p->pen(); 3375 QColor light = down ? Qt::black : Qt::white; 3376 light.setAlphaF(0.375f); 3377 p->setPen(light); 3378 p->drawText(cr.adjusted(0, 1, 0, 1), alignment, tb->text); 3379 p->setPen(pen); 3380 if (down && tbstyle == Qt::ToolButtonTextOnly) { 3381 pal = QApplication::palette("QMenu"); 3382 pal.setCurrentColorGroup(tb->palette.currentColorGroup()); 3383 role = QPalette::HighlightedText; 3384 } 3679 3385 } 3680 pr.translate(shiftX, shiftY); 3681 pixmap = darkenPixmap(pixmap); 3682 drawItemPixmap(p, pr, Qt::AlignCenter, pixmap); 3683 break; } 3386 drawItemText(p, cr, alignment, pal, 3387 tb->state & State_Enabled, tb->text, role); 3388 if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && 3389 (tb->state & State_Sunken)) { 3390 // Draw a "drop shadow" in earlier versions. 3391 drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, 3392 tb->palette, tb->state & State_Enabled, tb->text); 3393 } 3684 3394 } 3685 3395 } else { … … 3731 3441 3732 3442 if (btn->features & QStyleOptionButton::HasMenu) { 3733 int mbi = p ixelMetric(QStyle::PM_MenuButtonIndicator, btn, w);3443 int mbi = proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, w); 3734 3444 QRect ir = btn->rect; 3735 3445 HIRect arrowRect = CGRectMake(ir.right() - mbi - PushButtonRightOffset, … … 3818 3528 int contentW = textRect.width(); 3819 3529 if (hasMenu) 3820 contentW += p ixelMetric(PM_MenuButtonIndicator) + 4;3530 contentW += proxy()->pixelMetric(PM_MenuButtonIndicator) + 4; 3821 3531 QIcon::Mode mode = btn->state & State_Enabled ? QIcon::Normal : QIcon::Disabled; 3822 3532 if (mode == QIcon::Normal && btn->state & State_HasFocus) … … 3832 3542 QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmap.width(), pixmap.height()); 3833 3543 QRect visualIconDestRect = visualRect(btn->direction, freeContentRect, iconDestRect); 3834 drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap);3544 proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap); 3835 3545 int newOffset = iconDestRect.x() + iconDestRect.width() 3836 3546 + PushButtonContentPadding - textRect.x(); … … 3840 3550 if (hasText) { 3841 3551 textRect = visualRect(btn->direction, freeContentRect, textRect); 3842 drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn->palette,3843 (btn->state & State_Enabled), btn->text, QPalette::ButtonText);3552 proxy()->drawItemText(p, textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, btn->palette, 3553 (btn->state & State_Enabled), btn->text, QPalette::ButtonText); 3844 3554 } 3845 3555 } … … 3866 3576 } 3867 3577 } 3868 3869 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 3870 if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_3) { 3871 HIThemeTabDrawInfo tdi; 3872 tdi.version = 1; 3873 tdi.style = kThemeTabNonFront; 3874 tdi.direction = getTabDirection(tabOpt->shape); 3875 switch (d->aquaSizeConstrain(opt, w)) { 3578 HIThemeTabDrawInfo tdi; 3579 tdi.version = 1; 3580 tdi.style = kThemeTabNonFront; 3581 tdi.direction = getTabDirection(tabOpt->shape); 3582 switch (d->aquaSizeConstrain(opt, w)) { 3583 default: 3584 case QAquaSizeUnknown: 3585 case QAquaSizeLarge: 3586 tdi.size = kHIThemeTabSizeNormal; 3587 break; 3588 case QAquaSizeSmall: 3589 tdi.size = kHIThemeTabSizeSmall; 3590 break; 3591 case QAquaSizeMini: 3592 tdi.size = kHIThemeTabSizeMini; 3593 break; 3594 } 3595 bool verticalTabs = tdi.direction == kThemeTabWest || tdi.direction == kThemeTabEast; 3596 QRect tabRect = tabOpt->rect; 3597 3598 bool selected = tabOpt->state & State_Selected; 3599 if (selected) { 3600 if (!(tabOpt->state & State_Active)) 3601 tdi.style = kThemeTabFrontUnavailable; 3602 else if (!(tabOpt->state & State_Enabled)) 3603 tdi.style = kThemeTabFrontInactive; 3604 else 3605 tdi.style = kThemeTabFront; 3606 } else if (!(tabOpt->state & State_Active)) { 3607 tdi.style = kThemeTabNonFrontUnavailable; 3608 } else if (!(tabOpt->state & State_Enabled)) { 3609 tdi.style = kThemeTabNonFrontInactive; 3610 } else if (tabOpt->state & State_Sunken) { 3611 tdi.style = kThemeTabFrontInactive; // (should be kThemeTabNonFrontPressed) 3612 } 3613 if (tabOpt->state & State_HasFocus) 3614 tdi.adornment = kHIThemeTabAdornmentFocus; 3615 else 3616 tdi.adornment = kHIThemeTabAdornmentNone; 3617 tdi.kind = kHIThemeTabKindNormal; 3618 if (!verticalTabs) 3619 tabRect.setY(tabRect.y() - 1); 3620 else 3621 tabRect.setX(tabRect.x() - 1); 3622 QStyleOptionTab::TabPosition tp = tabOpt->position; 3623 QStyleOptionTab::SelectedPosition sp = tabOpt->selectedPosition; 3624 if (tabOpt->direction == Qt::RightToLeft && !verticalTabs) { 3625 if (sp == QStyleOptionTab::NextIsSelected) 3626 sp = QStyleOptionTab::PreviousIsSelected; 3627 else if (sp == QStyleOptionTab::PreviousIsSelected) 3628 sp = QStyleOptionTab::NextIsSelected; 3629 switch (tp) { 3630 case QStyleOptionTab::Beginning: 3631 tp = QStyleOptionTab::End; 3632 break; 3633 case QStyleOptionTab::End: 3634 tp = QStyleOptionTab::Beginning; 3635 break; 3876 3636 default: 3877 case QAquaSizeUnknown:3878 case QAquaSizeLarge:3879 tdi.size = kHIThemeTabSizeNormal;3880 3637 break; 3881 case QAquaSizeSmall: 3882 tdi.size = kHIThemeTabSizeSmall; 3883 break; 3884 case QAquaSizeMini: 3885 tdi.size = kHIThemeTabSizeMini; 3886 break; 3887 } 3888 bool verticalTabs = tdi.direction == kThemeTabWest || tdi.direction == kThemeTabEast; 3889 QRect tabRect = tabOpt->rect; 3890 3891 if ((!verticalTabs && tabRect.height() > 21 || verticalTabs && tabRect.width() > 21)) { 3892 d->drawPantherTab(tabOpt, p, w); 3893 break; 3894 } 3895 3896 bool selected = tabOpt->state & State_Selected; 3897 if (selected) { 3898 if (!(tabOpt->state & State_Active)) 3899 tdi.style = kThemeTabFrontUnavailable; 3900 else if (!(tabOpt->state & State_Enabled)) 3901 tdi.style = kThemeTabFrontInactive; 3902 else 3903 tdi.style = kThemeTabFront; 3904 } else if (!(tabOpt->state & State_Active)) { 3905 tdi.style = kThemeTabNonFrontUnavailable; 3906 } else if (!(tabOpt->state & State_Enabled)) { 3907 tdi.style = kThemeTabNonFrontInactive; 3908 } else if (tabOpt->state & State_Sunken) { 3909 tdi.style = kThemeTabFrontInactive; // (should be kThemeTabNonFrontPressed) 3910 } 3911 if (tabOpt->state & State_HasFocus) 3912 tdi.adornment = kHIThemeTabAdornmentFocus; 3913 else 3914 tdi.adornment = kHIThemeTabAdornmentNone; 3915 tdi.kind = kHIThemeTabKindNormal; 3916 if (!verticalTabs) 3917 tabRect.setY(tabRect.y() - 1); 3918 else 3919 tabRect.setX(tabRect.x() - 1); 3920 QStyleOptionTab::TabPosition tp = tabOpt->position; 3921 QStyleOptionTab::SelectedPosition sp = tabOpt->selectedPosition; 3922 if (tabOpt->direction == Qt::RightToLeft && !verticalTabs) { 3923 if (sp == QStyleOptionTab::NextIsSelected) 3924 sp = QStyleOptionTab::PreviousIsSelected; 3925 else if (sp == QStyleOptionTab::PreviousIsSelected) 3926 sp = QStyleOptionTab::NextIsSelected; 3927 switch (tp) { 3928 case QStyleOptionTab::Beginning: 3929 tp = QStyleOptionTab::End; 3930 break; 3931 case QStyleOptionTab::End: 3932 tp = QStyleOptionTab::Beginning; 3933 break; 3934 default: 3935 break; 3936 } 3937 } 3938 switch (tp) { 3939 case QStyleOptionTab::Beginning: 3940 tdi.position = kHIThemeTabPositionFirst; 3941 if (sp != QStyleOptionTab::NextIsSelected) 3942 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator; 3943 break; 3944 case QStyleOptionTab::Middle: 3945 tdi.position = kHIThemeTabPositionMiddle; 3946 if (selected) 3947 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator; 3948 if (sp != QStyleOptionTab::NextIsSelected) // Also when we're selected. 3949 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator; 3950 break; 3951 case QStyleOptionTab::End: 3952 tdi.position = kHIThemeTabPositionLast; 3953 if (selected) 3954 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator; 3955 break; 3956 case QStyleOptionTab::OnlyOneTab: 3957 tdi.position = kHIThemeTabPositionOnly; 3958 break; 3959 } 3638 } 3639 } 3640 bool stretchTabs = (!verticalTabs && tabRect.height() > 22 || verticalTabs && tabRect.width() > 22); 3641 3642 switch (tp) { 3643 case QStyleOptionTab::Beginning: 3644 tdi.position = kHIThemeTabPositionFirst; 3645 if (sp != QStyleOptionTab::NextIsSelected || stretchTabs) 3646 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator; 3647 break; 3648 case QStyleOptionTab::Middle: 3649 tdi.position = kHIThemeTabPositionMiddle; 3650 if (selected) 3651 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator; 3652 if (sp != QStyleOptionTab::NextIsSelected || stretchTabs) // Also when we're selected. 3653 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator; 3654 break; 3655 case QStyleOptionTab::End: 3656 tdi.position = kHIThemeTabPositionLast; 3657 if (selected) 3658 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator; 3659 break; 3660 case QStyleOptionTab::OnlyOneTab: 3661 tdi.position = kHIThemeTabPositionOnly; 3662 break; 3663 } 3664 // HITheme doesn't stretch its tabs. Therefore we have to cheat and do the job ourselves. 3665 if (stretchTabs) { 3666 HIRect hirect = CGRectMake(0, 0, 23, 23); 3667 QPixmap pm(23, 23); 3668 pm.fill(Qt::transparent); 3669 { 3670 QMacCGContext pmcg(&pm); 3671 HIThemeDrawTab(&hirect, &tdi, pmcg, kHIThemeOrientationNormal, 0); 3672 } 3673 QStyleHelper::drawBorderPixmap(pm, p, tabRect, 7, 7, 7, 7); 3674 } else { 3960 3675 HIRect hirect = qt_hirectForQRect(tabRect); 3961 3676 HIThemeDrawTab(&hirect, &tdi, cg, kHIThemeOrientationNormal, 0); 3962 } else3963 #endif3964 {3965 d->drawPantherTab(tabOpt, p, w);3966 3677 } 3967 3678 } … … 3998 3709 nr.moveTop(+1); 3999 3710 int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic; 4000 drawItemText(p, nr, alignment, np, tab->state & State_Enabled, tab->text, QPalette::WindowText); 3711 proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled, 3712 tab->text, QPalette::WindowText); 4001 3713 p->restore(); 4002 3714 } … … 4121 3833 break; 4122 3834 case CE_FocusFrame: { 4123 int xOff = p ixelMetric(PM_FocusFrameHMargin, opt, w) + 1;4124 int yOff = p ixelMetric(PM_FocusFrameVMargin, opt, w) + 1;3835 int xOff = proxy()->pixelMetric(PM_FocusFrameHMargin, opt, w) + 1; 3836 int yOff = proxy()->pixelMetric(PM_FocusFrameVMargin, opt, w) + 1; 4125 3837 HIRect hirect = CGRectMake(xOff+opt->rect.x(), yOff+opt->rect.y(), opt->rect.width() - 2 * xOff, 4126 3838 opt->rect.height() - 2 * yOff); … … 4245 3957 : QIcon::Disabled; 4246 3958 // Always be normal or disabled to follow the Mac style. 4247 int smallIconSize = p ixelMetric(PM_SmallIconSize);3959 int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize); 4248 3960 QSize iconSize(smallIconSize, smallIconSize); 4249 3961 if (const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) { … … 4280 3992 const int xm = macItemFrame + maxpmw + macItemHMargin; 4281 3993 QFont myFont = mi->font; 4282 if (mi->state & QStyle::State_Mini) 4283 myFont.setPointSize(mi->font.pointSize()); 3994 // myFont may not have any "hard" flags set. We override 3995 // the point size so that when it is resolved against the device, this font will win. 3996 // This is mainly to handle cases where someone sets the font on the window 3997 // and then the combo inherits it and passes it onward. At that point the resolve mask 3998 // is very, very weak. This makes it stonger. 3999 myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF()); 4284 4000 p->setFont(myFont); 4285 4001 p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1, … … 4355 4071 Qt::AlignCenter | Qt::TextHideMnemonic | Qt::TextDontClip 4356 4072 | Qt::TextSingleLine, 4357 mi->icon.pixmap(p ixelMetric(PM_SmallIconSize),4073 mi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), 4358 4074 (mi->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled)); 4359 4075 } else { … … 4415 4131 else 4416 4132 tdi.enableState = kThemeTrackActive; 4417 HIThemeDrawTrack(&tdi, 0, cg, kHIThemeOrientationNormal); 4133 HIThemeOrientation drawOrientation = kHIThemeOrientationNormal; 4134 if (reverse) { 4135 if (vertical) { 4136 drawOrientation = kHIThemeOrientationInverted; 4137 } else { 4138 CGContextSaveGState(cg); 4139 CGContextTranslateCTM(cg, pb->rect.width(), 0); 4140 CGContextScaleCTM(cg, -1, 1); 4141 } 4142 } 4143 HIThemeDrawTrack(&tdi, 0, cg, drawOrientation); 4144 if (reverse && !vertical) 4145 CGContextRestoreGState(cg); 4418 4146 } 4419 4147 break; … … 4503 4231 // For unified tool bars, draw nothing. 4504 4232 if (w) { 4505 if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(w->window())) 4233 if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(w->window())) { 4506 4234 if (mainWindow->unifiedTitleAndToolBarOnMac()) 4507 4235 break; 4236 } 4508 4237 } 4509 4238 … … 4550 4279 } 4551 4280 } 4552 /*! \reimp */ 4281 4553 4282 QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, 4554 4283 const QWidget *widget) const … … 4844 4573 } 4845 4574 4846 /*! \reimp */4847 4575 void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, 4848 4576 const QWidget *widget) const … … 4875 4603 // because on Tiger I only "fake" the reverse stuff. 4876 4604 bool reverseHorizontal = (slider->direction == Qt::RightToLeft 4877 && slider->orientation == Qt::Horizontal 4878 && (!slider->upsideDown 4879 || (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4 4880 && slider->upsideDown))); 4605 && slider->orientation == Qt::Horizontal); 4881 4606 if ((reverseHorizontal 4882 4607 && slider->activeSubControls == SC_ScrollBarAddLine) … … 4913 4638 // there is not enough space for them. 4914 4639 if (cc == CC_ScrollBar) { 4915 const int scrollBarLeng ht= (slider->orientation == Qt::Horizontal)4640 const int scrollBarLength = (slider->orientation == Qt::Horizontal) 4916 4641 ? slider->rect.width() : slider->rect.height(); 4917 4642 const QMacStyle::WidgetSizePolicy sizePolicy = widgetSizePolicy(widget); 4918 if (scrollBarLeng ht< scrollButtonsCutoffSize(thumbIndicatorCutoff, sizePolicy))4643 if (scrollBarLength < scrollButtonsCutoffSize(thumbIndicatorCutoff, sizePolicy)) 4919 4644 tdi.attributes &= ~kThemeTrackShowThumb; 4920 if (scrollBarLeng ht< scrollButtonsCutoffSize(scrollButtonsCutoff, sizePolicy))4645 if (scrollBarLength < scrollButtonsCutoffSize(scrollButtonsCutoff, sizePolicy)) 4921 4646 tdi.enableState = kThemeTrackNothingToScroll; 4922 4647 } … … 4980 4705 if (item.state & State_Open) 4981 4706 treeOpt.state |= State_Open; 4982 drawPrimitive(PE_IndicatorBranch, &treeOpt, p, widget);4707 proxy()->drawPrimitive(PE_IndicatorBranch, &treeOpt, p, widget); 4983 4708 } 4984 4709 y += item.totalHeight; … … 4994 4719 GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size); 4995 4720 4996 QRect lineeditRect = subControlRect(CC_SpinBox, sb, SC_SpinBoxEditField, widget);4721 QRect lineeditRect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxEditField, widget); 4997 4722 lineeditRect.adjust(-frame_size, -frame_size, +frame_size, +frame_size); 4998 4723 … … 5015 4740 break; 5016 4741 case QAquaSizeMini: 4742 bdi.kind = kThemeIncDecButtonMini; 4743 break; 5017 4744 case QAquaSizeSmall: 5018 if (aquaSize == QAquaSizeMini) 5019 bdi.kind = kThemeIncDecButtonMini; 5020 else 5021 bdi.kind = kThemeIncDecButtonSmall; 4745 bdi.kind = kThemeIncDecButtonSmall; 5022 4746 break; 5023 4747 } … … 5039 4763 bdi.adornment = kThemeAdornmentNone; 5040 4764 5041 QRect updown = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp,5042 widget); 5043 updown |= subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget);4765 QRect updown = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); 4766 4767 updown |= proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); 5044 4768 HIRect newRect = qt_hirectForQRect(updown); 5045 4769 QRect off_rct; … … 5050 4774 int(outRect.size.width - newRect.size.width), 5051 4775 int(outRect.size.height - newRect.size.height)); 5052 5053 // HIThemeGetButtonBackgroundBounds offsets non-focused normal sized5054 // buttons by one in de y direction, account for that here.5055 if (bdi.adornment == kThemeAdornmentNone && bdi.kind == kThemeIncDecButton)5056 off_rct.adjust(0, 1, 0, 0);5057 5058 // Adjust the rect for small buttos also.5059 if (bdi.adornment == kThemeAdornmentFocus && bdi.kind == kThemeIncDecButtonSmall)5060 off_rct.adjust(0, 0, 0, -1);5061 4776 5062 4777 newRect = qt_hirectForQRect(updown, off_rct); … … 5129 4844 ThemeTitleBarWidget tbw = kThemeWidgetCollapseBox; 5130 4845 bool active = titlebar->state & State_Active; 5131 int border = 2; 5132 titleBarRect.origin.x += border; 5133 titleBarRect.origin.y -= border; 4846 if (qMacVersion() < QSysInfo::MV_10_6) { 4847 int border = 2; 4848 titleBarRect.origin.x += border; 4849 titleBarRect.origin.y -= border; 4850 } 5134 4851 5135 4852 while (sc <= SC_TitleBarCloseButton) { … … 5163 4880 ptrHIShapeGetBounds(titleRegion2, &tmpRect); 5164 4881 if (tmpRect.size.width != 1) { 5165 int iconExtent = p ixelMetric(PM_SmallIconSize);4882 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); 5166 4883 iw = titlebar->icon.actualSize(QSize(iconExtent, iconExtent)).width(); 5167 4884 } … … 5181 4898 x += br.width() / 2 - p->fontMetrics().width(titlebar->text) / 2; 5182 4899 if (iw) 5183 p->drawPixmap(x - iw, y, titlebar->icon.pixmap(pixelMetric(PM_SmallIconSize), QIcon::Normal)); 4900 p->drawPixmap(x - iw, y, 4901 titlebar->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), QIcon::Normal)); 5184 4902 drawItemText(p, br, Qt::AlignCenter, opt->palette, tds == kThemeStateActive, 5185 4903 titlebar->text, QPalette::Text); … … 5218 4936 tti.truncationMaxLines = 1 + groupBox->text.count(QLatin1Char('\n')); 5219 4937 QCFString groupText = qt_mac_removeMnemonics(groupBox->text); 5220 QRect r = subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget);4938 QRect r = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); 5221 4939 HIRect bounds = qt_hirectForQRect(r); 5222 4940 HIThemeDrawTextBox(groupText, &bounds, &tti, cg, kHIThemeOrientationNormal); … … 5231 4949 if (tb->subControls & SC_ToolButtonMenu) { 5232 4950 QStyleOption arrowOpt(0); 5233 arrowOpt.rect = subControlRect(cc, tb, SC_ToolButtonMenu, widget);4951 arrowOpt.rect = proxy()->subControlRect(cc, tb, SC_ToolButtonMenu, widget); 5234 4952 arrowOpt.rect.setY(arrowOpt.rect.y() + arrowOpt.rect.height() / 2); 5235 4953 arrowOpt.rect.setHeight(arrowOpt.rect.height() / 2); 5236 4954 arrowOpt.state = tb->state; 5237 4955 arrowOpt.palette = tb->palette; 5238 drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); 5239 } else if (tb->features & QStyleOptionToolButton::HasMenu) { 4956 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); 4957 } else if ((tb->features & QStyleOptionToolButton::HasMenu) 4958 && (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) { 5240 4959 drawToolbarButtonArrow(tb->rect, tds, cg); 5241 4960 } 5242 4961 if (tb->state & State_On) { 5243 QPen oldPen = p->pen(); 5244 p->setPen(QColor(0, 0, 0, 0x3a)); 5245 p->fillRect(tb->rect.adjusted(1, 1, -1, -1), QColor(0, 0, 0, 0x12)); 5246 p->drawLine(tb->rect.left() + 1, tb->rect.top(), 5247 tb->rect.right() - 1, tb->rect.top()); 5248 p->drawLine(tb->rect.left() + 1, tb->rect.bottom(), 5249 tb->rect.right() - 1, tb->rect.bottom()); 5250 p->drawLine(tb->rect.topLeft(), tb->rect.bottomLeft()); 5251 p->drawLine(tb->rect.topRight(), tb->rect.bottomRight()); 5252 p->setPen(oldPen); 5253 } 5254 drawControl(CE_ToolButtonLabel, opt, p, widget); 4962 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { 4963 static QPixmap pm(QLatin1String(":/trolltech/mac/style/images/leopard-unified-toolbar-on.png")); 4964 p->setRenderHint(QPainter::SmoothPixmapTransform); 4965 QStyleHelper::drawBorderPixmap(pm, p, tb->rect, 2, 2, 2, 2); 4966 } else { 4967 QPen oldPen = p->pen(); 4968 p->setPen(QColor(0, 0, 0, 0x3a)); 4969 p->fillRect(tb->rect.adjusted(1, 1, -1, -1), QColor(0, 0, 0, 0x12)); 4970 p->drawLine(tb->rect.left() + 1, tb->rect.top(), 4971 tb->rect.right() - 1, tb->rect.top()); 4972 p->drawLine(tb->rect.left() + 1, tb->rect.bottom(), 4973 tb->rect.right() - 1, tb->rect.bottom()); 4974 p->drawLine(tb->rect.topLeft(), tb->rect.bottomLeft()); 4975 p->drawLine(tb->rect.topRight(), tb->rect.bottomRight()); 4976 p->setPen(oldPen); 4977 } 4978 } 4979 proxy()->drawControl(CE_ToolButtonLabel, opt, p, widget); 5255 4980 } else { 5256 4981 ThemeButtonKind bkind = kThemeBevelButton; … … 5261 4986 break; 5262 4987 case QAquaSizeMini: 5263 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) && 05264 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_3) {5265 bkind = kThemeMiniBevelButton;5266 break;5267 }5268 #endif5269 4988 case QAquaSizeSmall: 5270 4989 bkind = kThemeSmallBevelButton; … … 5273 4992 5274 4993 QRect button, menuarea; 5275 button = subControlRect(cc, tb, SC_ToolButton, widget);5276 menuarea = subControlRect(cc, tb, SC_ToolButtonMenu, widget);4994 button = proxy()->subControlRect(cc, tb, SC_ToolButton, widget); 4995 menuarea = proxy()->subControlRect(cc, tb, SC_ToolButtonMenu, widget); 5277 4996 State bflags = tb->state, 5278 4997 mflags = tb->state; … … 5337 5056 drawToolbarButtonArrow(tb->rect, tds, cg); 5338 5057 } 5339 QRect buttonRect = subControlRect(CC_ToolButton, tb, SC_ToolButton, widget);5340 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);5058 QRect buttonRect = proxy()->subControlRect(CC_ToolButton, tb, SC_ToolButton, widget); 5059 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 5341 5060 QStyleOptionToolButton label = *tb; 5342 5061 label.rect = buttonRect.adjusted(fw, fw, -fw, -fw); 5343 drawControl(CE_ToolButtonLabel, &label, p, widget); 5344 } 5345 } 5062 proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget); 5063 } 5064 } 5065 break; 5066 case CC_Dial: 5067 if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt)) 5068 QStyleHelper::drawDial(dial, p); 5346 5069 break; 5347 5070 default: … … 5351 5074 } 5352 5075 5353 /*! \reimp */5354 5076 QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, 5355 5077 const QStyleOptionComplex *opt, … … 5392 5114 // The arrow buttons are not drawn if the scroll bar is to short, 5393 5115 // exclude them from the hit test. 5394 const int scrollBarLeng ht= (sb->orientation == Qt::Horizontal)5116 const int scrollBarLength = (sb->orientation == Qt::Horizontal) 5395 5117 ? sb->rect.width() : sb->rect.height(); 5396 if (scrollBarLeng ht< scrollButtonsCutoffSize(scrollButtonsCutoff, widgetSizePolicy(widget)))5118 if (scrollBarLength < scrollButtonsCutoffSize(scrollButtonsCutoff, widgetSizePolicy(widget))) 5397 5119 sbi.enableState = kThemeTrackNothingToScroll; 5398 5120 … … 5482 5204 } 5483 5205 5484 /*! \reimp */5485 5206 QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, 5486 5207 const QWidget *widget) const … … 5513 5234 : kControlDownButtonPart; 5514 5235 if (slider->direction == Qt::RightToLeft 5515 && slider->orientation == Qt::Horizontal 5516 && (!slider->upsideDown 5517 || (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4 5518 && slider->upsideDown)) 5519 ) { 5236 && slider->orientation == Qt::Horizontal) { 5520 5237 if (cpc == kControlDownButtonPart) 5521 5238 cpc = kControlUpButtonPart; … … 5570 5287 wrc = kWindowTitleTextRgn; 5571 5288 else if (sc == SC_TitleBarSysMenu) 5572 ret.setRect(-1024, -1024, 10, p ixelMetric(PM_TitleBarHeight,5289 ret.setRect(-1024, -1024, 10, proxy()->pixelMetric(PM_TitleBarHeight, 5573 5290 titlebar, widget)); 5574 5291 if (wrc != kWindowGlobalPortRgn) { … … 5606 5323 ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); 5607 5324 ret.setX(ret.x() + ret.width()); 5608 ret.setWidth(combo->rect. width() - ret.width() - ret.x());5325 ret.setWidth(combo->rect.right() - ret.right()); 5609 5326 break; } 5610 5327 case SC_ComboBoxListBoxPopup:{ … … 5612 5329 HIRect inner = QMacStylePrivate::comboboxInnerBounds(qt_hirectForQRect(combo->rect), bdi.kind); 5613 5330 QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); 5614 ret.adjust(qRound(inner.origin.x), 0, qRound(inner.origin.x + inner.size.width), editRect.y() + editRect.height() + 2); 5331 const int comboTop = combo->rect.top(); 5332 ret = QRect(qRound(inner.origin.x), 5333 comboTop, 5334 qRound(inner.origin.x - combo->rect.left() + inner.size.width), 5335 editRect.bottom() - comboTop + 2); 5615 5336 } else { 5616 5337 QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); 5617 ret.adjust(4 - 11, 1, editRect.width() + 10 + 11, 1); 5338 ret = QRect(combo->rect.x() + 4 - 11, 5339 combo->rect.y() + 1, 5340 editRect.width() + 10 + 11, 5341 1); 5618 5342 } 5619 5343 break; } … … 5667 5391 QRect labelRect = alignedRect(groupBox->direction, groupBox->textAlignment, 5668 5392 QSize(tw, h), ret); 5669 int indicatorWidth = p ixelMetric(PM_IndicatorWidth, opt, widget);5393 int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, opt, widget); 5670 5394 bool rtl = groupBox->direction == Qt::RightToLeft; 5671 5395 if (sc == SC_GroupBoxLabel) { … … 5689 5413 int left = rtl ? labelRect.right() - indicatorWidth : labelRect.left(); 5690 5414 ret.setRect(left, ret.top(), 5691 indicatorWidth, p ixelMetric(PM_IndicatorHeight, opt, widget));5415 indicatorWidth, proxy()->pixelMetric(PM_IndicatorHeight, opt, widget)); 5692 5416 } 5693 5417 break; … … 5724 5448 case CC_SpinBox: 5725 5449 if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { 5726 const int spinner_w = 14, 5727 fw = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); 5450 QAquaWidgetSize aquaSize = d->aquaSizeConstrain(spin, widget); 5451 int spinner_w; 5452 int spinBoxSep; 5453 int fw = proxy()->pixelMetric(PM_SpinBoxFrameWidth, spin, widget); 5454 switch (aquaSize) { 5455 default: 5456 case QAquaSizeUnknown: 5457 case QAquaSizeLarge: 5458 spinner_w = 14; 5459 spinBoxSep = 2; 5460 break; 5461 case QAquaSizeSmall: 5462 spinner_w = 12; 5463 spinBoxSep = 2; 5464 break; 5465 case QAquaSizeMini: 5466 spinner_w = 10; 5467 spinBoxSep = 1; 5468 break; 5469 } 5470 5728 5471 switch (sc) { 5729 5472 case SC_SpinBoxUp: … … 5731 5474 if (spin->buttonSymbols == QAbstractSpinBox::NoButtons) 5732 5475 break; 5733 const int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); 5734 const int spinner_w = 18; 5735 const int y = frameWidth; 5736 const int x = spin->rect.width() - spinner_w + frameWidth; 5476 5477 const int y = fw; 5478 const int x = spin->rect.width() - spinner_w; 5737 5479 ret.setRect(x + spin->rect.x(), y + spin->rect.y(), spinner_w, spin->rect.height() - y * 2); 5738 5480 HIThemeButtonDrawInfo bdi; 5739 5481 bdi.version = qt_mac_hitheme_version; 5740 5482 bdi.kind = kThemeIncDecButton; 5741 QAquaWidgetSize aquaSize = d->aquaSizeConstrain(opt, widget);5483 int hackTranslateX; 5742 5484 switch (aquaSize) { 5743 case QAquaSizeUnknown: 5744 case QAquaSizeLarge: 5745 bdi.kind = kThemeIncDecButton; 5746 break; 5747 case QAquaSizeMini: 5748 case QAquaSizeSmall: 5749 if (aquaSize == QAquaSizeMini) 5750 bdi.kind = kThemeIncDecButtonMini; 5751 else 5752 bdi.kind = kThemeIncDecButtonSmall; 5753 break; 5485 default: 5486 case QAquaSizeUnknown: 5487 case QAquaSizeLarge: 5488 bdi.kind = kThemeIncDecButton; 5489 hackTranslateX = 0; 5490 break; 5491 case QAquaSizeSmall: 5492 bdi.kind = kThemeIncDecButtonSmall; 5493 hackTranslateX = -2; 5494 break; 5495 case QAquaSizeMini: 5496 bdi.kind = kThemeIncDecButtonMini; 5497 hackTranslateX = -1; 5498 break; 5754 5499 } 5755 5500 bdi.state = kThemeStateActive; … … 5757 5502 bdi.adornment = kThemeAdornmentNone; 5758 5503 HIRect hirect = qt_hirectForQRect(ret); 5504 5759 5505 HIRect outRect; 5760 5506 HIThemeGetButtonBackgroundBounds(&hirect, &bdi, &outRect); … … 5771 5517 break; 5772 5518 } 5773 ret.translate( -1, -2); // hack: position the buttons correctly (weird that we need this)5519 ret.translate(hackTranslateX, 0); // hack: position the buttons correctly (weird that we need this) 5774 5520 ret = visualRect(spin->direction, spin->rect, ret); 5775 5521 break; 5776 5522 } 5777 5523 case SC_SpinBoxEditField: 5778 ret.setRect(fw, fw, 5779 spin->rect.width() - spinner_w - fw * 2 - macSpinBoxSep + 1, 5780 spin->rect.height() - fw * 2); 5524 if (spin->buttonSymbols == QAbstractSpinBox::NoButtons) { 5525 ret.setRect(fw, fw, 5526 spin->rect.width() - fw * 2, 5527 spin->rect.height() - fw * 2); 5528 } else { 5529 ret.setRect(fw, fw, 5530 spin->rect.width() - fw * 2 - spinBoxSep - spinner_w, 5531 spin->rect.height() - fw * 2); 5532 } 5781 5533 ret = visualRect(spin->direction, spin->rect, ret); 5782 5534 break; … … 5800 5552 } 5801 5553 5802 /*! \reimp */5803 5554 QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, 5804 5555 const QSize &csz, const QWidget *widget) const … … 5809 5560 switch (ct) { 5810 5561 case QStyle::CT_SpinBox: 5811 sz.setWidth(sz.width() + macSpinBoxSep);5812 sz.setHeight(sz.height() - 3); // hack to work around horrible sizeHint() code in QAbstractSpinBox5562 // hack to work around horrible sizeHint() code in QAbstractSpinBox 5563 sz.setHeight(sz.height() - 3); 5813 5564 break; 5814 5565 case QStyle::CT_TabBarTab: 5815 5566 if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) { 5816 bool newStyleTabs =5817 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)5818 QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4 ? true :5819 #endif5820 false;5821 5567 const QAquaWidgetSize AquaSize = d->aquaSizeConstrain(opt, widget); 5822 5568 const bool differentFont = (widget && widget->testAttribute(Qt::WA_SetFont)) … … 5826 5572 if (vertTabs) 5827 5573 sz.transpose(); 5828 if (newStyleTabs) { 5829 int defaultTabHeight; 5830 int defaultExtraSpace = pixelMetric(PM_TabBarTabHSpace, tab, widget); // Remove spurious gcc warning (AFAIK) 5831 QFontMetrics fm = opt->fontMetrics; 5832 switch (AquaSize) { 5833 case QAquaSizeUnknown: 5834 case QAquaSizeLarge: 5835 if (tab->documentMode) 5836 defaultTabHeight = 23; 5837 else 5838 defaultTabHeight = 21; 5839 break; 5840 case QAquaSizeSmall: 5841 defaultTabHeight = 18; 5842 break; 5843 case QAquaSizeMini: 5844 defaultTabHeight = 16; 5845 break; 5846 } 5847 5848 bool setWidth = false; 5849 if (differentFont || !tab->icon.isNull()) { 5850 sz.rheight() = qMax(defaultTabHeight, sz.height()); 5851 } else { 5852 QSize textSize = fm.size(Qt::TextShowMnemonic, tab->text); 5853 sz.rheight() = qMax(defaultTabHeight, textSize.height()); 5854 sz.rwidth() = textSize.width() + defaultExtraSpace; 5855 setWidth = true; 5856 } 5857 5858 if (vertTabs) 5859 sz.transpose(); 5860 5861 int maxWidgetHeight = qMax(tab->leftButtonSize.height(), tab->rightButtonSize.height()); 5862 int maxWidgetWidth = qMax(tab->leftButtonSize.width(), tab->rightButtonSize.width()); 5863 5864 int widgetWidth = 0; 5865 int widgetHeight = 0; 5866 int padding = 0; 5867 if (tab->leftButtonSize.isValid()) { 5868 padding += 8; 5869 widgetWidth += tab->leftButtonSize.width(); 5870 widgetHeight += tab->leftButtonSize.height(); 5871 } 5872 if (tab->rightButtonSize.isValid()) { 5873 padding += 8; 5874 widgetWidth += tab->rightButtonSize.width(); 5875 widgetHeight += tab->rightButtonSize.height(); 5876 } 5877 5878 if (vertTabs) { 5879 sz.setHeight(sz.height() + widgetHeight + padding); 5880 sz.setWidth(qMax(sz.width(), maxWidgetWidth)); 5881 } else { 5882 if (setWidth) 5883 sz.setWidth(sz.width() + widgetWidth + padding); 5884 sz.setHeight(qMax(sz.height(), maxWidgetHeight)); 5885 } 5574 int defaultTabHeight; 5575 int defaultExtraSpace = proxy()->pixelMetric(PM_TabBarTabHSpace, tab, widget); // Remove spurious gcc warning (AFAIK) 5576 QFontMetrics fm = opt->fontMetrics; 5577 switch (AquaSize) { 5578 case QAquaSizeUnknown: 5579 case QAquaSizeLarge: 5580 if (tab->documentMode) 5581 defaultTabHeight = 23; 5582 else 5583 defaultTabHeight = 21; 5584 break; 5585 case QAquaSizeSmall: 5586 defaultTabHeight = 18; 5587 break; 5588 case QAquaSizeMini: 5589 defaultTabHeight = 16; 5590 break; 5591 } 5592 bool setWidth = false; 5593 if (differentFont || !tab->icon.isNull()) { 5594 sz.rheight() = qMax(defaultTabHeight, sz.height()); 5886 5595 } else { 5887 SInt32 tabh = sz.height(); 5888 SInt32 overlap = 0; 5889 switch (AquaSize) { 5890 default: 5891 case QAquaSizeUnknown: 5892 case QAquaSizeLarge: 5893 GetThemeMetric(kThemeLargeTabHeight, &tabh); 5894 GetThemeMetric(kThemeMetricTabFrameOverlap, &overlap); 5895 break; 5896 case QAquaSizeMini: 5897 GetThemeMetric(kThemeMetricMiniTabHeight, &tabh); 5898 GetThemeMetric(kThemeMetricMiniTabFrameOverlap, &overlap); 5899 break; 5900 case QAquaSizeSmall: 5901 GetThemeMetric(kThemeSmallTabHeight, &tabh); 5902 GetThemeMetric(kThemeMetricSmallTabFrameOverlap, &overlap); 5903 break; 5904 } 5905 tabh += overlap; 5906 if (sz.height() < tabh) 5907 sz.rheight() = tabh; 5596 QSize textSize = fm.size(Qt::TextShowMnemonic, tab->text); 5597 sz.rheight() = qMax(defaultTabHeight, textSize.height()); 5598 sz.rwidth() = textSize.width() + defaultExtraSpace; 5599 setWidth = true; 5600 } 5601 5602 if (vertTabs) 5603 sz.transpose(); 5604 5605 int maxWidgetHeight = qMax(tab->leftButtonSize.height(), tab->rightButtonSize.height()); 5606 int maxWidgetWidth = qMax(tab->leftButtonSize.width(), tab->rightButtonSize.width()); 5607 5608 int widgetWidth = 0; 5609 int widgetHeight = 0; 5610 int padding = 0; 5611 if (tab->leftButtonSize.isValid()) { 5612 padding += 8; 5613 widgetWidth += tab->leftButtonSize.width(); 5614 widgetHeight += tab->leftButtonSize.height(); 5615 } 5616 if (tab->rightButtonSize.isValid()) { 5617 padding += 8; 5618 widgetWidth += tab->rightButtonSize.width(); 5619 widgetHeight += tab->rightButtonSize.height(); 5620 } 5621 5622 if (vertTabs) { 5623 sz.setHeight(sz.height() + widgetHeight + padding); 5624 sz.setWidth(qMax(sz.width(), maxWidgetWidth)); 5625 } else { 5626 if (setWidth) 5627 sz.setWidth(sz.width() + widgetWidth + padding); 5628 sz.setHeight(qMax(sz.height(), maxWidgetHeight)); 5908 5629 } 5909 5630 } … … 5935 5656 maxpmw = qMax(maxpmw, iconSize.width()); 5936 5657 } else { 5937 int iconExtent = p ixelMetric(PM_SmallIconSize);5658 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); 5938 5659 h = qMax(h, mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() + 4); 5939 5660 } … … 5964 5685 break; 5965 5686 case CT_ToolButton: 5687 if (widget && qobject_cast<const QToolBar *>(widget->parentWidget())) { 5688 sz.rwidth() += 4; 5689 if (sz.height() <= 32) { 5690 // Workaround strange HIToolBar bug when getting constraints. 5691 sz.rheight() += 1; 5692 } 5693 return sz; 5694 } 5966 5695 sz.rwidth() += 10; 5967 5696 sz.rheight() += 10; … … 5974 5703 QStyleOption myOption = *opt; 5975 5704 myOption.rect.setSize(sz); 5976 if ( styleHint(SH_Menu_Mask, &myOption, widget, &menuMask)) {5705 if (proxy()->styleHint(SH_Menu_Mask, &myOption, widget, &menuMask)) { 5977 5706 sz = menuMask.region.boundingRect().size(); 5978 5707 } … … 6087 5816 } 6088 5817 6089 /*!6090 \reimp6091 */6092 5818 void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, 6093 5819 bool enabled, const QString &text, QPalette::ColorRole textRole) const … … 6098 5824 } 6099 5825 6100 /*!6101 \reimp6102 */6103 5826 bool QMacStyle::event(QEvent *e) 6104 5827 { … … 6149 5872 } 6150 5873 6151 void qt_mac_constructQIconFromIconRef(const IconRef icon, const IconRef overlayIcon, QIcon *retIcon, QStyle::StandardPixmap standardIcon = QStyle::SP_CustomBase)6152 {6153 int size = 16;6154 while (size <= 128) {6155 6156 const QString cacheKey = QLatin1String("qt_mac_constructQIconFromIconRef") + QString::number(standardIcon) + QString::number(size);6157 QPixmap mainIcon;6158 if (standardIcon >= QStyle::SP_CustomBase) {6159 mainIcon = qt_mac_convert_iconref(icon, size, size);6160 } else if (QPixmapCache::find(cacheKey, mainIcon) == false) {6161 mainIcon = qt_mac_convert_iconref(icon, size, size);6162 QPixmapCache::insert(cacheKey, mainIcon);6163 }6164 6165 if (overlayIcon) {6166 int littleSize = size / 2;6167 QPixmap overlayPix = qt_mac_convert_iconref(overlayIcon, littleSize, littleSize);6168 QPainter painter(&mainIcon);6169 painter.drawPixmap(size - littleSize, size - littleSize, overlayPix);6170 }6171 6172 retIcon->addPixmap(mainIcon);6173 size += size; // 16 -> 32 -> 64 -> 1286174 }6175 }6176 6177 /*!6178 \internal6179 */6180 5874 QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt, 6181 5875 const QWidget *widget) const 6182 5876 { 6183 OSType iconType = 0;6184 5877 switch (standardIcon) { 6185 case QStyle::SP_MessageBoxQuestion: 6186 case QStyle::SP_MessageBoxInformation: 6187 case QStyle::SP_MessageBoxWarning: 6188 case QStyle::SP_MessageBoxCritical: 6189 iconType = kGenericApplicationIcon; 6190 break; 6191 case SP_DesktopIcon: 6192 iconType = kDesktopIcon; 6193 break; 6194 case SP_TrashIcon: 6195 iconType = kTrashIcon; 6196 break; 6197 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 6198 case SP_ComputerIcon: 6199 iconType = kComputerIcon; 6200 break; 6201 #endif 6202 case SP_DriveFDIcon: 6203 iconType = kGenericFloppyIcon; 6204 break; 6205 case SP_DriveHDIcon: 6206 iconType = kGenericHardDiskIcon; 6207 break; 6208 case SP_DriveCDIcon: 6209 case SP_DriveDVDIcon: 6210 iconType = kGenericCDROMIcon; 6211 break; 6212 case SP_DriveNetIcon: 6213 iconType = kGenericNetworkIcon; 6214 break; 6215 case SP_DirOpenIcon: 6216 iconType = kOpenFolderIcon; 6217 break; 6218 case SP_DirClosedIcon: 6219 case SP_DirLinkIcon: 6220 iconType = kGenericFolderIcon; 6221 break; 6222 case SP_FileLinkIcon: 6223 case SP_FileIcon: 6224 iconType = kGenericDocumentIcon; 6225 break; 5878 default: 5879 return QWindowsStyle::standardIconImplementation(standardIcon, opt, widget); 6226 5880 case SP_ToolBarHorizontalExtensionButton: 6227 5881 case SP_ToolBarVerticalExtensionButton: { … … 6237 5891 } 6238 5892 return pixmap; 6239 } 6240 break; 6241 case SP_DirIcon: { 6242 // A rather special case 6243 QIcon closeIcon = QStyle::standardIcon(SP_DirClosedIcon, opt, widget); 6244 QIcon openIcon = QStyle::standardIcon(SP_DirOpenIcon, opt, widget); 6245 closeIcon.addPixmap(openIcon.pixmap(16, 16), QIcon::Normal, QIcon::On); 6246 closeIcon.addPixmap(openIcon.pixmap(32, 32), QIcon::Normal, QIcon::On); 6247 closeIcon.addPixmap(openIcon.pixmap(64, 64), QIcon::Normal, QIcon::On); 6248 closeIcon.addPixmap(openIcon.pixmap(128, 128), QIcon::Normal, QIcon::On); 6249 return closeIcon; 6250 } 6251 case SP_TitleBarNormalButton: 6252 case SP_TitleBarCloseButton: { 6253 QIcon titleBarIcon; 6254 if (standardIcon == SP_TitleBarCloseButton) { 6255 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-16.png")); 6256 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On); 6257 } else { 6258 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-16.png")); 6259 titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On); 6260 } 6261 return titleBarIcon; 6262 } 6263 default: 6264 break; 6265 } 6266 if (iconType != 0) { 6267 QIcon retIcon; 6268 IconRef icon; 6269 IconRef overlayIcon = 0; 6270 if (iconType != kGenericApplicationIcon) { 6271 GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon); 6272 } else { 6273 FSRef fsRef; 6274 ProcessSerialNumber psn = { 0, kCurrentProcess }; 6275 GetProcessBundleLocation(&psn, &fsRef); 6276 GetIconRefFromFileInfo(&fsRef, 0, 0, 0, 0, kIconServicesNormalUsageFlag, &icon, 0); 6277 if (standardIcon == SP_MessageBoxCritical) { 6278 overlayIcon = icon; 6279 GetIconRef(kOnSystemDisk, kSystemIconsCreator, kAlertCautionIcon, &icon); 6280 } 6281 } 6282 if (icon) { 6283 qt_mac_constructQIconFromIconRef(icon, overlayIcon, &retIcon, standardIcon); 6284 ReleaseIconRef(icon); 6285 } 6286 if (overlayIcon) 6287 ReleaseIconRef(overlayIcon); 6288 return retIcon; 6289 } 6290 return QWindowsStyle::standardIconImplementation(standardIcon, opt, widget); 6291 } 6292 6293 /*! 6294 \internal 6295 */ 5893 } 5894 } 5895 } 5896 6296 5897 int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, 6297 5898 QSizePolicy::ControlType control2, -
trunk/src/gui/styles/qmacstylepixmaps_mac_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 50 50 // We mean it. 51 51 // 52 53 static const char *const qt_mac_tabnrm_left[]={54 "6 22 71 2",55 "#a c #5f5f5f",56 "## c #6d6d6d",57 ".c c #737373",58 ".d c #757575",59 ".b c #7c7c7c",60 ".n c #7d7d7d",61 ".r c #828282",62 ".f c #838383",63 "#. c #878787",64 ".7 c #8c8c8c",65 ".v c #8e8e8e",66 ".4 c #939393",67 ".1 c #969696",68 ".j c #979797",69 ".a c #9a9a9a",70 ".6 c #9b9b9b",71 ".A c #a0a0a0",72 ".Z c #a6a6a6",73 ".C c #aaaaaa",74 ".3 c #aeaeae",75 ".E c #afafaf",76 ".J c #b3b3b3",77 ".8 c #b7b7b7",78 ".o c #b8b8b8",79 ".g c #b9b9b9",80 ".P c #bcbcbc",81 ".R c #bfbfbf",82 ".T c #c2c2c2",83 ".s c #c4c4c4",84 "#e c #c6c6c6",85 ".V c #c7c7c7",86 ".w c #c9c9c9",87 ".B c #cacaca",88 "#d c #cbcbcb",89 ".z c #cecece",90 ".F c #cfcfcf",91 ".5 c #d1d1d1",92 "#c c #d3d3d3",93 ".K c #d4d4d4",94 ".G c #d5d5d5",95 ".Q c #d6d6d6",96 ".S c #d8d8d8",97 ".U c #dadada",98 ".2 c #dbdbdb",99 ".L c #dcdcdc",100 ".H c #dedede",101 ".I c #dfdfdf",102 ".M c #e0e0e0",103 ".X c #e1e1e1",104 ".D c #e2e2e2",105 "#b c #e3e3e3",106 ".O c #e4e4e4",107 ".N c #e6e6e6",108 ".9 c #e7e7e7",109 ".e c #e8e8e8",110 ".# c #e9e9e9",111 ".t c #ebebeb",112 "Qt c #ececec",113 ".p c #ededed",114 ".x c #eeeeee",115 ".y c #efefef",116 ".u c #f1f1f1",117 ".k c #f2f2f2",118 ".q c #f3f3f3",119 ".W c #f6f6f6",120 ".l c #f7f7f7",121 ".m c #f8f8f8",122 ".Y c #f9f9f9",123 ".h c #fcfcfc",124 ".i c #fdfdfd",125 ".0 c #ffffff",126 "Qt.#.a.b.c.d",127 ".e.f.gQt.h.i",128 ".j.a.k.l.m.m",129 ".n.o.p.k.q.q",130 ".r.s.t.u.u.u",131 ".v.w.t.x.y.y",132 ".a.z.#.p.x.x",133 ".A.B.#.t.x.p",134 ".C.B.D.t.x.x",135 ".E.F.G.H.I.I",136 ".J.K.L.M.N.O",137 ".P.Q.D.#.e.#",138 ".R.S.O.p.x.p",139 ".T.U.#.u.u.k",140 ".V.I.t.q.W.W",141 ".P.X.k.W.Y.Y",142 ".Z.M.u.Y.0.0",143 ".1.2.l.0.0.0",144 ".3.4.m.0.0.0",145 ".5.6.7.8.9.0",146 ".X.5.3#.###a",147 ".O#b.L#c#d#e"};148 149 static const char *const qt_mac_tabnrm_mid[]={150 "6 22 18 1",151 "n c #585858",152 ". c #777777",153 "p c #c2c2c2",154 "o c #c3c3c3",155 "g c #dedede",156 "h c #e5e5e5",157 "i c #e8e8e8",158 "f c #ededed",159 "e c #eeeeee",160 "d c #efefef",161 "c c #f1f1f1",162 "b c #f3f3f3",163 "j c #f6f6f6",164 "a c #f8f8f8",165 "k c #f9f9f9",166 "# c #fdfdfd",167 "l c #fefefe",168 "m c #ffffff",169 "......",170 "######",171 "aaaaaa",172 "bbbbbb",173 "cccccc",174 "dddddd",175 "eeeeee",176 "ffffff",177 "eeeeee",178 "gggggg",179 "hhhhhh",180 "iiiiii",181 "eeeeee",182 "cccccc",183 "jjjjjj",184 "kkkkkk",185 "llllll",186 "mmmmmm",187 "mmmmmm",188 "mmmmmm",189 "nnnnnn",190 "oppooo"};191 192 static const char *const qt_mac_tabnrm_right[]={193 "6 22 70 2",194 ".9 c #5f5f5f",195 "#. c #6d6d6d",196 ".# c #747474",197 "Qt c #757575",198 ".a c #7c7c7c",199 ".p c #7d7d7d",200 ".t c #828282",201 ".h c #838383",202 "## c #888888",203 ".6 c #8c8c8c",204 ".x c #8e8e8e",205 ".3 c #929292",206 ".2 c #969696",207 ".l c #979797",208 ".b c #9a9a9a",209 ".7 c #9b9b9b",210 ".A c #a0a0a0",211 ".0 c #a6a6a6",212 ".C c #aaaaaa",213 "#a c #aeaeae",214 ".H c #afafaf",215 ".N c #b3b3b3",216 ".5 c #b7b7b7",217 ".o c #b8b8b8",218 ".g c #b9b9b9",219 ".Q c #bcbcbc",220 ".S c #bfbfbf",221 ".U c #c2c2c2",222 ".s c #c4c4c4",223 "#b c #c6c6c6",224 ".W c #c7c7c7",225 ".w c #c9c9c9",226 ".z c #cacaca",227 ".y c #cecece",228 ".G c #cfcfcf",229 ".8 c #d1d1d1",230 "#c c #d3d3d3",231 ".M c #d4d4d4",232 ".F c #d5d5d5",233 ".P c #d6d6d6",234 ".R c #d8d8d8",235 ".T c #dadada",236 ".1 c #dbdbdb",237 ".L c #dcdcdc",238 ".E c #dedede",239 ".D c #dfdfdf",240 ".K c #e0e0e0",241 ".Y c #e1e1e1",242 ".B c #e2e2e2",243 ".I c #e4e4e4",244 "#d c #e5e5e5",245 ".J c #e6e6e6",246 ".4 c #e7e7e7",247 ".O c #e8e8e8",248 ".c c #e9e9e9",249 ".r c #ebebeb",250 ".d c #ececec",251 ".n c #ededed",252 ".v c #eeeeee",253 ".u c #efefef",254 ".q c #f1f1f1",255 ".k c #f2f2f2",256 ".m c #f3f3f3",257 ".V c #f6f6f6",258 ".j c #f7f7f7",259 ".i c #f8f8f8",260 ".X c #f9f9f9",261 ".f c #fcfcfc",262 ".e c #fdfdfd",263 ".Z c #ffffff",264 "Qt.#.a.b.c.d",265 ".e.f.d.g.h.c",266 ".i.i.j.k.b.l",267 ".m.m.k.n.o.p",268 ".q.q.q.r.s.t",269 ".u.u.v.r.w.x",270 ".v.v.n.c.y.b",271 ".n.v.r.c.z.A",272 ".v.v.r.B.z.C",273 ".D.D.E.F.G.H",274 ".I.J.K.L.M.N",275 ".c.O.c.B.P.Q",276 ".n.v.n.I.R.S",277 ".k.q.q.c.T.U",278 ".V.V.m.r.D.W",279 ".X.X.V.k.Y.Q",280 ".Z.Z.X.q.K.0",281 ".Z.Z.Z.j.1.2",282 ".Z.Z.Z.i.3.H",283 ".Z.4.5.6.7.8",284 ".9#.###a.8.B",285 "#b.z#c.L.I#d"};286 287 static const char *const qt_mac_tabselected_active_left[]={288 "6 22 130 2",289 ".d c #000069",290 ".C c #0042b4",291 ".I c #0157bb",292 ".w c #0c28a0",293 ".l c #101094",294 ".O c #1163c4",295 ".c c #1a1a6e",296 ".U c #1e6ec9",297 ".r c #214eb7",298 ".x c #256cc9",299 ".0 c #2877ce",300 ".6 c #347fd1",301 ".D c #3981d2",302 "#a c #3a81d2",303 "#g c #418ad7",304 ".J c #4288d4",305 ".q c #45459b",306 ".V c #458cd5",307 ".g c #46469f",308 ".P c #4a8dd7",309 ".1 c #4a90db",310 "#m c #4b91db",311 "#s c #4e91dc",312 "#y c #4f8dcd",313 ".7 c #5195df",314 ".b c #525280",315 "#E c #5984b2",316 "#b c #5b9be1",317 "#R c #5c7e9f",318 ".2 c #5d9de6",319 "#5 c #5f5f5f",320 "#Y c #627c8d",321 "#h c #65a4e7",322 ".3 c #65a6e8",323 ".8 c #67a6eb",324 "#n c #69a6e8",325 "#c c #6cabed",326 "#4 c #6d6d6d",327 ".4 c #6dacee",328 ".5 c #6eabee",329 "#K c #6f87a1",330 "#L c #70aff1",331 ".9 c #70aff2",332 "#t c #71aced",333 "#z c #72afee",334 "#F c #72afef",335 ".f c #757592",336 "#i c #75b3f4",337 "#d c #75b4f3",338 "#Z c #77a6b3",339 "#. c #77b1f4",340 "## c #7ab4f4",341 ".W c #7cb0e7",342 "#o c #7cb8f9",343 "#f c #80bdf9",344 "#e c #81bbf9",345 "#j c #81bbfc",346 "#u c #86c1ff",347 "#3 c #878787",348 "#k c #89c2fd",349 "#A c #89c3ff",350 ".Q c #8bb9e8",351 "#l c #8bc4ff",352 "#p c #8bc6ff",353 "#G c #8dc7ff",354 ".K c #8ebae8",355 "#S c #8ecbff",356 "#q c #91c8ff",357 "#M c #92ccff",358 "#v c #93ccff",359 ".k c #9494b0",360 "#r c #94caff",361 ".E c #96bde8",362 ".X c #96c3ee",363 "#w c #96cfff",364 "#B c #97cfff",365 ".Y c #99c4ee",366 "#x c #99d0ff",367 ".a c #9a9aa4",368 "#X c #9b9b9b",369 ".s c #9bbee8",370 ".R c #9bc4ee",371 ".T c #9cc5ee",372 ".Z c #9dc7ef",373 "#C c #9dd3ff",374 ".y c #9ec3e8",375 ".L c #9ec3ed",376 ".M c #9ec5ed",377 "#H c #9ed6ff",378 ".S c #9fc5ee",379 "#D c #a1d7ff",380 ".N c #a3c8ed",381 "#N c #a3daff",382 ".F c #a5c8ed",383 ".G c #a7c9ed",384 "#J c #a7ddff",385 "#I c #a7deff",386 ".H c #a8caee",387 "#T c #a8e0ff",388 "#0 c #a8e2e6",389 ".z c #a9caed",390 "#O c #abe3ff",391 ".A c #adcbed",392 "#P c #ade3ff",393 "#Q c #aeaeae",394 ".m c #afbbe7",395 ".B c #afccee",396 "#U c #b0e9ff",397 ".t c #b3d1ed",398 "#V c #b5ebff",399 ".u c #bad4ee",400 ".v c #bbd4ef",401 ".h c #bfc2e8",402 "#1 c #bffdff",403 "a# c #c6c6c6",404 "a. c #cbcbcb",405 ".n c #cbddf2",406 ".o c #cce0f3",407 ".p c #cfe1f4",408 "#W c #d1d1d1",409 "#9 c #d3d3d3",410 "#8 c #dcdcdc",411 "#2 c #e1e1e1",412 "#7 c #e3e3e3",413 "#6 c #e4e4e4",414 ".i c #e6e9f6",415 ".e c #e8e8e8",416 ".# c #e9e9e9",417 ".j c #e9edf8",418 "Qt c #ececec",419 "Qt.#.a.b.c.d",420 ".e.f.g.h.i.j",421 ".k.l.m.n.o.p",422 ".q.r.s.t.u.v",423 ".w.x.y.z.A.B",424 ".C.D.E.F.G.H",425 ".I.J.K.L.M.N",426 ".O.P.Q.R.S.T",427 ".U.V.W.X.Y.Z",428 ".0.1.2.3.4.5",429 ".6.7.8.9#.##",430 "#a#b#c#d#e#f",431 "#g#h#i#j#k#l",432 "#m#n#o#p#q#r",433 "#s#t#u#v#w#x",434 "#y#z#A#B#C#D",435 "#E#F#G#H#I#J",436 "#K#L#M#N#O#P",437 "#Q#R#S#T#U#V",438 "#W#X#Y#Z#0#1",439 "#2#W#Q#3#4#5",440 "#6#7#8#9a.a#"};441 442 static const char *const qt_mac_tabselected_active_mid[]={443 "6 22 23 1",444 ". c #00006d",445 "s c #585858",446 "h c #70adef",447 "i c #7bb5f5",448 "j c #83bcf9",449 "k c #8bc3ff",450 "l c #93c9ff",451 "m c #9ad1ff",452 "f c #9ec5ef",453 "g c #9ec7f0",454 "n c #a0d6ff",455 "e c #a2c7ed",456 "d c #a8caee",457 "o c #a8deff",458 "p c #ade2ff",459 "c c #afceee",460 "q c #b6ecff",461 "b c #bbd5f0",462 "r c #c1feff",463 "u c #c2c2c2",464 "t c #c3c3c3",465 "a c #cfe1f3",466 "# c #e9edf8",467 "......",468 "######",469 "aaaaaa",470 "bbbbbb",471 "cccccc",472 "dddddd",473 "eeeeee",474 "ffffff",475 "gggggg",476 "hhhhhh",477 "iiiiii",478 "jjjjjj",479 "kkkkkk",480 "llllll",481 "mmmmmm",482 "nnnnnn",483 "oooooo",484 "pppppp",485 "qqqqqq",486 "rrrrrr",487 "ssssss",488 "ttttuu"};489 490 static const char *const qt_mac_tabselected_active_right[]={491 "6 22 128 2",492 "Qt c #000069",493 ".G c #0042b4",494 ".M c #0157bb",495 ".A c #0c28a0",496 ".n c #101094",497 ".S c #1163c4",498 ".# c #1b1b6e",499 ".Y c #1e6ec9",500 ".t c #214eb7",501 ".z c #256cc9",502 ".4 c #2877ce",503 "#. c #347fd1",504 ".F c #3981d2",505 "#e c #3a81d2",506 "#k c #418ad7",507 ".L c #4288d4",508 ".u c #45459b",509 ".X c #458cd5",510 ".h c #46469f",511 ".R c #4a8dd7",512 ".3 c #4a90db",513 "#q c #4b91db",514 "#w c #4e91dc",515 "#C c #4f8dcd",516 ".9 c #5195df",517 ".a c #525280",518 "#I c #5984b2",519 "#T c #5b7d9f",520 "#d c #5b9be1",521 ".2 c #5d9de6",522 "#1 c #5f5f5f",523 "#Y c #627c8d",524 "#j c #65a4e7",525 ".1 c #65a6e8",526 ".8 c #67a6eb",527 "#p c #69a6e8",528 "#c c #6cabed",529 "#2 c #6d6d6d",530 ".0 c #6dacee",531 ".Z c #6eabee",532 "#O c #6f87a1",533 "#N c #70aff1",534 ".7 c #70aff2",535 "#v c #71aced",536 "#B c #72afee",537 "#H c #72afef",538 ".i c #757592",539 "#i c #75b3f4",540 "#b c #75b4f3",541 "#X c #77a6b3",542 ".6 c #77b1f4",543 ".5 c #7ab4f4",544 ".W c #7cb0e7",545 "#o c #7cb8f9",546 "## c #80bdf9",547 "#a c #81bbf9",548 "#h c #81bbfc",549 "#u c #86c1ff",550 "#3 c #888888",551 "#g c #89c2fd",552 "#A c #89c3ff",553 ".Q c #8bb9e8",554 "#f c #8bc4ff",555 "#n c #8bc6ff",556 "#G c #8dc7ff",557 ".K c #8ebae8",558 "#S c #8ecbff",559 "#m c #91c8ff",560 "#M c #92ccff",561 "#t c #93ccff",562 ".o c #9494b0",563 "#l c #94caff",564 ".E c #96bde8",565 ".V c #96c3ee",566 "#s c #96cfff",567 "#z c #97cfff",568 ".U c #99c4ee",569 "#r c #99d0ff",570 ".b c #9a9aa4",571 "#Z c #9b9b9b",572 ".s c #9bbee8",573 ".P c #9bc4ee",574 ".N c #9cc5ee",575 ".T c #9dc7ef",576 "#y c #9dd3ff",577 ".y c #9ec3e8",578 ".J c #9ec3ed",579 ".I c #9ec5ed",580 "#F c #9ed6ff",581 ".O c #9fc5ee",582 "#x c #a1d7ff",583 ".H c #a3c8ed",584 "#L c #a3daff",585 ".D c #a5c8ed",586 ".C c #a7c9ed",587 "#D c #a7ddff",588 "#E c #a7deff",589 ".B c #a8caee",590 "#R c #a8e0ff",591 "#W c #a8e2e6",592 ".x c #a9caed",593 "#K c #abe3ff",594 ".w c #adcbed",595 "#J c #ade3ff",596 "#U c #aeaeae",597 ".m c #afbbe7",598 ".v c #afccee",599 "#Q c #b0e9ff",600 ".r c #b3d1ed",601 "#P c #b5ebff",602 ".q c #bad4ee",603 ".p c #bbd4ef",604 ".g c #bfc2e8",605 "#V c #bffdff",606 "#5 c #c6c6c6",607 "#6 c #cacaca",608 ".l c #cbddf2",609 ".k c #cce0f3",610 ".j c #cfe1f4",611 "#0 c #d1d1d1",612 "#7 c #d3d3d3",613 "#8 c #dcdcdc",614 "#4 c #e2e2e2",615 "#9 c #e4e4e4",616 ".f c #e6e9f6",617 ".c c #e9e9e9",618 ".e c #e9edf8",619 ".d c #ececec",620 "Qt.#.a.b.c.d",621 ".e.f.g.h.i.c",622 ".j.k.l.m.n.o",623 ".p.q.r.s.t.u",624 ".v.w.x.y.z.A",625 ".B.C.D.E.F.G",626 ".H.I.J.K.L.M",627 ".N.O.P.Q.R.S",628 ".T.U.V.W.X.Y",629 ".Z.0.1.2.3.4",630 ".5.6.7.8.9#.",631 "###a#b#c#d#e",632 "#f#g#h#i#j#k",633 "#l#m#n#o#p#q",634 "#r#s#t#u#v#w",635 "#x#y#z#A#B#C",636 "#D#E#F#G#H#I",637 "#J#K#L#M#N#O",638 "#P#Q#R#S#T#U",639 "#V#W#X#Y#Z#0",640 "#1#2#3#U#0#4",641 "#5#6#7#8#9#9"};642 643 static const char *const qt_mac_tabselected_inactive_left[]={644 "6 22 64 1",645 "9 c #656565",646 "8 c #737373",647 "c c #767676",648 "b c #808080",649 "n c #818181",650 "q c #828282",651 "e c #888888",652 "7 c #8b8b8b",653 "u c #8d8d8d",654 "3 c #939393",655 "k c #979797",656 "0 c #989898",657 "j c #9b9b9b",658 "A c #9d9d9d",659 "a c #9e9e9e",660 "4 c #9f9f9f",661 "Y c #a3a3a3",662 "C c #a6a6a6",663 "E c #aaaaaa",664 "J c #aeaeae",665 "6 c #b0b0b0",666 "2 c #b1b1b1",667 "o c #b2b2b2",668 "f c #b3b3b3",669 "O c #b6b6b6",670 "Q c #b9b9b9",671 "S c #bbbbbb",672 "r c #bdbdbd",673 "U c #c0c0c0",674 "v c #c2c2c2",675 "B c #c3c3c3",676 "y c #c6c6c6",677 "F c #c7c7c7",678 "K c #cccccc",679 "G c #cdcdcd",680 "R c #cfcfcf",681 "T c #d1d1d1",682 "1 c #d2d2d2",683 "L c #d3d3d3",684 "H c #d5d5d5",685 "I c #d6d6d6",686 "W c #d7d7d7",687 "D c #d8d8d8",688 "N c #dadada",689 "M c #dcdcdc",690 "5 c #dddddd",691 "P c #dedede",692 "z c #dfdfdf",693 "s c #e0e0e0",694 "g c #e1e1e1",695 "p c #e2e2e2",696 "w c #e3e3e3",697 "x c #e4e4e4",698 "t c #e6e6e6",699 "l c #e7e7e7",700 "d c #e8e8e8",701 "# c #e9e9e9",702 "V c #eaeaea",703 "m c #ebebeb",704 ". c #ececec",705 "X c #ededed",706 "h c #f0f0f0",707 "i c #f1f1f1",708 "Z c #f2f2f2",709 ".#abcc",710 "defghi",711 "jklm..",712 "nopldd",713 "qrsttt",714 "uvswxx",715 "kyzpww",716 "ABzswp",717 "CBDsww",718 "EFGHII",719 "JKLIMN",720 "OGDzPz",721 "QRNpwp",722 "STzttl",723 "UIsdVV",724 "OWlVXX",725 "YItXZZ",726 "01mZZZ",727 "23.ZZZ",728 "T4uo5Z",729 "gT6789",730 "xwMLKF"};731 732 static const char *const qt_mac_tabselected_inactive_mid[]={733 "6 22 17 1",734 "m c #5f5f5f",735 ". c #787878",736 "o c #c3c3c3",737 "n c #c4c4c4",738 "g c #d5d5d5",739 "h c #dbdbdb",740 "i c #dedede",741 "f c #e2e2e2",742 "e c #e3e3e3",743 "d c #e4e4e4",744 "c c #e6e6e6",745 "b c #e8e8e8",746 "j c #eaeaea",747 "a c #ececec",748 "k c #ededed",749 "# c #f1f1f1",750 "l c #f2f2f2",751 "......",752 "######",753 "aaaaaa",754 "bbbbbb",755 "cccccc",756 "dddddd",757 "eeeeee",758 "ffffff",759 "eeeeee",760 "gggggg",761 "hhhhhh",762 "iiiiii",763 "eeeeee",764 "cccccc",765 "jjjjjj",766 "kkkkkk",767 "llllll",768 "llllll",769 "llllll",770 "llllll",771 "mmmmmm",772 "nnnnno"};773 774 static const char *const qt_mac_tabselected_inactive_right[]={775 "6 22 65 2",776 ".6 c #656565",777 ".7 c #737373",778 "Qt c #767676",779 ".# c #808080",780 ".p c #818181",781 ".t c #828282",782 ".h c #888888",783 ".8 c #8c8c8c",784 ".x c #8d8d8d",785 ".2 c #929292",786 ".k c #979797",787 ".1 c #989898",788 ".l c #9b9b9b",789 ".B c #9d9d9d",790 ".a c #9e9e9e",791 ".5 c #9f9f9f",792 ".Z c #a3a3a3",793 ".D c #a6a6a6",794 ".I c #aaaaaa",795 ".N c #aeaeae",796 ".9 c #b0b0b0",797 ".3 c #b1b1b1",798 ".o c #b2b2b2",799 ".g c #b3b3b3",800 ".P c #b6b6b6",801 ".R c #b9b9b9",802 ".T c #bbbbbb",803 ".s c #bdbdbd",804 ".V c #c0c0c0",805 ".w c #c2c2c2",806 ".A c #c3c3c3",807 ".z c #c6c6c6",808 ".H c #c7c7c7",809 "#. c #cbcbcb",810 ".M c #cccccc",811 ".G c #cdcdcd",812 ".Q c #cfcfcf",813 ".S c #d1d1d1",814 ".0 c #d2d2d2",815 ".L c #d3d3d3",816 ".F c #d5d5d5",817 ".E c #d6d6d6",818 ".X c #d7d7d7",819 ".C c #d8d8d8",820 ".J c #dadada",821 ".K c #dcdcdc",822 ".4 c #dddddd",823 ".O c #dedede",824 ".y c #dfdfdf",825 ".r c #e0e0e0",826 ".f c #e1e1e1",827 ".n c #e2e2e2",828 ".v c #e3e3e3",829 ".u c #e4e4e4",830 ".q c #e6e6e6",831 ".j c #e7e7e7",832 ".m c #e8e8e8",833 ".b c #e9e9e9",834 ".U c #eaeaea",835 ".i c #ebebeb",836 ".c c #ececec",837 ".W c #ededed",838 ".e c #f0f0f0",839 ".d c #f1f1f1",840 ".Y c #f2f2f2",841 "QtQt.#.a.b.c",842 ".d.e.f.g.h.b",843 ".c.c.i.j.k.l",844 ".m.m.j.n.o.p",845 ".q.q.q.r.s.t",846 ".u.u.v.r.w.x",847 ".v.v.n.y.z.k",848 ".n.v.r.y.A.B",849 ".v.v.r.C.A.D",850 ".E.E.F.G.H.I",851 ".J.K.E.L.M.N",852 ".y.O.y.C.G.P",853 ".n.v.n.J.Q.R",854 ".j.q.q.y.S.T",855 ".U.U.m.r.E.V",856 ".W.W.U.j.X.P",857 ".Y.Y.W.q.E.Z",858 ".Y.Y.Y.i.0.1",859 ".Y.Y.Y.c.2.3",860 ".Y.4.o.x.5.S",861 ".6.7.8.9.S.n",862 ".H#..L.K.u.u"};863 864 static const char * const qt_mac_tab_selected_active_graph_left[]={865 "6 22 126 2",866 ".d c #15283d",867 ".c c #283348",868 ".w c #374459",869 ".l c #435364",870 ".B c #465568",871 ".q c #4d5367",872 ".b c #525763",873 ".H c #536271",874 ".N c #5d6a79",875 "#1 c #5f5f5f",876 ".T c #647181",877 "#N c #656e77",878 ".r c #677282",879 "#B c #687380",880 "#U c #697077",881 ".Z c #6c7885",882 ".5 c #6c7988",883 "#0 c #6d6d6d",884 "#H c #6f767f",885 ".x c #727e8a",886 "## c #757f8d",887 ".f c #76767d",888 "#v c #76838f",889 "#e c #778292",890 "#k c #7b8694",891 ".U c #7b8794",892 ".C c #7b8795",893 ".O c #7c8893",894 ".I c #7d8896",895 ".g c #7e8895",896 ".0 c #7e8b99",897 "#q c #818c98",898 ".6 c #85909e",899 "#Z c #878787",900 "#a c #8a96a3",901 "#f c #8d99a7",902 ".1 c #8e99a6",903 "#V c #929ca5",904 "#l c #939daa",905 ".k c #949499",906 ".7 c #96a0ad",907 ".2 c #98a3af",908 "#r c #99a5b0",909 ".a c #9a9a9b",910 "#I c #9aa4b1",911 "#T c #9b9b9b",912 ".3 c #9ba6b1",913 "#b c #9ba6b3",914 ".8 c #9ca7b4",915 ".4 c #9da6b1",916 "#w c #9da7b5",917 "#C c #9ea9b5",918 ".V c #a0a9b4",919 "#g c #a0abb8",920 "#. c #a3acb8",921 ".9 c #a4adba",922 "#c c #a6afbc",923 "#m c #a8b1bd",924 "#d c #a9b3bf",925 ".J c #abb3bc",926 ".P c #adb4bb",927 "#h c #adb8c3",928 "#M c #aeaeae",929 "#j c #aeb8c4",930 ".W c #b0b8c2",931 "#i c #b0bac6",932 ".D c #b3bac3",933 "#x c #b3bcc8",934 "#n c #b3bdc9",935 ".Q c #b4bac2",936 "#D c #b5bfc9",937 ".y c #b6bdc5",938 "#o c #b6becb",939 "#s c #b7c2ce",940 ".K c #b8bdc6",941 ".X c #b8bfc8",942 "#p c #b8c1ce",943 ".S c #b9bec7",944 ".R c #b9bfc8",945 ".Y c #b9c1c7",946 ".M c #b9c1c8",947 "#J c #bac5cf",948 ".L c #bbbfc8",949 "#O c #bbc7d4",950 ".s c #bcc3ca",951 "#t c #bcc5d1",952 "#u c #bcc6d2",953 ".E c #bdc3ca",954 "#y c #bdc7d2",955 ".G c #bec3cb",956 ".F c #bec5cb",957 ".z c #c2c7ce",958 "#E c #c2cad6",959 ".A c #c3c9d0",960 "#z c #c3ccd7",961 "#A c #c3ced7",962 ".m c #c5c9d0",963 "#7 c #c6c6c6",964 "#K c #c7d2dd",965 ".t c #c8ced3",966 "#F c #c8d3de",967 "#G c #c9d3df",968 "#6 c #cbcbcb",969 ".u c #cbd1d6",970 ".v c #ccd2d7",971 ".h c #ced2d6",972 "#W c #ced8e4",973 "#L c #d0dae3",974 "#S c #d1d1d1",975 "#P c #d1dbe6",976 "#5 c #d3d3d3",977 ".n c #d5dadc",978 "#Q c #d5deea",979 ".o c #d7dbdf",980 "#R c #d7e1ec",981 ".p c #dadde0",982 "#4 c #dcdcdc",983 ".i c #e0e2e6",984 "#Y c #e1e1e1",985 "#3 c #e3e3e3",986 "#2 c #e4e4e4",987 ".j c #e6e8ea",988 ".e c #e8e8e8",989 ".# c #e9e9e9",990 "#X c #e9f4ff",991 "Qt c #ececec",992 "Qt.#.a.b.c.d",993 ".e.f.g.h.i.j",994 ".k.l.m.n.o.p",995 ".q.r.s.t.u.v",996 ".w.x.y.z.A.A",997 ".B.C.D.E.F.G",998 ".H.I.J.K.L.M",999 ".N.O.P.Q.R.S",1000 ".T.U.V.W.X.Y",1001 ".Z.0.1.2.3.4",1002 ".5.6.7.8.9#.",1003 "###a#b#c#d#d",1004 "#e#f#g#h#i#j",1005 "#k#l#m#n#o#p",1006 "#q#r#h#s#t#u",1007 "#v#w#x#y#z#A",1008 "#B#C#D#E#F#G",1009 "#H#I#J#K#L#L",1010 "#M#N#O#P#Q#R",1011 "#S#T#U#V#W#X",1012 "#Y#S#M#Z#0#1",1013 "#2#3#4#5#6#7"};1014 1015 static const char * const qt_mac_tab_selected_active_graph_mid[]={1016 "6 22 41 1",1017 ". c #15273d",1018 "# c #16283e",1019 "a c #17293e",1020 "b c #192a3f",1021 "c c #1a2b40",1022 "K c #585858",1023 "p c #9ea8b4",1024 "q c #a4adb9",1025 "r c #aab4bf",1026 "s c #afb9c6",1027 "o c #b6bcc6",1028 "n c #b8bec6",1029 "t c #b8c2ce",1030 "m c #bbc2c8",1031 "u c #bbc5d0",1032 "l c #bec4cb",1033 "v c #bfcad4",1034 "L c #c2c2c2",1035 "k c #c2c9ce",1036 "M c #c3c3c3",1037 "w c #c7d1dd",1038 "i c #cad0d5",1039 "j c #cbd0d5",1040 "x c #ccd5e1",1041 "y c #cdd6e2",1042 "z c #ced6e2",1043 "A c #d5dfeb",1044 "B c #d6e0ec",1045 "C c #d7e1ed",1046 "e c #d8dbe0",1047 "f c #d8dce0",1048 "g c #d9dce0",1049 "D c #d9e2ee",1050 "h c #dadce0",1051 "E c #dae2ef",1052 "d c #e7e9eb",1053 "J c #e9f2ff",1054 "I c #eaf3ff",1055 "H c #ebf5ff",1056 "G c #ecf6ff",1057 "F c #edf6ff",1058 "..#abc",1059 "dddddd",1060 "eeefgh",1061 "iiiiij",1062 "kkkkkk",1063 "llllll",1064 "mmmmmm",1065 "nnnnnn",1066 "oooooo",1067 "pppppp",1068 "qqqqqq",1069 "rrrrrr",1070 "ssssss",1071 "tttttt",1072 "uuuuuu",1073 "vvvvvv",1074 "wwwwww",1075 "xxxxyz",1076 "AABCDE",1077 "FFGHIJ",1078 "KKKKKK",1079 "LLLLMM"};1080 1081 static const char * const qt_mac_tab_selected_active_graph_right[]={1082 "6 22 124 2",1083 "Qt c #15283d",1084 ".# c #293448",1085 ".z c #374459",1086 ".n c #435364",1087 ".F c #465568",1088 ".u c #4d5367",1089 ".a c #525763",1090 ".L c #536271",1091 ".R c #5d6a79",1092 "#X c #5f5f5f",1093 "#P c #646d77",1094 ".X c #647181",1095 ".t c #677282",1096 "#F c #687380",1097 "#U c #697077",1098 ".3 c #6c7885",1099 ".9 c #6c7988",1100 "#Y c #6d6d6d",1101 "#K c #6f767f",1102 ".y c #727e8a",1103 "#c c #757f8d",1104 ".i c #76767d",1105 "#z c #76838f",1106 "#i c #778292",1107 "#o c #7b8694",1108 ".W c #7b8794",1109 ".E c #7b8795",1110 ".Q c #7c8893",1111 ".K c #7d8896",1112 ".h c #7e8895",1113 ".2 c #7e8b99",1114 "#t c #818c98",1115 ".8 c #85909e",1116 "#Z c #888888",1117 "#b c #8a96a3",1118 "#h c #8d99a7",1119 ".1 c #8e99a6",1120 "#T c #929ca5",1121 "#n c #939daa",1122 ".o c #949499",1123 ".7 c #96a0ad",1124 ".0 c #98a3af",1125 "#s c #99a5b0",1126 ".b c #9a9a9b",1127 "#J c #9aa4b1",1128 "#V c #9b9b9b",1129 ".Z c #9ba6b1",1130 "#a c #9ba6b3",1131 ".6 c #9ca7b4",1132 ".Y c #9da6b1",1133 "#y c #9da7b5",1134 "#E c #9ea9b5",1135 ".V c #a0a9b4",1136 "#g c #a0abb8",1137 ".4 c #a3acb8",1138 ".5 c #a4adba",1139 "## c #a6afbc",1140 "#m c #a8b1bd",1141 "#. c #a9b3bf",1142 ".J c #abb3bc",1143 ".P c #adb4bb",1144 "#f c #adb8c3",1145 "#Q c #aeaeae",1146 "#d c #aeb8c4",1147 ".U c #b0b8c2",1148 "#e c #b0bac6",1149 ".D c #b3bac3",1150 "#x c #b3bcc8",1151 "#l c #b3bdc9",1152 ".O c #b4bac2",1153 "#D c #b5bfc9",1154 ".x c #b6bdc5",1155 "#k c #b6becb",1156 "#r c #b7c2ce",1157 ".I c #b8bdc6",1158 ".T c #b8bfc8",1159 "#j c #b8c1ce",1160 ".M c #b9bec7",1161 ".N c #b9bfc8",1162 ".S c #b9c1c7",1163 ".G c #b9c1c8",1164 "#I c #bac5cf",1165 ".H c #bbbfc8",1166 "#O c #bbc7d4",1167 ".s c #bcc3ca",1168 "#q c #bcc5d1",1169 "#p c #bcc6d2",1170 ".C c #bdc3ca",1171 "#w c #bdc7d2",1172 ".A c #bec3cb",1173 ".B c #bec5cb",1174 ".w c #c2c7ce",1175 "#C c #c2cad6",1176 ".v c #c3c9d0",1177 "#v c #c3ccd7",1178 "#u c #c3ced7",1179 ".m c #c5c9d0",1180 "#1 c #c6c6c6",1181 "#H c #c7d2dd",1182 ".r c #c8ced3",1183 "#B c #c8d3de",1184 "#A c #c9d3df",1185 "#2 c #cacaca",1186 ".q c #cbd1d6",1187 ".p c #ccd2d7",1188 ".g c #ced2d6",1189 "#S c #ced8e4",1190 "#G c #d0dae3",1191 "#W c #d1d1d1",1192 "#N c #d1dbe6",1193 "#3 c #d3d3d3",1194 ".l c #d5dadc",1195 "#M c #d5deea",1196 ".k c #d7dbdf",1197 "#L c #d7e1ec",1198 ".j c #dadde0",1199 "#4 c #dcdcdc",1200 ".f c #e0e2e6",1201 "#0 c #e2e2e2",1202 "#5 c #e4e4e4",1203 ".e c #e6e8ea",1204 ".c c #e9e9e9",1205 "#R c #e9f4ff",1206 ".d c #ececec",1207 "Qt.#.a.b.c.d",1208 ".e.f.g.h.i.c",1209 ".j.k.l.m.n.o",1210 ".p.q.r.s.t.u",1211 ".v.v.w.x.y.z",1212 ".A.B.C.D.E.F",1213 ".G.H.I.J.K.L",1214 ".M.N.O.P.Q.R",1215 ".S.T.U.V.W.X",1216 ".Y.Z.0.1.2.3",1217 ".4.5.6.7.8.9",1218 "#.#.###a#b#c",1219 "#d#e#f#g#h#i",1220 "#j#k#l#m#n#o",1221 "#p#q#r#f#s#t",1222 "#u#v#w#x#y#z",1223 "#A#B#C#D#E#F",1224 "#G#G#H#I#J#K",1225 "#L#M#N#O#P#Q",1226 "#R#S#T#U#V#W",1227 "#X#Y#Z#Q#W#0",1228 "#1#2#3#4#5#5"};1229 1230 static const char * const qt_mac_tab_press_left[]={1231 "6 22 65 2",1232 ".8 c #5c5c5c",1233 ".c c #696969",1234 ".d c #6a6a6a",1235 ".b c #767676",1236 ".f c #7e7e7e",1237 ".t c #808080",1238 ".4 c #828282",1239 ".7 c #838383",1240 ".2 c #888888",1241 ".k c #8b8b8b",1242 ".0 c #8c8c8c",1243 ".z c #909090",1244 ".j c #919191",1245 ".a c #959595",1246 ".Y c #989898",1247 ".B c #999999",1248 ".D c #9e9e9e",1249 ".I c #a1a1a1",1250 ".n c #a6a6a6",1251 ".g c #a7a7a7",1252 ".6 c #a8a8a8",1253 ".O c #aaaaaa",1254 ".1 c #ababab",1255 ".R c #acacac",1256 ".T c #afafaf",1257 ".q c #b1b1b1",1258 ".V c #b3b3b3",1259 ".u c #b5b5b5",1260 ".A c #b6b6b6",1261 ".x c #bababa",1262 ".E c #bbbbbb",1263 "#. c #bebebe",1264 ".J c #bfbfbf",1265 ".F c #c0c0c0",1266 ".P c #c1c1c1",1267 ".S c #c3c3c3",1268 ".U c #c5c5c5",1269 ".K c #c6c6c6",1270 ".G c #c8c8c8",1271 ".H c #c9c9c9",1272 ".L c #cacaca",1273 ".X c #cbcbcb",1274 ".C c #cccccc",1275 ".3 c #cdcdcd",1276 ".N c #cecece",1277 ".M c #cfcfcf",1278 ".5 c #d0d0d0",1279 ".Q c #d1d1d1",1280 ".y c #d2d2d2",1281 ".r c #d4d4d4",1282 ".h c #d5d5d5",1283 ".o c #d6d6d6",1284 ".v c #d7d7d7",1285 ".w c #d8d8d8",1286 ".s c #d9d9d9",1287 ".l c #dadada",1288 ".p c #dbdbdb",1289 ".9 c #dcdcdc",1290 ".W c #dedede",1291 ".m c #dfdfdf",1292 ".e c #e0e0e0",1293 ".# c #e1e1e1",1294 ".i c #e3e3e3",1295 "Qt c #e4e4e4",1296 ".Z c #e6e6e6",1297 "Qt.#.a.b.c.d",1298 ".e.f.g.h.iQt",1299 ".j.k.l.m.e.e",1300 ".b.n.o.l.p.p",1301 ".b.q.r.s.s.s",1302 ".t.u.r.v.w.w",1303 ".k.x.y.o.v.v",1304 ".z.A.y.r.v.o",1305 ".B.A.C.r.v.v",1306 ".D.E.F.G.H.H",1307 ".I.J.K.L.M.N",1308 ".O.P.C.y.Q.y",1309 ".R.S.N.o.v.o",1310 ".T.U.y.s.s.l",1311 ".V.H.r.p.W.W",1312 ".O.X.l.W.#.#",1313 ".Y.L.s.#.Z.Z",1314 ".0.K.m.Z.Z.Z",1315 ".1.2.e.Z.Z.Z",1316 ".3.Y.4.n.5.Z",1317 ".s.H.6.7.d.8",1318 ".9.l.r.L.S#."};1319 1320 static const char * const qt_mac_tab_press_mid[]={1321 "7 22 19 1",1322 "o c #555555",1323 ". c #6b6b6b",1324 "p c #bbbbbb",1325 "q c #bcbcbc",1326 "g c #c8c8c8",1327 "h c #cecece",1328 "i c #d1d1d1",1329 "f c #d6d6d6",1330 "e c #d7d7d7",1331 "d c #d8d8d8",1332 "c c #d9d9d9",1333 "j c #dadada",1334 "b c #dbdbdb",1335 "k c #dedede",1336 "a c #e0e0e0",1337 "l c #e1e1e1",1338 "# c #e4e4e4",1339 "m c #e5e5e5",1340 "n c #e6e6e6",1341 ".......",1342 "#######",1343 "aaaaaaa",1344 "bbbbbbb",1345 "ccccccc",1346 "ddddddd",1347 "eeeeeee",1348 "fffffff",1349 "eeeeeee",1350 "ggggggg",1351 "hhhhhhh",1352 "iiiiiii",1353 "eeeeeee",1354 "jjjjjjj",1355 "kkkkkkk",1356 "lllllll",1357 "mmmmmmm",1358 "nnnnnnn",1359 "nnnnnnn",1360 "nnnnnnn",1361 "ooooooo",1362 "ppppqqq"};1363 1364 static const char * const qt_mac_tab_press_right[]={1365 "6 22 64 1",1366 "5 c #5c5c5c",1367 ". c #6a6a6a",1368 "# c #767676",1369 "g c #7e7e7e",1370 "v c #808080",1371 "3 c #828282",1372 "6 c #848484",1373 "0 c #888888",1374 "k c #8b8b8b",1375 "Z c #8c8c8c",1376 "z c #909090",1377 "l c #919191",1378 "a c #959595",1379 "Y c #989898",1380 "B c #999999",1381 "G c #9e9e9e",1382 "M c #a1a1a1",1383 "o c #a6a6a6",1384 "f c #a7a7a7",1385 "7 c #a8a8a8",1386 "P c #aaaaaa",1387 "1 c #ababab",1388 "R c #acacac",1389 "T c #afafaf",1390 "r c #b1b1b1",1391 "V c #b3b3b3",1392 "u c #b5b5b5",1393 "y c #b6b6b6",1394 "x c #bababa",1395 "F c #bbbbbb",1396 "8 c #bebebe",1397 "L c #bfbfbf",1398 "E c #c0c0c0",1399 "O c #c1c1c1",1400 "9 c #c2c2c2",1401 "Q c #c3c3c3",1402 "S c #c5c5c5",1403 "K c #c6c6c6",1404 "D c #c8c8c8",1405 "C c #c9c9c9",1406 "J c #cacaca",1407 "W c #cbcbcb",1408 "A c #cccccc",1409 "4 c #cdcdcd",1410 "H c #cecece",1411 "I c #cfcfcf",1412 "2 c #d0d0d0",1413 "N c #d1d1d1",1414 "w c #d2d2d2",1415 "q c #d4d4d4",1416 "e c #d5d5d5",1417 "n c #d6d6d6",1418 "t c #d7d7d7",1419 "s c #d8d8d8",1420 "p c #d9d9d9",1421 "j c #dadada",1422 "m c #dbdbdb",1423 "U c #dedede",1424 "i c #dfdfdf",1425 "h c #e0e0e0",1426 "b c #e1e1e1",1427 "d c #e3e3e3",1428 "c c #e4e4e4",1429 "X c #e6e6e6",1430 "..#abc",1431 "cdefgb",1432 "hhijkl",1433 "mmjno#",1434 "pppqr#",1435 "sstquv",1436 "ttnwxk",1437 "ntqwyz",1438 "ttqAyB",1439 "CCDEFG",1440 "HIJKLM",1441 "wNwAOP",1442 "ntnHQR",1443 "jppwST",1444 "UUmqCV",1445 "bbUjWP",1446 "XXbpJY",1447 "XXXiKZ",1448 "XXXh01",1449 "X2o3Y4",1450 "5.67Cj",1451 "89Jqmm"};1452 52 1453 53 static const char * const qt_mac_toolbar_ext[]={ -
trunk/src/gui/styles/qmotifstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 299 299 QCommonStyle::unpolish(widget); 300 300 #ifndef QT_NO_PROGRESSBAR 301 if (qobject_cast<QProgressBar *>(widget)) 301 if (qobject_cast<QProgressBar *>(widget)) { 302 Q_D(QMotifStyle); 302 303 widget->removeEventFilter(this); 304 d->bars.removeAll(static_cast<QProgressBar*>(widget)); 305 } 303 306 #endif 304 307 } … … 384 387 case PE_FrameTabWidget: 385 388 case PE_FrameWindow: 386 qDrawShadePanel(p, opt->rect, opt->palette, QStyle::State_None, p ixelMetric(PM_DefaultFrameWidth));389 qDrawShadePanel(p, opt->rect, opt->palette, QStyle::State_None, proxy()->pixelMetric(PM_DefaultFrameWidth)); 387 390 break; 388 391 case PE_FrameFocusRect: … … 473 476 if ((opt->state & State_Enabled || opt->state & State_On) || !(opt->state & State_AutoRaise)) 474 477 qDrawShadePanel(p, opt->rect, opt->palette, bool(opt->state & (State_Sunken | State_On)), 475 p ixelMetric(PM_DefaultFrameWidth), &fill);478 proxy()->pixelMetric(PM_DefaultFrameWidth), &fill); 476 479 break; } 477 480 … … 488 491 } else { 489 492 qDrawShadePanel(p, opt->rect, opt->palette, !showUp, 490 p ixelMetric(PM_DefaultFrameWidth), &fill);491 } 492 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))493 proxy()->pixelMetric(PM_DefaultFrameWidth), &fill); 494 } 495 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 493 496 p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 494 497 break; } … … 543 546 a.translate(opt->rect.x(), opt->rect.y()); 544 547 p->drawPolyline(a); 545 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))548 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 546 549 p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 547 550 p->setPen(oldPen); … … 734 737 #undef CTOP 735 738 #undef CBOT 736 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))739 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 737 740 p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 738 741 break; } … … 740 743 case PE_IndicatorDockWidgetResizeHandle: { 741 744 const int motifOffset = 10; 742 int sw = p ixelMetric(PM_SplitterWidth);745 int sw = proxy()->pixelMetric(PM_SplitterWidth); 743 746 if (opt->state & State_Horizontal) { 744 747 int yPos = opt->rect.y() + opt->rect.height() / 2; … … 767 770 int posX = opt->rect.x() + (opt->rect.width() - markW) / 2 - 1; 768 771 int posY = opt->rect.y() + (opt->rect.height() - markH) / 2; 769 int dfw = p ixelMetric(PM_DefaultFrameWidth);772 int dfw = proxy()->pixelMetric(PM_DefaultFrameWidth); 770 773 771 774 if (dfw < 2) { … … 841 844 else 842 845 handleOpt.state |= State_Horizontal; 843 drawPrimitive(PE_IndicatorDockWidgetResizeHandle, &handleOpt, p, widget);846 proxy()->drawPrimitive(PE_IndicatorDockWidgetResizeHandle, &handleOpt, p, widget); 844 847 break; } 845 848 … … 853 856 QStyleOption arrowOpt = *opt; 854 857 arrowOpt.state |= State_Enabled; 855 drawPrimitive(pe, &arrowOpt, p, widget);856 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText)) {857 int fw = p ixelMetric(PM_DefaultFrameWidth);858 proxy()->drawPrimitive(pe, &arrowOpt, p, widget); 859 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) { 860 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth); 858 861 p->fillRect(opt->rect.adjusted(fw, fw, -fw, -fw), QBrush(p->background().color(), Qt::Dense5Pattern)); 859 862 } … … 871 874 p->save(); 872 875 p->setBrushOrigin(bevelOpt.rect.topLeft()); 873 drawPrimitive(PE_PanelButtonBevel, &bevelOpt, p, widget);876 proxy()->drawPrimitive(PE_PanelButtonBevel, &bevelOpt, p, widget); 874 877 p->restore(); 875 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))878 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 876 879 p->fillRect(opt->rect, QBrush(p->background().color(), Qt::Dense5Pattern)); 877 880 break; } … … 884 887 subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator 885 888 : SE_CheckBoxIndicator, btn, widget); 886 drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox,889 proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, 887 890 &subopt, p, widget); 888 891 subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents 889 892 : SE_CheckBoxContents, btn, widget); 890 drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, p, widget);893 proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, p, widget); 891 894 if ((btn->state & State_HasFocus) && (!focus || !focus->isVisible())) { 892 895 QStyleOptionFocusRect fropt; … … 894 897 fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect 895 898 : SE_CheckBoxFocusRect, btn, widget); 896 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);899 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 897 900 } 898 901 } … … 900 903 case CE_PushButton: 901 904 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { 902 drawControl(CE_PushButtonBevel, btn, p, widget);905 proxy()->drawControl(CE_PushButtonBevel, btn, p, widget); 903 906 QStyleOptionButton subopt = *btn; 904 907 subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); 905 drawControl(CE_PushButtonLabel, &subopt, p, widget);908 proxy()->drawControl(CE_PushButtonLabel, &subopt, p, widget); 906 909 if ((btn->state & State_HasFocus) && (!focus || !focus->isVisible())) { 907 910 QStyleOptionFocusRect fropt; 908 911 fropt.QStyleOption::operator=(*btn); 909 912 fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget); 910 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);913 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 911 914 } 912 915 } … … 917 920 p->setPen(opt->palette.foreground().color()); 918 921 p->setBrush(QBrush(opt->palette.button().color(), Qt::NoBrush)); 919 diw = p ixelMetric(PM_ButtonDefaultIndicator);922 diw = proxy()->pixelMetric(PM_ButtonDefaultIndicator); 920 923 opt->rect.getCoords(&x1, &y1, &x2, &y2); 921 924 if (btn->features & (QStyleOptionButton::AutoDefaultButton|QStyleOptionButton::DefaultButton)) { … … 946 949 newOpt.rect = QRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1); 947 950 p->setBrushOrigin(p->brushOrigin()); 948 drawPrimitive(PE_PanelButtonCommand, &newOpt, p, widget);951 proxy()->drawPrimitive(PE_PanelButtonCommand, &newOpt, p, widget); 949 952 } 950 953 if (btn->features & QStyleOptionButton::HasMenu) { 951 int mbi = p ixelMetric(PM_MenuButtonIndicator, btn, widget);954 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, btn, widget); 952 955 QRect ir = btn->rect; 953 956 QStyleOptionButton newBtn = *btn; 954 957 newBtn.rect = QRect(ir.right() - mbi - 3, ir.y() + 4, mbi, ir.height() - 8); 955 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);958 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 956 959 } 957 960 break; … … 961 964 case CE_TabBarTabShape: 962 965 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { 963 const int default_frame = p ixelMetric(PM_DefaultFrameWidth, tab, widget);966 const int default_frame = proxy()->pixelMetric(PM_DefaultFrameWidth, tab, widget); 964 967 const int frame_offset = (default_frame > 1) ? 1 : 0; 965 968 … … 1079 1082 p->setTransform(m, true); 1080 1083 } 1081 const int unit_width = p ixelMetric(PM_ProgressBarChunkWidth, opt, widget);1084 const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, opt, widget); 1082 1085 int u = rect.width() / unit_width; 1083 1086 int p_v = pb->progress - pb->minimum; … … 1148 1151 p->setFont(menuitem->font); 1149 1152 p->fillRect(x, y, w, h, opt->palette.brush(QPalette::Button)); 1150 drawItemText(p, menuitem->rect.adjusted(10, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter,1153 proxy()->drawItemText(p, menuitem->rect.adjusted(10, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter, 1151 1154 menuitem->palette, menuitem->state & State_Enabled, menuitem->text, 1152 1155 QPalette::Text); 1153 1156 textWidth = menuitem->fontMetrics.width(menuitem->text) + 10; 1154 y += menuitem->fontMetrics. lineSpacing() / 2;1157 y += menuitem->fontMetrics.height() / 2; 1155 1158 p->setFont(oldFont); 1156 1159 } … … 1218 1221 if (menuitem->checkType & QStyleOptionMenuItem::Exclusive) { 1219 1222 newMenuItem.rect.setRect(xvis + 2, y + motifItemFrame + mh / 4, 11, 11); 1220 drawPrimitive(PE_IndicatorRadioButton, &newMenuItem, p, widget);1223 proxy()->drawPrimitive(PE_IndicatorRadioButton, &newMenuItem, p, widget); 1221 1224 } else { 1222 1225 newMenuItem.rect.setRect(xvis + 5, y + motifItemFrame + mh / 4, 9, 9); 1223 drawPrimitive(PE_IndicatorCheckBox, &newMenuItem, p, widget);1226 proxy()->drawPrimitive(PE_IndicatorCheckBox, &newMenuItem, p, widget); 1224 1227 } 1225 1228 } … … 1256 1259 QRect tr(xv, y+m, menuitem->tabWidth, h-2*m); 1257 1260 p->drawText(tr, text_flags, s.mid(t+1)); 1258 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))1261 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 1259 1262 p->fillRect(tr, QBrush(p->background().color(), Qt::Dense5Pattern)); 1260 1263 s = s.left(t); … … 1263 1266 p->drawText(tr, text_flags, s.left(t)); 1264 1267 p->setFont(oldFont); 1265 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))1268 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 1266 1269 p->fillRect(tr, QBrush(p->background().color(), Qt::Dense5Pattern)); 1267 1270 } … … 1277 1280 else 1278 1281 arrowOpt.state = ((opt->state & State_Enabled) ? State_Enabled : State_None); 1279 drawPrimitive(arrow, &arrowOpt, p, widget);1282 proxy()->drawPrimitive(arrow, &arrowOpt, p, widget); 1280 1283 } 1281 1284 break; } … … 1294 1297 p->setBrushOrigin(opt->rect.topLeft()); 1295 1298 qDrawShadePanel(p, opt->rect, opt->palette, bool(opt->state & (State_Sunken|State_On)), 1296 p ixelMetric(PM_DefaultFrameWidth),1299 proxy()->pixelMetric(PM_DefaultFrameWidth), 1297 1300 &opt->palette.brush((opt->state & State_Sunken) ? QPalette::Mid : QPalette::Button)); 1298 1301 p->restore(); … … 1429 1432 = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { 1430 1433 QRect button, menuarea; 1431 button = subControlRect(cc, toolbutton, SC_ToolButton, widget);1432 menuarea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget);1434 button = proxy()->subControlRect(cc, toolbutton, SC_ToolButton, widget); 1435 menuarea = proxy()->subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget); 1433 1436 1434 1437 State bflags = toolbutton->state & ~State_Sunken; … … 1451 1454 tool.rect = button; 1452 1455 tool.state = bflags; 1453 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);1456 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 1454 1457 } 1455 1458 } … … 1459 1462 fr.QStyleOption::operator=(*toolbutton); 1460 1463 fr.rect = toolbutton->rect.adjusted(3, 3, -3, -3); 1461 drawPrimitive(PE_FrameFocusRect, &fr, p, widget);1464 proxy()->drawPrimitive(PE_FrameFocusRect, &fr, p, widget); 1462 1465 } 1463 1466 QStyleOptionToolButton label = *toolbutton; 1464 1467 label.state = bflags; 1465 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);1468 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 1466 1469 label.rect = button.adjusted(fw, fw, -fw, -fw); 1467 drawControl(CE_ToolButtonLabel, &label, p, widget);1470 proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget); 1468 1471 1469 1472 if (toolbutton->subControls & SC_ToolButtonMenu) { … … 1471 1474 tool.state = mflags; 1472 1475 if (mflags & (State_Sunken | State_On | State_Raised)) 1473 drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget);1474 drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget);1476 proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget); 1477 proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget); 1475 1478 } else if (toolbutton->features & QStyleOptionToolButton::HasMenu) { 1476 int mbi = p ixelMetric(PM_MenuButtonIndicator, toolbutton, widget);1479 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, widget); 1477 1480 QRect ir = toolbutton->rect; 1478 1481 QStyleOptionToolButton newBtn = *toolbutton; 1479 1482 newBtn.rect = QRect(ir.right() + 5 - mbi, ir.height() - mbi + 4, mbi - 6, mbi - 6); 1480 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);1483 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 1481 1484 } 1482 1485 } … … 1489 1492 1490 1493 if (spinbox->frame && (spinbox->subControls & SC_SpinBoxFrame)) { 1491 QRect r = subControlRect(CC_SpinBox, spinbox, SC_SpinBoxFrame, widget);1492 qDrawShadePanel(p, r, opt->palette, false, p ixelMetric(PM_SpinBoxFrameWidth));1493 1494 int fw = p ixelMetric(QStyle::PM_DefaultFrameWidth);1495 r = subControlRect(CC_SpinBox, spinbox, SC_SpinBoxEditField, widget).adjusted(-fw,-fw,fw,fw);1494 QRect r = proxy()->subControlRect(CC_SpinBox, spinbox, SC_SpinBoxFrame, widget); 1495 qDrawShadePanel(p, r, opt->palette, false, proxy()->pixelMetric(PM_SpinBoxFrameWidth)); 1496 1497 int fw = proxy()->pixelMetric(QStyle::PM_DefaultFrameWidth); 1498 r = proxy()->subControlRect(CC_SpinBox, spinbox, SC_SpinBoxEditField, widget).adjusted(-fw,-fw,fw,fw); 1496 1499 QStyleOptionFrame lineOpt; 1497 1500 lineOpt.QStyleOption::operator=(*opt); … … 1500 1503 lineOpt.midLineWidth = 0; 1501 1504 lineOpt.state |= QStyle::State_Sunken; 1502 drawPrimitive(QStyle::PE_FrameLineEdit, &lineOpt, p, widget);1505 proxy()->drawPrimitive(QStyle::PE_FrameLineEdit, &lineOpt, p, widget); 1503 1506 } 1504 1507 … … 1523 1526 : PE_IndicatorSpinUp); 1524 1527 1525 copy.rect = subControlRect(CC_SpinBox, spinbox, SC_SpinBoxUp, widget);1526 drawPrimitive(pe, ©, p, widget);1528 copy.rect = proxy()->subControlRect(CC_SpinBox, spinbox, SC_SpinBoxUp, widget); 1529 proxy()->drawPrimitive(pe, ©, p, widget); 1527 1530 } 1528 1531 … … 1547 1550 : PE_IndicatorSpinDown); 1548 1551 1549 copy.rect = subControlRect(CC_SpinBox, spinbox, SC_SpinBoxDown, widget);1550 drawPrimitive(pe, ©, p, widget);1552 copy.rect = proxy()->subControlRect(CC_SpinBox, spinbox, SC_SpinBoxDown, widget); 1553 proxy()->drawPrimitive(pe, ©, p, widget); 1551 1554 } 1552 1555 } … … 1556 1559 case CC_Slider: 1557 1560 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 1558 QRect groove = subControlRect(CC_Slider, opt, SC_SliderGroove, widget),1559 handle = subControlRect(CC_Slider, opt, SC_SliderHandle, widget);1561 QRect groove = proxy()->subControlRect(CC_Slider, opt, SC_SliderGroove, widget), 1562 handle = proxy()->subControlRect(CC_Slider, opt, SC_SliderHandle, widget); 1560 1563 1561 1564 if ((opt->subControls & SC_SliderGroove) && groove.isValid()) { 1562 qDrawShadePanel(p, groove, opt->palette, true, p ixelMetric(PM_DefaultFrameWidth),1565 qDrawShadePanel(p, groove, opt->palette, true, proxy()->pixelMetric(PM_DefaultFrameWidth), 1563 1566 &opt->palette.brush((opt->state & State_Enabled) ? QPalette::Mid : QPalette::Window)); 1564 1567 if ((opt->state & State_HasFocus) && (!focus || !focus->isVisible())) { 1565 1568 QStyleOption focusOpt = *opt; 1566 1569 focusOpt.rect = subElementRect(SE_SliderFocusRect, opt, widget); 1567 drawPrimitive(PE_FrameFocusRect, &focusOpt, p, widget);1570 proxy()->drawPrimitive(PE_FrameFocusRect, &focusOpt, p, widget); 1568 1571 } 1569 1572 } … … 1575 1578 p->save(); 1576 1579 p->setBrushOrigin(bevelOpt.rect.topLeft()); 1577 drawPrimitive(PE_PanelButtonBevel, &bevelOpt, p, widget);1580 proxy()->drawPrimitive(PE_PanelButtonBevel, &bevelOpt, p, widget); 1578 1581 p->restore(); 1579 1582 … … 1587 1590 true, 1); 1588 1591 } 1589 if (!(opt->state & State_Enabled) && styleHint(SH_DitherDisabledText))1592 if (!(opt->state & State_Enabled) && proxy()->styleHint(SH_DitherDisabledText)) 1590 1593 p->fillRect(handle, QBrush(p->background().color(), Qt::Dense5Pattern)); 1591 1594 } … … 1594 1597 QStyleOptionSlider tmpSlider = *slider; 1595 1598 tmpSlider.subControls = SC_SliderTickmarks; 1596 int frameWidth = p ixelMetric(PM_DefaultFrameWidth);1599 int frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth); 1597 1600 tmpSlider.rect.translate(frameWidth - 1, 0); 1598 1601 QCommonStyle::drawComplexControl(cc, &tmpSlider, p, widget); … … 1605 1608 if (opt->subControls & SC_ComboBoxArrow) { 1606 1609 int awh, ax, ay, sh, sy, dh, ew; 1607 int fw = cb->frame ? p ixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0;1610 int fw = cb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0; 1608 1611 1609 1612 if (cb->frame) { … … 1611 1614 btn.QStyleOption::operator=(*cb); 1612 1615 btn.state |= QStyle::State_Raised; 1613 drawPrimitive(PE_PanelButtonCommand, &btn, p, widget);1616 proxy()->drawPrimitive(PE_PanelButtonCommand, &btn, p, widget); 1614 1617 } else { 1615 1618 p->fillRect(opt->rect, opt->palette.brush(QPalette::Button)); … … 1625 1628 arrowOpt.rect = ar; 1626 1629 arrowOpt.state |= State_Enabled; 1627 drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);1630 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); 1628 1631 1629 1632 … … 1641 1644 focus.rect = subElementRect(SE_ComboBoxFocusRect, opt, widget); 1642 1645 focus.backgroundColor = opt->palette.button().color(); 1643 drawPrimitive(PE_FrameFocusRect, &focus, p, widget);1646 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); 1644 1647 } 1645 1648 } … … 1647 1650 if (opt->subControls & SC_ComboBoxEditField) { 1648 1651 if (cb->editable) { 1649 QRect er = subControlRect(CC_ComboBox, opt, SC_ComboBoxEditField, widget);1652 QRect er = proxy()->subControlRect(CC_ComboBox, opt, SC_ComboBoxEditField, widget); 1650 1653 er.adjust(-1, -1, 1, 1); 1651 1654 qDrawShadePanel(p, er, opt->palette, true, 1, … … 1661 1664 if (opt->subControls & SC_ScrollBarGroove) 1662 1665 qDrawShadePanel(p, opt->rect, opt->palette, true, 1663 p ixelMetric(PM_DefaultFrameWidth, opt, widget),1666 proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget), 1664 1667 &opt->palette.brush((opt->state & State_Enabled) ? QPalette::Mid : QPalette::Window)); 1665 1668 … … 1796 1799 1797 1800 case PM_ToolBarFrameWidth: 1798 ret = p ixelMetric(PM_DefaultFrameWidth);1801 ret = proxy()->pixelMetric(PM_DefaultFrameWidth); 1799 1802 break; 1800 1803 … … 1817 1820 1818 1821 case PM_SliderThickness: 1819 ret = 16 + 4 * p ixelMetric(PM_DefaultFrameWidth);1822 ret = 16 + 4 * proxy()->pixelMetric(PM_DefaultFrameWidth); 1820 1823 break; 1821 1824 #ifndef QT_NO_SLIDER … … 1847 1850 if (const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 1848 1851 if (sl->orientation == Qt::Horizontal) 1849 ret = sl->rect.width() - p ixelMetric(PM_SliderLength, opt, widget) - 2 *pixelMetric(PM_DefaultFrameWidth, opt, widget);1852 ret = sl->rect.width() - proxy()->pixelMetric(PM_SliderLength, opt, widget) - 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 1850 1853 else 1851 ret = sl->rect.height() - p ixelMetric(PM_SliderLength, opt, widget) - 2 *pixelMetric(PM_DefaultFrameWidth, opt, widget);1854 ret = sl->rect.height() - proxy()->pixelMetric(PM_SliderLength, opt, widget) - 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 1852 1855 } 1853 1856 break; … … 1899 1902 case CC_SpinBox: 1900 1903 if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { 1901 int fw = spinbox->frame ? p ixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;1904 int fw = spinbox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; 1902 1905 QSize bs; 1903 1906 bs.setHeight(opt->rect.height()/2 - fw); … … 1942 1945 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 1943 1946 if (sc == SC_SliderHandle) { 1944 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, opt, widget);1945 int thickness = p ixelMetric(PM_SliderControlThickness, opt, widget);1947 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, opt, widget); 1948 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, opt, widget); 1946 1949 bool horizontal = slider->orientation == Qt::Horizontal; 1947 int len = p ixelMetric(PM_SliderLength, opt, widget);1948 int motifBorder = p ixelMetric(PM_DefaultFrameWidth);1950 int len = proxy()->pixelMetric(PM_SliderLength, opt, widget); 1951 int motifBorder = proxy()->pixelMetric(PM_DefaultFrameWidth); 1949 1952 int sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, slider->sliderPosition, 1950 1953 horizontal ? slider->rect.width() - len - 2 * motifBorder … … 1965 1968 case CC_ScrollBar: 1966 1969 if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 1967 int dfw = p ixelMetric(PM_DefaultFrameWidth);1970 int dfw = proxy()->pixelMetric(PM_DefaultFrameWidth); 1968 1971 QRect rect = visualRect(scrollbar->direction, scrollbar->rect, 1969 1972 QCommonStyle::subControlRect(cc, scrollbar, sc, widget)); … … 1989 1992 case SC_ComboBoxArrow: { 1990 1993 int ew, awh, sh, dh, ax, ay, sy; 1991 int fw = cb->frame ? p ixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0;1994 int fw = cb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0; 1992 1995 QRect cr = opt->rect; 1993 1996 cr.adjust(fw, fw, -fw, -fw); … … 1997 2000 1998 2001 case SC_ComboBoxEditField: { 1999 int fw = cb->frame ? p ixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0;2002 int fw = cb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) : 0; 2000 2003 QRect rect = opt->rect; 2001 2004 rect.adjust(fw, fw, -fw, -fw); … … 2027 2030 2028 2031 switch(ct) { 2029 case CT_Splitter:2030 sz = QSize(10, 10);2031 break;2032 2033 2032 case CT_RadioButton: 2034 2033 case CT_CheckBox: … … 2058 2057 if (mi->menuItemType == QStyleOptionMenuItem::Separator) { 2059 2058 w = 10; 2060 h = (mi->text.isEmpty()) ? motifSepHeight : mi->fontMetrics. lineSpacing();2059 h = (mi->text.isEmpty()) ? motifSepHeight : mi->fontMetrics.height(); 2061 2060 } 2062 2061 … … 2117 2116 { 2118 2117 int awh, ax, ay, sh, sy, dh, ew; 2119 int fw = p ixelMetric(PM_DefaultFrameWidth, opt, widget);2118 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget); 2120 2119 QRect tr = opt->rect; 2121 2120 … … 2685 2684 ret = '*'; 2686 2685 break; 2686 case SH_DialogButtonBox_ButtonsHaveIcons: 2687 ret = 0; 2688 break; 2687 2689 default: 2688 2690 ret = QCommonStyle::styleHint(hint, opt, widget, returnData); -
trunk/src/gui/styles/qmotifstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qmotifstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qplastiquestyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 #if !defined(QT_NO_STYLE_PLASTIQUE) || defined(QT_PLUGIN) 45 45 46 static bool UsePixmapCache = true;47 46 static const bool AnimateBusyProgressBar = true; 48 47 static const bool AnimateProgressBar = false; … … 52 51 53 52 #include "qwindowsstyle_p.h" 53 #include <private/qstylehelper_p.h> 54 54 #include <qapplication.h> 55 55 #include <qbitmap.h> … … 99 99 static const int windowsArrowHMargin = 6; // arrow horizontal margin 100 100 static const int windowsTabSpacing = 12; // space between text and tab 101 static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark102 101 static const int windowsRightBorder = 15; // right border on windows 103 102 static const int windowsCheckMarkWidth = 12; // checkmarks width on windows … … 491 490 QPixmap pixmap; 492 491 QString name = QString::fromLatin1("qbrushtexture-alpha-%1-%2").arg(alpha).arg(texture.cacheKey()); 493 if ( UsePixmapCache &&!QPixmapCache::find(name, pixmap)) {492 if (!QPixmapCache::find(name, pixmap)) { 494 493 QImage image = texture.toImage(); 495 494 QRgb *rgb = reinterpret_cast<QRgb *>(image.bits()); … … 552 551 QPixmap pixmap; 553 552 QString name = QString::fromLatin1("qbrushtexture-light-%1-%2").arg(light).arg(texture.cacheKey()); 554 if ( UsePixmapCache &&!QPixmapCache::find(name, pixmap)) {553 if (!QPixmapCache::find(name, pixmap)) { 555 554 QImage image = texture.toImage(); 556 555 QRgb *rgb = reinterpret_cast<QRgb *>(image.bits()); … … 611 610 QPixmap pixmap; 612 611 QString name = QString::fromLatin1("qbrushtexture-dark-%1-%2").arg(dark).arg(brush.texture().cacheKey()); 613 if ( UsePixmapCache &&!QPixmapCache::find(name, pixmap)) {612 if (!QPixmapCache::find(name, pixmap)) { 614 613 QImage image = texture.toImage(); 615 614 QRgb *rgb = reinterpret_cast<QRgb *>(image.bits()); … … 731 730 } 732 731 733 static QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)734 {735 QString tmp;736 const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);737 tmp.sprintf("%s-%d-%d-%d-%lld-%dx%d", key.toLatin1().constData(), uint(option->state),738 option->direction, complexOption ? uint(complexOption->activeSubControls) : uint(0),739 option->palette.cacheKey(), size.width(), size.height());740 return tmp;741 }742 743 732 static void qt_plastique_draw_gradient(QPainter *painter, const QRect &rect, const QColor &gradientStart, 744 733 const QColor &gradientStop) … … 750 739 QRect r = rect; 751 740 752 bool doPixmapCache = UsePixmapCache 753 && painter->deviceTransform().isIdentity() 741 bool doPixmapCache = painter->deviceTransform().isIdentity() 754 742 && painter->worldMatrix().isIdentity(); 755 743 if (doPixmapCache && QPixmapCache::find(gradientName, cache)) { … … 1006 994 #endif 1007 995 { 1008 if (!qgetenv("QT_STYLE_NO_PIXMAPCACHE").isNull())1009 UsePixmapCache = false;1010 996 } 1011 997 … … 1071 1057 frameOpt.lineWidth = q->pixelMetric(QStyle::PM_DefaultFrameWidth); 1072 1058 frameOpt.midLineWidth = 0; 1073 frameOpt.state |= QStyle::State_Sunken; 1059 frameOpt.state = option->state | QStyle::State_Sunken; 1060 frameOpt.palette = option->palette; 1074 1061 q->drawPrimitive(QStyle::PE_PanelLineEdit, &frameOpt, painter, widget); 1075 1062 painter->restore(); … … 1108 1095 QColor gradientStartColor = option->palette.button().color().lighter(104); 1109 1096 QColor gradientStopColor = option->palette.button().color().darker(105); 1110 QColor baseGradientStartColor = option->palette.base().color().darker(101);1111 QColor baseGradientStopColor = option->palette.base().color().darker(106);1112 1097 QColor highlightedGradientStartColor = option->palette.button().color().lighter(101); 1113 1098 QColor highlightedGradientStopColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 85); … … 1133 1118 switch (element) { 1134 1119 case PE_IndicatorButtonDropDown: 1135 drawPrimitive(PE_PanelButtonTool, option, painter, widget);1120 proxy()->drawPrimitive(PE_PanelButtonTool, option, painter, widget); 1136 1121 break; 1137 1122 case PE_FrameDefaultButton: { … … 1179 1164 } 1180 1165 1181 int borderThickness = p ixelMetric(PM_TabBarBaseOverlap, twf, widget);1166 int borderThickness = proxy()->pixelMetric(PM_TabBarBaseOverlap, twf, widget); 1182 1167 bool reverse = (twf->direction == Qt::RightToLeft); 1183 1168 … … 1358 1343 } else { 1359 1344 frameV2.state &= ~(State_Sunken | State_HasFocus); 1360 drawPrimitive(PE_Frame, &frameV2, painter, widget);1345 proxy()->drawPrimitive(PE_Frame, &frameV2, painter, widget); 1361 1346 } 1362 1347 } … … 1516 1501 } 1517 1502 #endif 1518 QString pixmapName = uniqueName(QLatin1String("toolbarhandle"), option, rect.size());1519 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {1503 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("toolbarhandle"), option, rect.size()); 1504 if (!QPixmapCache::find(pixmapName, cache)) { 1520 1505 cache = QPixmap(rect.size()); 1521 1506 cache.fill(Qt::transparent); … … 1547 1532 } 1548 1533 cachePainter.end(); 1549 if (UsePixmapCache) 1550 QPixmapCache::insert(pixmapName, cache); 1534 QPixmapCache::insert(pixmapName, cache); 1551 1535 } 1552 1536 painter->drawPixmap(rect.topLeft(), cache); … … 1858 1842 button.QStyleOption::operator=(*option); 1859 1843 button.state &= ~State_MouseOver; 1860 drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget);1844 proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget); 1861 1845 break; 1862 1846 } … … 1864 1848 painter->save(); 1865 1849 bool active = (option->state & State_Active); 1866 int titleBarStop = option->rect.top() + p ixelMetric(PM_TitleBarHeight, option, widget);1850 int titleBarStop = option->rect.top() + proxy()->pixelMetric(PM_TitleBarHeight, option, widget); 1867 1851 1868 1852 QPalette palette = option->palette; … … 1993 1977 adjustedRect.right() - adjustedRect.left() - 1, 1994 1978 adjustedRect.bottom() - adjustedRect.top() - 1); 1995 qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); 1979 if (option->palette.base().style() == Qt::SolidPattern) { 1980 QColor baseGradientStartColor = option->palette.base().color().darker(101); 1981 QColor baseGradientStopColor = option->palette.base().color().darker(106); 1982 qt_plastique_draw_gradient(painter, gradientRect, baseGradientStartColor, baseGradientStopColor); 1983 } else { 1984 painter->fillRect(gradientRect, option->palette.base()); 1985 } 1996 1986 // draw "+" or "-" 1997 1987 painter->setPen(alphaTextColor); … … 2074 2064 bool reverseShadow = false; 2075 2065 2076 int borderThickness = p ixelMetric(PM_TabBarBaseOverlap, tab, widget);2066 int borderThickness = proxy()->pixelMetric(PM_TabBarBaseOverlap, tab, widget); 2077 2067 int marginLeft = 0; 2078 2068 if ((atBeginning && !selected) || (selected && leftCornerWidget && ((tab->position == QStyleOptionTab::Beginning) || onlyTab))) { … … 2586 2576 } 2587 2577 2588 double vc6_workaround = ((bar->progress - qint64(bar->minimum)) / qMax(double(1.0), double(qint64(bar->maximum) - qint64(bar->minimum))) * rect.width()); 2589 int progressIndicatorPos = int(vc6_workaround); 2578 int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) / qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum) * rect.width(); 2590 2579 2591 2580 bool flip = (!vertical && (((bar->direction == Qt::RightToLeft) && !inverted) … … 2647 2636 if (vertical) { 2648 2637 rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height 2649 QTransform m; 2650 m.translate(rect.height()-1, 0); 2638 QTransform m = QTransform::fromTranslate(rect.height()-1, 0); 2651 2639 m.rotate(90.0); 2652 2640 painter->setTransform(m, true); … … 2783 2771 painter->setPen(QPen()); 2784 2772 2785 QString progressBarName = uniqueName(QLatin1String("progressBarContents"),2773 QString progressBarName = QStyleHelper::uniqueName(QLatin1String("progressBarContents"), 2786 2774 option, rect.size()); 2787 2775 QPixmap cache; 2788 if ( (!UsePixmapCache || !QPixmapCache::find(progressBarName, cache)) && rect.height() > 7) {2776 if (!QPixmapCache::find(progressBarName, cache) && rect.height() > 7) { 2789 2777 QSize size = rect.size(); 2790 2778 cache = QPixmap(QSize(size.width() - 6 + 30, size.height() - 6)); … … 2819 2807 } 2820 2808 2821 if (UsePixmapCache) 2822 QPixmapCache::insert(progressBarName, cache); 2809 QPixmapCache::insert(progressBarName, cache); 2823 2810 } 2824 2811 painter->setClipRect(progressBar.adjusted(1, 0, -1, -1)); … … 2844 2831 if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { 2845 2832 QPixmap cache; 2846 QString pixmapName = uniqueName(QLatin1String("headersection"), option, option->rect.size());2847 pixmapName += Q Latin1String("-") + QString::number(int(header->position));2848 pixmapName += Q Latin1String("-") + QString::number(int(header->orientation));2849 2850 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {2833 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("headersection"), option, option->rect.size()); 2834 pixmapName += QString::number(- int(header->position)); 2835 pixmapName += QString::number(- int(header->orientation)); 2836 2837 if (!QPixmapCache::find(pixmapName, cache)) { 2851 2838 cache = QPixmap(option->rect.size()); 2852 2839 cache.fill(Qt::white); … … 2892 2879 2893 2880 cachePainter.end(); 2894 if (UsePixmapCache) 2895 QPixmapCache::insert(pixmapName, cache); 2881 QPixmapCache::insert(pixmapName, cache); 2896 2882 } 2897 2883 painter->drawPixmap(option->rect.topLeft(), cache); … … 2916 2902 if (!menuItem->text.isEmpty()) { 2917 2903 painter->setFont(menuItem->font); 2918 drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter,2904 proxy()->drawItemText(painter, menuItem->rect.adjusted(5, 0, -5, 0), Qt::AlignLeft | Qt::AlignVCenter, 2919 2905 menuItem->palette, menuItem->state & State_Enabled, menuItem->text, 2920 2906 QPalette::Text); … … 2959 2945 button.state |= State_On; 2960 2946 button.palette = menuItem->palette; 2961 drawPrimitive(PE_IndicatorRadioButton, &button, painter, widget);2947 proxy()->drawPrimitive(PE_IndicatorRadioButton, &button, painter, widget); 2962 2948 } else { 2963 2949 if (menuItem->icon.isNull()) { … … 2968 2954 button.state |= State_On; 2969 2955 button.palette = menuItem->palette; 2970 drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget);2956 proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, painter, widget); 2971 2957 } else if (checked) { 2972 2958 int iconSize = qMax(menuItem->maxIconWidth, 20); … … 3080 3066 else 3081 3067 newMI.palette.setColor(QPalette::ButtonText, textBrush.color()); 3082 drawPrimitive(arrow, &newMI, painter, widget);3068 proxy()->drawPrimitive(arrow, &newMI, painter, widget); 3083 3069 } 3084 3070 … … 3092 3078 if ((option->state & State_Selected)) { 3093 3079 QPixmap cache; 3094 QString pixmapName = uniqueName(QLatin1String("menubaritem"), option, option->rect.size());3095 if (! UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) {3080 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("menubaritem"), option, option->rect.size()); 3081 if (!QPixmapCache::find(pixmapName, cache)) { 3096 3082 cache = QPixmap(option->rect.size()); 3097 3083 cache.fill(Qt::white); … … 3143 3129 cachePainter.drawLines(lines, 2); 3144 3130 cachePainter.end(); 3145 if (UsePixmapCache) 3146 QPixmapCache::insert(pixmapName, cache); 3131 QPixmapCache::insert(pixmapName, cache); 3147 3132 } 3148 3133 painter->drawPixmap(option->rect.topLeft(), cache); … … 3329 3314 // Draw the text centered 3330 3315 QFont font = painter->font(); 3331 font.setPointSize( font.pointSize() - 1);3316 font.setPointSize(QFontInfo(font).pointSize() - 1); 3332 3317 painter->setFont(font); 3333 3318 painter->setPen(dockWidget->palette.windowText().color()); … … 3456 3441 bool sunken = scrollBar->state & State_Sunken; 3457 3442 3458 QString addLinePixmapName = uniqueName(QLatin1String("scrollbar_addline"), option, option->rect.size());3443 QString addLinePixmapName = QStyleHelper::uniqueName(QLatin1String("scrollbar_addline"), option, option->rect.size()); 3459 3444 QPixmap cache; 3460 if (! UsePixmapCache || !QPixmapCache::find(addLinePixmapName, cache)) {3445 if (!QPixmapCache::find(addLinePixmapName, cache)) { 3461 3446 cache = QPixmap(option->rect.size()); 3462 3447 cache.fill(Qt::white); … … 3517 3502 } 3518 3503 addLinePainter.end(); 3519 if (UsePixmapCache) 3520 QPixmapCache::insert(addLinePixmapName, cache); 3504 QPixmapCache::insert(addLinePixmapName, cache); 3521 3505 } 3522 3506 painter->drawPixmap(option->rect.topLeft(), cache); … … 3529 3513 bool horizontal = scrollBar->orientation == Qt::Horizontal; 3530 3514 3531 QString groovePixmapName = uniqueName(QLatin1String("scrollbar_groove"), option, option->rect.size());3515 QString groovePixmapName = QStyleHelper::uniqueName(QLatin1String("scrollbar_groove"), option, option->rect.size()); 3532 3516 if (sunken) 3533 3517 groovePixmapName += QLatin1String("-sunken"); … … 3536 3520 3537 3521 QPixmap cache; 3538 if (! UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) {3522 if (!QPixmapCache::find(groovePixmapName, cache)) { 3539 3523 cache = QPixmap(option->rect.size()); 3540 3524 cache.fill(option->palette.background().color()); … … 3562 3546 3563 3547 groovePainter.end(); 3564 if (UsePixmapCache) 3565 QPixmapCache::insert(groovePixmapName, cache); 3548 QPixmapCache::insert(groovePixmapName, cache); 3566 3549 } 3567 3550 painter->drawPixmap(option->rect.topLeft(), cache); … … 3580 3563 QRect button1; 3581 3564 QRect button2; 3582 int scrollBarExtent = p ixelMetric(PM_ScrollBarExtent, option, widget);3565 int scrollBarExtent = proxy()->pixelMetric(PM_ScrollBarExtent, option, widget); 3583 3566 if (horizontal) { 3584 3567 button1.setRect(scrollBarSubLine.left(), scrollBarSubLine.top(), scrollBarExtent, scrollBarSubLine.height()); … … 3589 3572 } 3590 3573 3591 QString subLinePixmapName = uniqueName(QLatin1String("scrollbar_subline"), option, button1.size());3574 QString subLinePixmapName = QStyleHelper::uniqueName(QLatin1String("scrollbar_subline"), option, button1.size()); 3592 3575 QPixmap cache; 3593 if (! UsePixmapCache || !QPixmapCache::find(subLinePixmapName, cache)) {3576 if (!QPixmapCache::find(subLinePixmapName, cache)) { 3594 3577 cache = QPixmap(button1.size()); 3595 3578 cache.fill(Qt::white); … … 3651 3634 } 3652 3635 subLinePainter.end(); 3653 if (UsePixmapCache) 3654 QPixmapCache::insert(subLinePixmapName, cache); 3636 QPixmapCache::insert(subLinePixmapName, cache); 3655 3637 } 3656 3638 painter->drawPixmap(button1.topLeft(), cache); … … 3665 3647 // The slider 3666 3648 if (option->rect.isValid()) { 3667 QString sliderPixmapName = uniqueName(QLatin1String("scrollbar_slider"), option, option->rect.size());3649 QString sliderPixmapName = QStyleHelper::uniqueName(QLatin1String("scrollbar_slider"), option, option->rect.size()); 3668 3650 if (horizontal) 3669 3651 sliderPixmapName += QLatin1String("-horizontal"); 3670 3652 3671 3653 QPixmap cache; 3672 if (! UsePixmapCache || !QPixmapCache::find(sliderPixmapName, cache)) {3654 if (!QPixmapCache::find(sliderPixmapName, cache)) { 3673 3655 cache = QPixmap(option->rect.size()); 3674 3656 cache.fill(Qt::white); … … 3721 3703 sliderPainter.drawLines(lines, 2); 3722 3704 3723 int sliderMinLength = p ixelMetric(PM_ScrollBarSliderMin, scrollBar, widget);3705 int sliderMinLength = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollBar, widget); 3724 3706 if ((horizontal && scrollBar->rect.width() > sliderMinLength) 3725 3707 || (!horizontal && scrollBar->rect.height() > sliderMinLength)) { … … 3741 3723 sliderPainter.end(); 3742 3724 // insert the slider into the cache 3743 if (UsePixmapCache) 3744 QPixmapCache::insert(sliderPixmapName, cache); 3725 QPixmapCache::insert(sliderPixmapName, cache); 3745 3726 } 3746 3727 painter->drawPixmap(option->rect.topLeft(), cache); … … 3761 3742 } else if (!comboBox->currentIcon.isNull()) { 3762 3743 { 3763 QRect editRect = subControlRect(CC_ComboBox, comboBox, SC_ComboBoxEditField, widget);3744 QRect editRect = proxy()->subControlRect(CC_ComboBox, comboBox, SC_ComboBoxEditField, widget); 3764 3745 if (comboBox->direction == Qt::RightToLeft) 3765 3746 editRect.adjust(0, 2, -2, -2); … … 3774 3755 QRect iconRect(editRect); 3775 3756 iconRect.setWidth(comboBox->iconSize.width() + 5); 3776 iconRect = alignedRect( QApplication::layoutDirection(),3757 iconRect = alignedRect(comboBox->direction, 3777 3758 Qt::AlignLeft | Qt::AlignVCenter, 3778 3759 iconRect.size(), editRect); 3779 3760 painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); 3780 drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap);3761 proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); 3781 3762 } 3782 3763 painter->restore(); … … 3821 3802 case CC_Slider: 3822 3803 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 3823 QRect grooveRegion = subControlRect(CC_Slider, option, SC_SliderGroove, widget);3824 QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget);3825 QRect ticks = subControlRect(CC_Slider, option, SC_SliderTickmarks, widget);3804 QRect grooveRegion = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); 3805 QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); 3806 QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); 3826 3807 bool horizontal = slider->orientation == Qt::Horizontal; 3827 3808 bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; … … 3886 3867 3887 3868 if ((option->subControls & SC_SliderHandle) && handle.isValid()) { 3888 QString handlePixmapName = uniqueName(QLatin1String("slider_handle"), option, handle.size());3869 QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); 3889 3870 if (ticksAbove && !ticksBelow) 3890 3871 handlePixmapName += QLatin1String("-flipped"); … … 3892 3873 handlePixmapName += QLatin1String("-sunken"); 3893 3874 3894 if (! UsePixmapCache || !QPixmapCache::find(handlePixmapName, cache)) {3875 if (!QPixmapCache::find(handlePixmapName, cache)) { 3895 3876 cache = QPixmap(handle.size()); 3896 3877 cache.fill(Qt::white); … … 3975 3956 handlePainter.drawImage(pixmapRect, image); 3976 3957 handlePainter.end(); 3977 if (UsePixmapCache) 3978 QPixmapCache::insert(handlePixmapName, cache); 3958 QPixmapCache::insert(handlePixmapName, cache); 3979 3959 } 3980 3960 … … 3985 3965 fropt.QStyleOption::operator=(*slider); 3986 3966 fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); 3987 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);3967 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 3988 3968 } 3989 3969 } … … 3992 3972 QPen oldPen = painter->pen(); 3993 3973 painter->setPen(borderColor); 3994 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);3995 int available = p ixelMetric(PM_SliderSpaceAvailable, slider, widget);3974 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 3975 int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); 3996 3976 int interval = slider->tickInterval; 3997 3977 if (interval <= 0) { … … 4007 3987 4008 3988 int v = slider->minimum; 4009 int len = p ixelMetric(PM_SliderLength, slider, widget);3989 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 4010 3990 QVarLengthArray<QLine, 32> lines; 4011 3991 while (v <= slider->maximum + 1) { … … 4062 4042 4063 4043 // Rects 4064 QRect upRect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);4065 QRect downRect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);4044 QRect upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); 4045 QRect downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); 4066 4046 QRect buttonRect = upRect | downRect; 4067 4047 … … 4084 4064 d->drawPartialFrame(painter, 4085 4065 option, 4086 subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget),4066 proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget), 4087 4067 widget); 4088 4068 } … … 4424 4404 d->drawPartialFrame(painter, 4425 4405 option, 4426 subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget),4406 proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget), 4427 4407 widget); 4428 4408 … … 4548 4528 buttonOption.state &= ~State_Sunken; 4549 4529 } 4550 drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget);4530 proxy()->drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget); 4551 4531 4552 4532 // Draw the menu button separator line … … 4581 4561 4582 4562 // Draw the focus rect 4583 if (((option->state & State_HasFocus) && (option->state & State_KeyboardFocusChange)) && !comboBox->editable) { 4563 if ((option->state & State_HasFocus) && !comboBox->editable 4564 && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) { 4584 4565 QStyleOptionFocusRect focus; 4585 focus.rect = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget)4566 focus.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget) 4586 4567 .adjusted(-2, 0, 2, 0); 4587 drawPrimitive(PE_FrameFocusRect, &focus, painter, widget);4568 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, painter, widget); 4588 4569 } 4589 4570 … … 4615 4596 dockwidget.QStyleOption::operator=(*option); 4616 4597 dockwidget.title = titleBar->text; 4617 drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget);4598 proxy()->drawControl(CE_DockWidgetTitle, &dockwidget, painter, widget); 4618 4599 } else 4619 4600 #endif // QT3_SUPPORT … … 4688 4669 } 4689 4670 // draw title 4690 QRect textRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget);4671 QRect textRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget); 4691 4672 4692 4673 QFont font = painter->font(); … … 4715 4696 bool sunken = (titleBar->activeSubControls & SC_TitleBarMinButton) && (titleBar->state & State_Sunken); 4716 4697 4717 QRect minButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget);4698 QRect minButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget); 4718 4699 qt_plastique_draw_mdibutton(painter, titleBar, minButtonRect, hover, sunken); 4719 4700 … … 4759 4740 bool sunken = (titleBar->activeSubControls & SC_TitleBarMaxButton) && (titleBar->state & State_Sunken); 4760 4741 4761 QRect maxButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget);4742 QRect maxButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget); 4762 4743 qt_plastique_draw_mdibutton(painter, titleBar, maxButtonRect, hover, sunken); 4763 4744 … … 4784 4765 bool sunken = (titleBar->activeSubControls & SC_TitleBarCloseButton) && (titleBar->state & State_Sunken); 4785 4766 4786 QRect closeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget);4767 QRect closeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget); 4787 4768 qt_plastique_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken); 4788 4769 … … 4830 4811 bool sunken = (titleBar->activeSubControls & SC_TitleBarNormalButton) && (titleBar->state & State_Sunken); 4831 4812 4832 QRect normalButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget);4813 QRect normalButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget); 4833 4814 qt_plastique_draw_mdibutton(painter, titleBar, normalButtonRect, hover, sunken); 4834 4815 int xoffset = int(normalButtonRect.width() / 3.5); … … 4876 4857 bool sunken = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_Sunken); 4877 4858 4878 QRect contextHelpButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget);4859 QRect contextHelpButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget); 4879 4860 4880 4861 qt_plastique_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); … … 4903 4884 bool sunken = (titleBar->activeSubControls & SC_TitleBarShadeButton) && (titleBar->state & State_Sunken); 4904 4885 4905 QRect shadeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget);4886 QRect shadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget); 4906 4887 qt_plastique_draw_mdibutton(painter, titleBar, shadeButtonRect, hover, sunken); 4907 4888 … … 4927 4908 bool sunken = (titleBar->activeSubControls & SC_TitleBarUnshadeButton) && (titleBar->state & State_Sunken); 4928 4909 4929 QRect unshadeButtonRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget);4910 QRect unshadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget); 4930 4911 qt_plastique_draw_mdibutton(painter, titleBar, unshadeButtonRect, hover, sunken); 4931 4912 … … 4952 4933 bool sunken = (titleBar->activeSubControls & SC_TitleBarSysMenu) && (titleBar->state & State_Sunken); 4953 4934 4954 QRect iconRect = subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget);4935 QRect iconRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget); 4955 4936 if (hover) 4956 4937 qt_plastique_draw_mdibutton(painter, titleBar, iconRect, hover, sunken); … … 4964 4945 tool.rect = iconRect; 4965 4946 painter->save(); 4966 drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm);4947 proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm); 4967 4948 painter->restore(); 4968 4949 } … … 4971 4952 } 4972 4953 break; 4954 #ifndef QT_NO_DIAL 4955 case CC_Dial: 4956 if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option)) 4957 QStyleHelper::drawDial(dial, painter); 4958 break; 4959 #endif // QT_NO_DIAL 4973 4960 default: 4974 4961 QWindowsStyle::drawComplexControl(control, option, painter, widget); … … 4993 4980 case CT_Slider: 4994 4981 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 4995 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);4982 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 4996 4983 if (slider->tickPosition & QSlider::TicksBelow) { 4997 4984 if (slider->orientation == Qt::Horizontal) … … 5012 4999 case CT_ScrollBar: 5013 5000 if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 5014 int scrollBarExtent = p ixelMetric(PM_ScrollBarExtent, option, widget);5015 int scrollBarSliderMinimum = p ixelMetric(PM_ScrollBarSliderMin, option, widget);5001 int scrollBarExtent = proxy()->pixelMetric(PM_ScrollBarExtent, option, widget); 5002 int scrollBarSliderMinimum = proxy()->pixelMetric(PM_ScrollBarSliderMin, option, widget); 5016 5003 if (scrollBar->orientation == Qt::Horizontal) { 5017 5004 newSize = QSize(scrollBarExtent * 3 + scrollBarSliderMinimum, scrollBarExtent); … … 5045 5032 if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { 5046 5033 if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) 5047 newSize.setHeight(menuItem->text.isEmpty() ? 2 : menuItem->fontMetrics. lineSpacing());5034 newSize.setHeight(menuItem->text.isEmpty() ? 2 : menuItem->fontMetrics.height()); 5048 5035 } 5049 5036 break; … … 5094 5081 case CC_Slider: 5095 5082 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 5096 int tickSize = p ixelMetric(PM_SliderTickmarkOffset, option, widget);5083 int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); 5097 5084 5098 5085 switch (subControl) { … … 5147 5134 case CC_ScrollBar: 5148 5135 if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 5149 int scrollBarExtent = p ixelMetric(PM_ScrollBarExtent, scrollBar, widget);5136 int scrollBarExtent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollBar, widget); 5150 5137 int sliderMaxLength = ((scrollBar->orientation == Qt::Horizontal) ? 5151 5138 scrollBar->rect.width() : scrollBar->rect.height()) - (scrollBarExtent * 3); 5152 int sliderMinLength = p ixelMetric(PM_ScrollBarSliderMin, scrollBar, widget);5139 int sliderMinLength = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollBar, widget); 5153 5140 int sliderLength; 5154 5141 … … 5272 5259 case SC_ComboBoxEditField: { 5273 5260 if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { 5274 int frameWidth = p ixelMetric(PM_DefaultFrameWidth);5261 int frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth); 5275 5262 rect = visualRect(option->direction, option->rect, rect); 5276 5263 … … 5454 5441 ret = 96; // from Plastik 5455 5442 break; 5443 #ifdef Q_WS_X11 5444 case SH_DialogButtonBox_ButtonsHaveIcons: 5445 ret = true; 5446 break; 5447 #endif 5448 #ifndef Q_OS_WIN 5449 case SH_Menu_AllowActiveAndDisabled: 5450 ret = false; 5451 break; 5452 #endif 5456 5453 default: 5457 5454 ret = QWindowsStyle::styleHint(hint, option, widget, returnData); … … 5472 5469 case CC_ScrollBar: 5473 5470 if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 5474 QRect slider = subControlRect(control, scrollBar, SC_ScrollBarSlider, widget);5471 QRect slider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); 5475 5472 if (slider.contains(pos)) { 5476 5473 ret = SC_ScrollBarSlider; … … 5478 5475 } 5479 5476 5480 QRect scrollBarAddLine = subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget);5477 QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); 5481 5478 if (scrollBarAddLine.contains(pos)) { 5482 5479 ret = SC_ScrollBarAddLine; … … 5484 5481 } 5485 5482 5486 QRect scrollBarSubPage = subControlRect(control, scrollBar, SC_ScrollBarSubPage, widget);5483 QRect scrollBarSubPage = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubPage, widget); 5487 5484 if (scrollBarSubPage.contains(pos)) { 5488 5485 ret = SC_ScrollBarSubPage; … … 5490 5487 } 5491 5488 5492 QRect scrollBarAddPage = subControlRect(control, scrollBar, SC_ScrollBarAddPage, widget);5489 QRect scrollBarAddPage = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddPage, widget); 5493 5490 if (scrollBarAddPage.contains(pos)) { 5494 5491 ret = SC_ScrollBarAddPage; … … 5496 5493 } 5497 5494 5498 QRect scrollBarSubLine = subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget);5495 QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); 5499 5496 if (scrollBarSubLine.contains(pos)) { 5500 5497 ret = SC_ScrollBarSubLine; … … 5522 5519 ret = 0; 5523 5520 break; 5524 case PM_ToolBarIconSize:5525 ret = 24;5526 break;5527 5521 case PM_ButtonShiftHorizontal: 5528 5522 case PM_ButtonShiftVertical: … … 5615 5609 if (widget && widget->inherits("Q3DockWindowTitleBar")) { 5616 5610 // Q3DockWindow has smaller title bars than QDockWidget 5617 ret = qMax(widget->fontMetrics(). lineSpacing(), 20);5611 ret = qMax(widget->fontMetrics().height(), 20); 5618 5612 } else 5619 5613 #endif 5620 ret = qMax(widget ? widget->fontMetrics(). lineSpacing() :5621 (option ? option->fontMetrics. lineSpacing() : 0), 30);5614 ret = qMax(widget ? widget->fontMetrics().height() : 5615 (option ? option->fontMetrics.height() : 0), 30); 5622 5616 break; 5623 5617 case PM_MaximumDragDistance: -
trunk/src/gui/styles/qplastiquestyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 169 169 \section1 Creating a Custom Style 170 170 171 If you want to design a custom look and feel for your application, 172 the first step is to pick one of the styles provided with Qt to 173 build your custom style from. The choice will depend on which 174 existing style resembles your style the most. The most general 175 class that you can use as base is QCommonStyle (and not QStyle). 176 This is because Qt requires its styles to be \l{QCommonStyle}s. 171 You can create a custom look and feel for your application by 172 creating a custom style. There are two approaches to creating a 173 custom style. In the static approach, you either choose an 174 existing QStyle class, subclass it, and reimplement virtual 175 functions to provide the custom behavior, or you create an entire 176 QStyle class from scratch. In the dynamic approach, you modify the 177 behavior of your system style at runtime. The static approach is 178 described below. The dynamic approach is described in QProxyStyle. 179 180 The first step in the static approach is to pick one of the styles 181 provided by Qt from which you will build your custom style. Your 182 choice of QStyle class will depend on which style resembles your 183 desired style the most. The most general class that you can use as 184 a base is QCommonStyle (not QStyle). This is because Qt requires 185 its styles to be \l{QCommonStyle}s. 177 186 178 187 Depending on which parts of the base style you want to change, … … 223 232 224 233 There are several ways of using a custom style in a Qt 225 application. The simplest way is callthe234 application. The simplest way is to pass the custom style to the 226 235 QApplication::setStyle() static function before creating the 227 236 QApplication object: … … 233 242 set using the \c -style command-line option, is respected. 234 243 235 You may want to make your style available for use in other236 applications, some of which may not be yours and are not available for244 You may want to make your custom style available for use in other 245 applications, which may not be yours and hence not available for 237 246 you to recompile. The Qt Plugin system makes it possible to create 238 247 styles as plugins. Styles created as plugins are loaded as shared … … 326 335 : QObject(*new QStylePrivate) 327 336 { 328 } 329 337 Q_D(QStyle); 338 d->proxyStyle = this; 339 } 330 340 331 341 /*! … … 337 347 : QObject(dd) 338 348 { 349 Q_D(QStyle); 350 d->proxyStyle = this; 339 351 } 340 352 … … 452 464 if (!text.isEmpty()) { 453 465 result = metrics.boundingRect(x, y, w, h, alignment, text); 454 if (!enabled && styleHint(SH_EtchDisabledText)) {466 if (!enabled && proxy()->styleHint(SH_EtchDisabledText)) { 455 467 result.setWidth(result.width()+1); 456 468 result.setHeight(result.height()+1); … … 514 526 } 515 527 if (!enabled) { 516 if (styleHint(SH_DitherDisabledText)) { 517 painter->drawText(rect, alignment, text); 518 painter->fillRect(painter->boundingRect(rect, alignment, text), QBrush(painter->background().color(), Qt::Dense5Pattern)); 528 if (proxy()->styleHint(SH_DitherDisabledText)) { 529 QRect br; 530 painter->drawText(rect, alignment, text, &br); 531 painter->fillRect(br, QBrush(painter->background().color(), Qt::Dense5Pattern)); 519 532 return; 520 } else if ( styleHint(SH_EtchDisabledText)) {533 } else if (proxy()->styleHint(SH_EtchDisabledText)) { 521 534 QPen pen = painter->pen(); 522 535 painter->setPen(pal.light().color()); … … 552 565 \enum QStyle::PrimitiveElement 553 566 554 This enum describes th atvarious primitive elements. A567 This enum describes the various primitive elements. A 555 568 primitive element is a common GUI element, such as a checkbox 556 569 indicator or button bevel. … … 1049 1062 \value SE_TabBarTabText Area for the text on a tab in a tab bar. 1050 1063 1064 \value SE_ToolBarHandle Area for the handle of a tool bar. 1065 1051 1066 \sa subElementRect() 1052 1067 */ … … 1094 1109 \value CC_Slider A slider, like QSlider. 1095 1110 \value CC_ToolButton A tool button, like QToolButton. 1096 \value CC_TitleBar A Title bar, like those used in Q Workspace.1111 \value CC_TitleBar A Title bar, like those used in QMdiSubWindow. 1097 1112 \value CC_Q3ListView Used for drawing the Q3ListView class. 1098 1113 \value CC_GroupBox A group box, like QGroupBox. … … 1178 1193 \value SC_All Special value that matches all sub-controls. 1179 1194 \omitvalue SC_Q3ListViewBranch 1195 \omitvalue SC_CustomBase 1180 1196 1181 1197 \sa ComplexControl … … 1331 1347 1332 1348 \value PM_MaximumDragDistance The maximum allowed distance between 1333 the mouse and a s lider when dragging. Exceeding the specified1349 the mouse and a scrollbar when dragging. Exceeding the specified 1334 1350 distance will cause the slider to jump back to the original 1335 1351 position; a value of -1 disables this behavior. … … 1571 1587 1572 1588 /*! 1589 \enum QStyle::RequestSoftwareInputPanel 1590 1591 This enum describes under what circumstances a software input panel will be 1592 requested by input capable widgets. 1593 1594 \value RSIP_OnMouseClickAndAlreadyFocused Requests an input panel if the user 1595 clicks on the widget, but only if it is already focused. 1596 \value RSIP_OnMouseClick Requests an input panel if the user clicks on the 1597 widget. 1598 1599 \sa QEvent::RequestSoftwareInputPanel, QInputContext 1600 */ 1601 1602 /*! 1573 1603 \enum QStyle::StyleHint 1574 1604 … … 1851 1881 \value SH_DockWidget_ButtonsHaveFrame Determines if dockwidget buttons should have frames. Default is true. 1852 1882 1883 \value SH_ToolButtonStyle Determines the default system style for tool buttons that uses Qt::ToolButtonFollowStyle. 1884 1885 \value SH_RequestSoftwareInputPanel Determines when a software input panel should 1886 be requested by input widgets. Returns an enum of type QStyle::RequestSoftwareInputPanel. 1887 1853 1888 \omitvalue SH_UnderlineAccelerator 1854 1889 … … 1863 1898 the given \a widget described by the provided style \a option. 1864 1899 1865 Note that currently, the \a returnData and \a widget parameters 1866 are not used; they are provided for future enhancement. In 1867 addition, the \a option parameter is used only in case of the 1868 SH_ComboBox_Popup, SH_ComboBox_LayoutDirection, and 1869 SH_GroupBox_TextLabelColor style hints. 1900 \a returnData is used when the querying widget needs more detailed data than 1901 the integer that styleHint() returns. See the QStyleHintReturn class 1902 description for details. 1870 1903 */ 1871 1904 … … 1877 1910 1878 1911 \value SP_TitleBarMinButton Minimize button on title bars (e.g., 1879 in Q Workspace).1912 in QMdiSubWindow). 1880 1913 \value SP_TitleBarMenuButton Menu button on a title bar. 1881 1914 \value SP_TitleBarMaxButton Maximize button on title bars. … … 1949 1982 custom values must be greater than this value. 1950 1983 1951 \sa standardPixmap() standardIcon() 1952 */ 1953 1954 /*### 1955 \enum QStyle::IconMode 1956 1957 This enum represents the effects performed on a pixmap to achieve a 1958 GUI style's perferred way of representing the image in different 1959 states. 1960 1961 \value IM_Disabled A disabled pixmap (drawn on disabled widgets) 1962 \value IM_Active An active pixmap (drawn on active tool buttons and menu items) 1963 \value IM_CustomBase Base value for custom PixmapTypes; custom 1964 values must be greater than this value 1965 1966 \sa generatedIconPixmap() 1984 \sa standardIcon() 1967 1985 */ 1968 1986 … … 2247 2265 dynamically detect the slot and call it. 2248 2266 2249 \sa standardIconImplementation() , standardPixmap()2267 \sa standardIconImplementation() 2250 2268 */ 2251 2269 QIcon QStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, … … 2272 2290 standardIcon() function (introduced in Qt 4.1) is not 2273 2291 virtual. Instead, standardIcon() will dynamically detect and call 2274 \e this slot. The default implementation simply calls the 2275 standardPixmap() function with the given parameters. 2292 \e this slot. 2276 2293 2277 2294 The \a standardIcon is a standard pixmap which can follow some … … 2401 2418 } 2402 2419 2403 #if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)2404 2420 QT_BEGIN_INCLUDE_NAMESPACE 2405 2421 #include <QDebug> … … 2408 2424 QDebug operator<<(QDebug debug, QStyle::State state) 2409 2425 { 2426 #if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) 2410 2427 debug << "QStyle::State("; 2411 2428 … … 2438 2455 qSort(states); 2439 2456 debug << states.join(QLatin1String(" | ")); 2440 debug << ")"; 2457 debug << ')'; 2458 #endif 2441 2459 return debug; 2442 2460 } 2443 #endif 2461 2462 /*! 2463 \since 4.6 2464 2465 \fn const QStyle *QStyle::proxy() const 2466 2467 This function returns the current proxy for this style. 2468 By default most styles will return themselves. However 2469 when a proxy style is in use, it will allow the style to 2470 call back into its proxy. 2471 */ 2472 const QStyle * QStyle::proxy() const 2473 { 2474 Q_D(const QStyle); 2475 return d->proxyStyle; 2476 } 2477 2478 /* \internal 2479 2480 This function sets the base style that style calls will be 2481 redirected to. Note that ownership is not transferred. 2482 */ 2483 void QStyle::setProxy(QStyle *style) 2484 { 2485 Q_D(QStyle); 2486 d->proxyStyle = style; 2487 } 2444 2488 2445 2489 QT_END_NAMESPACE -
trunk/src/gui/styles/qstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 374 374 SE_ShapedFrameContents, 375 375 376 SE_ToolBarHandle, 377 376 378 // do not add any values below/greater than this 377 379 SE_CustomBase = 0xf0000000 … … 454 456 SC_MdiCloseButton = 0x00000004, 455 457 458 SC_CustomBase = 0xf0000000, 456 459 SC_All = 0xffffffff 457 460 }; … … 629 632 virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, 630 633 const QSize &contentsSize, const QWidget *w = 0) const = 0; 634 635 enum RequestSoftwareInputPanel { 636 RSIP_OnMouseClickAndAlreadyFocused, 637 RSIP_OnMouseClick 638 }; 631 639 632 640 enum StyleHint { … … 728 736 SH_TabBar_CloseButtonPosition, 729 737 SH_DockWidget_ButtonsHaveFrame, 730 738 SH_ToolButtonStyle, 739 SH_RequestSoftwareInputPanel, 731 740 // Add new style hint values here 732 741 … … 846 855 QStyleOption *option = 0, QWidget *widget = 0) const; 847 856 857 const QStyle * proxy() const; 858 848 859 protected Q_SLOTS: 849 860 QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0, … … 860 871 friend class QWidgetPrivate; 861 872 friend class QApplication; 873 friend class QProxyStyle; 874 friend class QProxyStylePrivate; 875 void setProxy(QStyle *style); 862 876 }; 863 877 … … 865 879 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls) 866 880 867 #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DEBUG)868 881 Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state); 869 #endif870 882 871 883 QT_END_NAMESPACE -
trunk/src/gui/styles/qstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 45 45 #include "private/qobject_p.h" 46 #include "private/qstylehelper_p.h" 47 #include <QtGui/qstyle.h> 46 48 47 49 QT_BEGIN_NAMESPACE … … 52 54 // 53 55 // This file is not part of the Qt API. It exists for the convenience 54 // of q application_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header55 // file may change from version to versionwithout notice, or even be removed.56 // of qstyle_*.cpp. This header file may change from version to version 57 // without notice, or even be removed. 56 58 // 57 59 // We mean it. … … 60 62 // Private class 61 63 64 class QStyle; 65 62 66 class QStylePrivate: public QObjectPrivate 63 67 { … … 65 69 public: 66 70 inline QStylePrivate() 67 : layoutSpacingIndex(-1) 68 { } 71 : layoutSpacingIndex(-1), proxyStyle(0) {} 69 72 mutable int layoutSpacingIndex; 73 QStyle *proxyStyle; 70 74 }; 71 75 … … 76 80 QImage imageCache; \ 77 81 QPainter *p = painter; \ 78 QString unique = uniqueName((a), option, option->rect.size()); \82 QString unique = QStyleHelper::uniqueName((a), option, option->rect.size()); \ 79 83 int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \ 80 bool doPixmapCache = UsePixmapCache &&txType <= QTransform::TxTranslate; \84 bool doPixmapCache = txType <= QTransform::TxTranslate; \ 81 85 if (doPixmapCache && QPixmapCache::find(unique, internalPixmapCache)) { \ 82 86 painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \ … … 88 92 p = new QPainter(&imageCache); \ 89 93 } 94 90 95 91 96 -
trunk/src/gui/styles/qstylefactory.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 69 69 #ifndef QT_NO_STYLE_WINDOWSMOBILE 70 70 #include "qwindowsmobilestyle.h" 71 #endif 72 #ifndef QT_NO_STYLE_S60 73 #include "qs60style.h" 71 74 #endif 72 75 … … 155 158 else 156 159 #endif 160 #ifndef QT_NO_STYLE_S60 161 if (style == QLatin1String("s60")) 162 ret = new QS60Style; 163 else 164 #endif 157 165 #ifndef QT_NO_STYLE_PLASTIQUE 158 166 if (style == QLatin1String("plastique")) … … 171 179 #endif 172 180 #ifndef QT_NO_STYLE_MAC 173 if (style. left(9) == QLatin1String("macintosh")) {181 if (style.startsWith(QLatin1String("macintosh"))) { 174 182 ret = new QMacStyle; 175 183 # ifdef Q_WS_MAC … … 234 242 list << QLatin1String("CDE"); 235 243 #endif 244 #ifndef QT_NO_STYLE_S60 245 if (!list.contains(QLatin1String("S60"))) 246 list << QLatin1String("S60"); 247 #endif 236 248 #ifndef QT_NO_STYLE_PLASTIQUE 237 249 if (!list.contains(QLatin1String("Plastique"))) -
trunk/src/gui/styles/qstylefactory.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qstyleoption.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 46 46 # include "qmacstyle_mac.h" 47 47 #endif 48 #ifndef QT_NO_DEBUG49 48 #include <qdebug.h> 50 # endif49 #include <QtCore/qmath.h> 51 50 52 51 QT_BEGIN_NAMESPACE … … 657 656 \enum QStyleOptionFrameV2::FrameFeature 658 657 659 This enum describ les the different types of features a frame can have.658 This enum describes the different types of features a frame can have. 660 659 661 660 \value None Indicates a normal frame. … … 712 711 */ 713 712 QStyleOptionFrameV3::QStyleOptionFrameV3() 714 : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame) 713 : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame), unused(0) 715 714 { 716 715 } … … 726 725 */ 727 726 QStyleOptionFrameV3::QStyleOptionFrameV3(int version) 728 : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame) 727 : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame), unused(0) 729 728 { 730 729 } … … 899 898 \enum QStyleOptionViewItemV2::ViewItemFeature 900 899 901 This enum describ les the different types of features an item can have.900 This enum describes the different types of features an item can have. 902 901 903 902 \value None Indicates a normal item. … … 954 953 */ 955 954 QStyleOptionViewItemV3::QStyleOptionViewItemV3() 956 : QStyleOptionViewItemV2(Version) 955 : QStyleOptionViewItemV2(Version), widget(0) 957 956 { 958 957 } … … 962 961 */ 963 962 QStyleOptionViewItemV3::QStyleOptionViewItemV3(const QStyleOptionViewItem &other) 964 : QStyleOptionViewItemV2(Version) 963 : QStyleOptionViewItemV2(Version), widget(0) 965 964 { 966 965 (void)QStyleOptionViewItemV3::operator=(other); … … 991 990 */ 992 991 QStyleOptionViewItemV3::QStyleOptionViewItemV3(int version) 993 : QStyleOptionViewItemV2(version) 992 : QStyleOptionViewItemV2(version), widget(0) 994 993 { 995 994 } … … 1254 1253 1255 1254 The frame is flat by default. 1256 1255 1257 1256 \sa QStyleOptionFrameV2::FrameFeature 1258 1257 */ … … 2828 2827 /*! 2829 2828 \variable QStyleOptionComplex::subControls 2830 \brief a bitwise OR of the various sub-controls that need to be 2831 drawn for the complex control 2829 2830 This variable holds a bitwise OR of the \l{QStyle::SubControl} 2831 {sub-controls} to be drawn for the complex control. 2832 2832 2833 2833 The default value is QStyle::SC_All. … … 2838 2838 /*! 2839 2839 \variable QStyleOptionComplex::activeSubControls 2840 \brief a bitwise OR of the various sub-controls that are active 2841 (pressed) for the complex control 2840 2841 This variable holds a bitwise OR of the \l{QStyle::SubControl} 2842 {sub-controls} that are active for the complex control. 2842 2843 2843 2844 The default value is QStyle::SC_None. … … 3542 3543 3543 3544 QStyleOptionDockWidget::QStyleOptionDockWidget() 3544 : QStyleOption(Version, SO_DockWidget), movable(false) 3545 : QStyleOption(Version, SO_DockWidget), closable(false), 3546 movable(false), floatable(false) 3545 3547 { 3546 3548 } … … 4257 4259 4258 4260 QStyleOptionTitleBar contains all the information that QStyle 4259 functions need to draw the title bars of QWorkspace's MDI 4260 children. 4261 functions need to draw the title bar of a QMdiSubWindow. 4261 4262 4262 4263 For performance reasons, the access to the member variables is … … 4268 4269 the \l {widgets/styles}{Styles} example. 4269 4270 4270 \sa QStyleOption, QStyleOptionComplex, Q Workspace4271 \sa QStyleOption, QStyleOptionComplex, QMdiSubWindow 4271 4272 */ 4272 4273 … … 4656 4657 The default value is QSize(-1, -1), i.e. an invalid size. 4657 4658 */ 4659 4660 4661 /*! 4662 4663 \class QStyleOptionTabWidgetFrameV2 4664 \brief The QStyleOptionTabWidgetFrameV2 class is used to describe the 4665 parameters for drawing the frame around a tab widget. 4666 4667 QStyleOptionTabWidgetFrameV2 contains all the information that 4668 QStyle functions need to draw the frame around QTabWidget. 4669 4670 For performance reasons, the access to the member variables is 4671 direct (i.e., using the \c . or \c -> operator). This low-level feel 4672 makes the structures straightforward to use and emphasizes that 4673 these are simply parameters used by the style functions. 4674 4675 For an example demonstrating how style options can be used, see 4676 the \l {widgets/styles}{Styles} example. 4677 4678 \sa QStyleOption, QTabWidget 4679 */ 4680 4681 4682 /*! 4683 \variable QStyleOptionTabWidgetFrameV2::tabBarRect 4684 \brief the rectangle containing all the tabs 4685 4686 The default value is a null rectangle, i.e. a rectangle with both 4687 the width and the height set to 0. 4688 */ 4689 4690 /*! 4691 \variable QStyleOptionTabWidgetFrameV2::selectedTabRect 4692 \brief the rectangle containing the selected tab 4693 4694 This rectangle is contained within the tabBarRect. The default 4695 value is a null rectangle, i.e. a rectangle with both the width 4696 and the height set to 0. 4697 */ 4698 4699 4700 /*! 4701 Constructs a QStyleOptionTabWidgetFrameV2, initializing the members 4702 variables to their default values. 4703 */ 4704 4705 QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2() 4706 : QStyleOptionTabWidgetFrame(Version) 4707 { 4708 } 4709 4710 4711 /*! \internal */ 4712 QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(int version) 4713 : QStyleOptionTabWidgetFrame(version) 4714 { 4715 } 4716 4717 4718 /*! \fn QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrameV2 &other) 4719 Constructs a QStyleOptionTabWidgetFrameV2 copy of the \a other style option. 4720 4721 If the \a other style option's version is 1, the new style option's \l 4722 selectedTabRect and tabBarRect will contain null rects 4723 4724 \sa version 4725 */ 4726 4727 /*! 4728 Constructs a QStyleOptionTabWidgetFrameV2 copy of the \a other style option. 4729 4730 If the \a other style option's version is 1, the new style option's \l 4731 selectedTabRect and tabBarRect will contain null rects 4732 4733 \sa version 4734 */ 4735 QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrame &other) 4736 { 4737 QStyleOptionTabWidgetFrameV2::operator=(other); 4738 4739 } 4740 4741 4742 /*! 4743 Assigns the \a other style option to this style option. The \a 4744 other style option can be either of the QStyleOptionFrameV2 or 4745 QStyleOptionFrame types. 4746 4747 If the \a{other} style option's version is 1, this style option's 4748 QStyleOptionFrameV2::FrameFeature value is set to 4749 QStyleOptionFrameV2::None. If its version is 2, its 4750 \l{QStyleOptionFrameV2::}{FrameFeature} value is simply copied to 4751 this style option. 4752 */ 4753 QStyleOptionTabWidgetFrameV2 &QStyleOptionTabWidgetFrameV2::operator=(const QStyleOptionTabWidgetFrame &other) 4754 { 4755 QStyleOptionTabWidgetFrame::operator=(other); 4756 if (const QStyleOptionTabWidgetFrameV2 *f2 = qstyleoption_cast<const QStyleOptionTabWidgetFrameV2 *>(&other)) { 4757 selectedTabRect = f2->selectedTabRect; 4758 tabBarRect = f2->tabBarRect; 4759 } 4760 return *this; 4761 } 4762 4763 4764 /*! 4765 \enum QStyleOptionTabWidgetFrameV2::StyleOptionVersion 4766 4767 This enum is used to hold information about the version of the style option, and 4768 is defined for each QStyleOption subclass. 4769 4770 \value Version 2 4771 4772 The version is used by QStyleOption subclasses to implement 4773 extensions without breaking compatibility. If you use 4774 qstyleoption_cast(), you normally do not need to check it. 4775 4776 \sa StyleOptionType 4777 */ 4778 4779 4658 4780 #endif // QT_NO_TABWIDGET 4659 4781 … … 4845 4967 /*! \internal */ 4846 4968 QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(int version) 4847 : QStyleOptionTabBarBase(version) 4969 : QStyleOptionTabBarBase(version), documentMode(false) 4848 4970 { 4849 4971 } … … 4937 5059 the parameters needed to draw a QGraphicsItem. 4938 5060 \since 4.2 4939 \ingroup multimedia5061 \ingroup graphicsview-api 4940 5062 4941 5063 For performance reasons, the access to the member variables is … … 4982 5104 4983 5105 /*! 4984 Constructs a QStyleOptionGraphicsItem. The levelOfDetail parameter is 4985 initialized to 1. 5106 Constructs a QStyleOptionGraphicsItem. 4986 5107 */ 4987 5108 QStyleOptionGraphicsItem::QStyleOptionGraphicsItem() … … 4996 5117 : QStyleOption(version, Type), levelOfDetail(1) 4997 5118 { 5119 } 5120 5121 /*! 5122 \since 4.6 5123 5124 Returns the level of detail from the \a worldTransform. 5125 5126 Its value represents the maximum value of the height and 5127 width of a unity rectangle, mapped using the \a worldTransform 5128 of the painter used to draw the item. By default, if no 5129 transformations are applied, its value is 1. If zoomed out 1:2, the level 5130 of detail will be 0.5, and if zoomed in 2:1, its value is 2. 5131 */ 5132 qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform) 5133 { 5134 if (worldTransform.type() <= QTransform::TxTranslate) 5135 return 1; // Translation only? The LOD is 1. 5136 5137 // Two unit vectors. 5138 QLineF v1(0, 0, 1, 0); 5139 QLineF v2(0, 0, 0, 1); 5140 // LOD is the transformed area of a 1x1 rectangle. 5141 return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length()); 4998 5142 } 4999 5143 … … 5011 5155 item are exposed. If the whole item is exposed, this rectangle will be the 5012 5156 same as QGraphicsItem::boundingRect(). 5157 5158 This member is only initialized for items that have the 5159 QGraphicsItem::ItemUsesExtendedStyleOption flag set. 5013 5160 */ 5014 5161 … … 5016 5163 \variable QStyleOptionGraphicsItem::matrix 5017 5164 \brief the complete transformation matrix for the item 5018 5019 This matrix is the sum of the item's scene matrix and the matrix of the 5020 painter used for drawing the item. It is provided for convenience, 5165 \obsolete 5166 5167 The QMatrix provided through this member does include information about 5168 any perspective transformations applied to the view or item. To get the 5169 correct transformation matrix, use QPainter::transform() on the painter 5170 passed into the QGraphicsItem::paint() implementation. 5171 5172 This matrix is the combination of the item's scene matrix and the matrix 5173 of the painter used for drawing the item. It is provided for convenience, 5021 5174 allowing anvanced level-of-detail metrics that can be used to speed up 5022 5175 item drawing. 5023 5176 5024 To find the dimen tions of an item in screen coordinates (i.e., pixels),5177 To find the dimensions of an item in screen coordinates (i.e., pixels), 5025 5178 you can use the mapping functions of QMatrix, such as QMatrix::map(). 5026 5179 5027 \sa QStyleOptionGraphicsItem::levelOfDetail 5180 This member is only initialized for items that have the 5181 QGraphicsItem::ItemUsesExtendedStyleOption flag set. 5182 5183 \sa QStyleOptionGraphicsItem::levelOfDetailFromTransform() 5028 5184 */ 5029 5185 5030 5186 /*! 5031 5187 \variable QStyleOptionGraphicsItem::levelOfDetail 5032 \brief a simple metric for determining an item's level of detail 5033 5034 This simple metric provides an easy way to determine the level of detail 5035 for an item. Its value represents the maximum value of the height and 5036 width of a unity rectangle, mapped using the complete transformation 5037 matrix of the painter used to draw the item. By default, if no 5038 transformations are applied, its value is 1. If zoomed out 1:2, the level 5039 of detail will be 0.5, and if zoomed in 2:1, its value is 2. 5040 5041 For more advanced level-of-detail metrics, use 5042 QStyleOptionGraphicsItem::matrix directly. 5043 5044 \sa QStyleOptionGraphicsItem::matrix 5188 \obsolete 5189 5190 Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() 5191 together with QPainter::worldTransform() instead. 5045 5192 */ 5046 5193 … … 5273 5420 */ 5274 5421 5422 QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) 5423 { 5275 5424 #if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) 5276 QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)5277 {5278 5425 switch (optionType) { 5279 5426 case QStyleOption::SO_Default: … … 5336 5483 debug << "SO_GraphicsItem"; break; 5337 5484 } 5485 #endif 5338 5486 return debug; 5339 5487 } … … 5341 5489 QDebug operator<<(QDebug debug, const QStyleOption &option) 5342 5490 { 5491 #if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM) 5343 5492 debug << "QStyleOption("; 5344 5493 debug << QStyleOption::OptionType(option.type); 5345 debug << "," << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight"); 5346 debug << "," << option.state; 5347 debug << "," << option.rect; 5348 debug << ")"; 5494 debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight"); 5495 debug << ',' << option.state; 5496 debug << ',' << option.rect; 5497 debug << ')'; 5498 #endif 5349 5499 return debug; 5350 5500 } 5351 #endif5352 5501 5353 5502 QT_END_NAMESPACE -
trunk/src/gui/styles/qstyleoption.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 193 193 QStyleOptionTabWidgetFrame(int version); 194 194 }; 195 196 class Q_GUI_EXPORT QStyleOptionTabWidgetFrameV2 : public QStyleOptionTabWidgetFrame 197 { 198 public: 199 enum StyleOptionVersion { Version = 2 }; 200 201 QRect tabBarRect; 202 QRect selectedTabRect; 203 204 QStyleOptionTabWidgetFrameV2(); 205 QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrameV2 &other) : 206 QStyleOptionTabWidgetFrame(Version) { *this = other; } 207 QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrame &other); 208 QStyleOptionTabWidgetFrameV2 &operator=(const QStyleOptionTabWidgetFrame &other); 209 210 protected: 211 QStyleOptionTabWidgetFrameV2(int version); 212 }; 213 195 214 #endif 215 196 216 197 217 #ifndef QT_NO_TABBAR … … 857 877 QStyleOptionGraphicsItem(); 858 878 QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; } 879 static qreal levelOfDetailFromTransform(const QTransform &worldTransform); 859 880 protected: 860 881 QStyleOptionGraphicsItem(int version); … … 938 959 } 939 960 940 #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DEBUG)941 961 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType); 942 962 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option); 943 #endif944 963 945 964 QT_END_NAMESPACE -
trunk/src/gui/styles/qstyleplugin.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qstyleplugin.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qstylesheetstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 82 82 #include <QAbstractSpinBox> 83 83 #include <QLabel> 84 #include "qdrawutil.h" 84 85 85 86 #include <limits.h> 87 #include <QtGui/qtoolbar.h> 86 88 87 89 QT_BEGIN_NAMESPACE … … 214 216 PseudoElement_ViewItemIndicator, 215 217 PseudoElement_ScrollAreaCorner, 218 PseudoElement_TabBarTabCloseButton, 216 219 NumPseudoElements 217 220 }; … … 223 226 224 227 static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = { 225 { QStyle::SC_None, "" ,},228 { QStyle::SC_None, "" }, 226 229 { QStyle::SC_None, "down-arrow" }, 227 230 { QStyle::SC_None, "up-arrow" }, … … 300 303 { QStyle::SC_None, "icon" }, 301 304 { QStyle::SC_None, "text" }, 302 { QStyle::SC_None, "indicator" } , 303 { QStyle::SC_None, "corner" } 305 { QStyle::SC_None, "indicator" }, 306 { QStyle::SC_None, "corner" }, 307 { QStyle::SC_None, "close-button" }, 304 308 }; 305 309 … … 313 317 cuts[i] = -1; 314 318 } 315 QPixmap topEdge, bottomEdge, leftEdge, rightEdge, middle;316 QRect topEdgeRect, bottomEdgeRect, leftEdgeRect, rightEdgeRect, middleRect;317 QRect topLeftCorner, topRightCorner, bottomRightCorner, bottomLeftCorner;318 319 int cuts[4]; 319 320 QPixmap pixmap; 320 321 QImage image; 321 322 QCss::TileMode horizStretch, vertStretch; 322 323 void cutBorderImage();324 323 }; 325 324 … … 872 871 : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) 873 872 { 874 QPalette palette = qApp->palette(); // ###: ideally widget's palette873 QPalette palette = QApplication::palette(); // ###: ideally widget's palette 875 874 ValueExtractor v(declarations, palette); 876 875 features = v.extractStyleFeatures(); … … 1123 1122 bi->cuts[i] = int(border()->borders[i]); 1124 1123 } 1125 bi->cutBorderImage(); 1126 } 1127 1128 void QStyleSheetBorderImageData::cutBorderImage() 1129 { 1130 const int w = pixmap.width(); 1131 const int h = pixmap.height(); 1132 const int &l = cuts[LeftEdge], &r = cuts[RightEdge], 1133 &t = cuts[TopEdge], &b = cuts[BottomEdge]; 1134 1135 topEdgeRect = QRect(l, 0, w - r - l, t); 1136 bottomEdgeRect = QRect(l, h - b, w - l - r, b); 1137 if (horizStretch != TileMode_Stretch) { 1138 if (topEdgeRect.isValid()) 1139 topEdge = pixmap.copy(topEdgeRect).scaledToHeight(t); 1140 if (bottomEdgeRect.isValid()) 1141 bottomEdge = pixmap.copy(bottomEdgeRect).scaledToHeight(b); 1142 } 1143 1144 leftEdgeRect = QRect(0, t, l, h - b - t); 1145 rightEdgeRect = QRect(w - r, t, r, h - t- b); 1146 if (vertStretch != TileMode_Stretch) { 1147 if (leftEdgeRect.isValid()) 1148 leftEdge = pixmap.copy(leftEdgeRect).scaledToWidth(l); 1149 if (rightEdgeRect.isValid()) 1150 rightEdge = pixmap.copy(rightEdgeRect).scaledToWidth(r); 1151 } 1152 1153 middleRect = QRect(l, t, w - r -l, h - t - b); 1154 if (middleRect.isValid() 1155 && !(horizStretch == TileMode_Stretch && vertStretch == TileMode_Stretch)) { 1156 middle = pixmap.copy(middleRect); 1157 } 1158 } 1159 1160 static void qDrawCenterTiledPixmap(QPainter *p, const QRectF& r, const QPixmap& pix) 1161 { 1162 p->drawTiledPixmap(r, pix, QPoint(pix.width() - int(r.width())%pix.width(), 1163 pix.height() - int(r.height())%pix.height())); 1164 } 1165 1166 // Note: Round is not supported 1124 } 1125 1167 1126 void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) 1168 1127 { 1169 setClip(p, rect); 1170 const QRectF br(rect); 1171 const int *borders = border()->borders; 1172 const int &l = borders[LeftEdge], &r = borders[RightEdge], 1173 &t = borders[TopEdge], &b = borders[BottomEdge]; 1174 QRectF pr = br.adjusted(l, t, -r, -b); 1128 static const Qt::TileRule tileMode2TileRule[] = { 1129 Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; 1130 1131 const QStyleSheetBorderImageData *borderImageData = border()->borderImage(); 1132 const int *targetBorders = border()->borders; 1133 const int *sourceBorders = borderImageData->cuts; 1134 QMargins sourceMargins(sourceBorders[LeftEdge], sourceBorders[TopEdge], 1135 sourceBorders[RightEdge], sourceBorders[BottomEdge]); 1136 QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge], 1137 targetBorders[RightEdge], targetBorders[BottomEdge]); 1175 1138 1176 1139 bool wasSmoothPixmapTransform = p->renderHints() & QPainter::SmoothPixmapTransform; 1177 1140 p->setRenderHint(QPainter::SmoothPixmapTransform); 1178 1179 const QStyleSheetBorderImageData *bi = border()->borderImage(); 1180 const QPixmap& pix = bi->pixmap; 1181 const int *c = bi->cuts; 1182 QRectF tlc(0, 0, c[LeftEdge], c[TopEdge]); 1183 if (tlc.isValid()) 1184 p->drawPixmap(QRectF(br.topLeft(), QSizeF(l, t)), pix, tlc); 1185 QRectF trc(pix.width() - c[RightEdge], 0, c[RightEdge], c[TopEdge]); 1186 if (trc.isValid()) 1187 p->drawPixmap(QRectF(br.left() + br.width() - r, br.y(), r, t), pix, trc); 1188 QRectF blc(0, pix.height() - c[BottomEdge], c[LeftEdge], c[BottomEdge]); 1189 if (blc.isValid()) 1190 p->drawPixmap(QRectF(br.x(), br.y() + br.height() - b, l, b), pix, blc); 1191 QRectF brc(pix.width() - c[RightEdge], pix.height() - c[BottomEdge], 1192 c[RightEdge], c[BottomEdge]); 1193 if (brc.isValid()) 1194 p->drawPixmap(QRectF(br.x() + br.width() - r, br.y() + br.height() - b, r, b), 1195 pix, brc); 1196 1197 QRectF topEdgeRect(br.x() + l, br.y(), pr.width(), t); 1198 QRectF bottomEdgeRect(br.x() + l, br.y() + br.height() - b, pr.width(), b); 1199 1200 switch (bi->horizStretch) { 1201 case TileMode_Stretch: 1202 if (bi->topEdgeRect.isValid()) 1203 p->drawPixmap(topEdgeRect, pix, bi->topEdgeRect); 1204 if (bi->bottomEdgeRect.isValid()) 1205 p->drawPixmap(bottomEdgeRect, pix, bi->bottomEdgeRect); 1206 if (bi->middleRect.isValid()) { 1207 if (bi->vertStretch == TileMode_Stretch) 1208 p->drawPixmap(pr, pix, bi->middleRect); 1209 else if (bi->vertStretch == TileMode_Repeat) { 1210 QPixmap scaled = bi->middle.scaled(int(pr.width()), bi->middle.height()); 1211 qDrawCenterTiledPixmap(p, pr, scaled); 1212 } 1213 } 1214 break; 1215 case TileMode_Repeat: 1216 if (!bi->topEdge.isNull() && !topEdgeRect.isEmpty()) { 1217 QPixmap scaled = bi->topEdge.scaled(bi->topEdge.width(), t); 1218 qDrawCenterTiledPixmap(p, topEdgeRect, scaled); 1219 } 1220 if (!bi->bottomEdge.isNull() && !bottomEdgeRect.isEmpty()) { 1221 QPixmap scaled = bi->bottomEdge.scaled(bi->bottomEdge.width(), b); 1222 qDrawCenterTiledPixmap(p, bottomEdgeRect, scaled); 1223 } 1224 if (bi->middleRect.isValid()) { 1225 if (bi->vertStretch == TileMode_Repeat) { 1226 qDrawCenterTiledPixmap(p, pr, bi->middle); 1227 } else if (bi->vertStretch == TileMode_Stretch) { 1228 QPixmap scaled = bi->middle.scaled(bi->middle.width(), int(pr.height())); 1229 qDrawCenterTiledPixmap(p, pr, scaled); 1230 } 1231 } 1232 break; 1233 case TileMode_Round: 1234 if (!bi->topEdge.isNull()) { 1235 int rwh = (int)pr.width()/ceil(pr.width()/bi->topEdge.width()); 1236 QPixmap scaled = bi->topEdge.scaled(rwh, bi->topEdge.height()); 1237 int blank = int(pr.width()) % rwh; 1238 p->drawTiledPixmap(QRectF(br.x() + l + blank/2, br.y(), pr.width() - blank, t), 1239 scaled); 1240 } 1241 if (!bi->bottomEdge.isNull()) { 1242 int rwh = (int) pr.width()/ceil(pr.width()/bi->bottomEdge.width()); 1243 QPixmap scaled = bi->bottomEdge.scaled(rwh, bi->bottomEdge.height()); 1244 int blank = int(pr.width()) % rwh; 1245 p->drawTiledPixmap(QRectF(br.x() + l+ blank/2, br.y()+br.height()-b, 1246 pr.width() - blank, b), scaled); 1247 } 1248 break; 1249 default: 1250 break; 1251 } 1252 1253 QRectF leftEdgeRect(br.x(), br.y() + t, l, pr.height()); 1254 QRectF rightEdgeRect(br.x() + br.width()- r, br.y() + t, r, pr.height()); 1255 1256 switch (bi->vertStretch) { 1257 case TileMode_Stretch: 1258 if (bi->leftEdgeRect.isValid()) 1259 p->drawPixmap(leftEdgeRect, pix, bi->leftEdgeRect); 1260 if (bi->rightEdgeRect.isValid()) 1261 p->drawPixmap(rightEdgeRect, pix, bi->rightEdgeRect); 1262 break; 1263 case TileMode_Repeat: 1264 if (!bi->leftEdge.isNull() && !leftEdgeRect.isEmpty()) { 1265 QPixmap scaled = bi->leftEdge.scaled(l, bi->leftEdge.height()); 1266 qDrawCenterTiledPixmap(p, leftEdgeRect, scaled); 1267 } 1268 if (!bi->rightEdge.isNull() && !rightEdgeRect.isEmpty()) { 1269 QPixmap scaled = bi->rightEdge.scaled(r, bi->rightEdge.height()); 1270 qDrawCenterTiledPixmap(p, rightEdgeRect, scaled); 1271 } 1272 break; 1273 case TileMode_Round: 1274 if (!bi->leftEdge.isNull()) { 1275 int rwh = (int) pr.height()/ceil(pr.height()/bi->leftEdge.height()); 1276 QPixmap scaled = bi->leftEdge.scaled(bi->leftEdge.width(), rwh); 1277 int blank = int(pr.height()) % rwh; 1278 p->drawTiledPixmap(QRectF(br.x(), br.y() + t + blank/2, l, pr.height() - blank), 1279 scaled); 1280 } 1281 if (!bi->rightEdge.isNull()) { 1282 int rwh = (int) pr.height()/ceil(pr.height()/bi->rightEdge.height()); 1283 QPixmap scaled = bi->rightEdge.scaled(bi->rightEdge.width(), rwh); 1284 int blank = int(pr.height()) % rwh; 1285 p->drawTiledPixmap(QRectF(br.x() + br.width() - r, br.y()+t+blank/2, r, 1286 pr.height() - blank), scaled); 1287 } 1288 break; 1289 default: 1290 break; 1291 } 1292 1141 qDrawBorderPixmap(p, rect, targetMargins, borderImageData->pixmap, 1142 QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins, 1143 QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch])); 1293 1144 p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform); 1294 unsetClip(p);1295 1145 } 1296 1146 … … 1331 1181 QRect r = originRect(rect, background()->origin); 1332 1182 QRect aligned = QStyle::alignedRect(Qt::LeftToRight, background()->position, bgp.size(), r); 1333 QRect inter = aligned. intersected(r);1183 QRect inter = aligned.translated(-off).intersected(r); 1334 1184 1335 1185 switch (background()->repeat) { … … 1452 1302 void QRenderRule::drawBackground(QPainter *p, const QRect& rect, const QPoint& off) 1453 1303 { 1454 setClip(p, borderRect(rect));1455 1304 QBrush brush = hasBackground() ? background()->brush : QBrush(); 1456 1305 if (brush.style() == Qt::NoBrush) … … 1460 1309 Origin origin = hasBackground() ? background()->clip : Origin_Border; 1461 1310 // ### fix for gradients 1462 p->fillRect(originRect(rect, origin), brush); 1311 const QPainterPath &borderPath = borderClip(originRect(rect, origin)); 1312 if (!borderPath.isEmpty()) { 1313 // Drawn intead of being used as clipping path for better visual quality 1314 bool wasAntialiased = p->renderHints() & QPainter::Antialiasing; 1315 p->setRenderHint(QPainter::Antialiasing); 1316 p->fillPath(borderPath, brush); 1317 p->setRenderHint(QPainter::Antialiasing, wasAntialiased); 1318 } else { 1319 p->fillRect(originRect(rect, origin), brush); 1320 } 1463 1321 } 1464 1322 1465 1323 drawBackgroundImage(p, rect, off); 1466 unsetClip(p);1467 1324 } 1468 1325 … … 1526 1383 * to be transparent when we have a transparent background or border image */ 1527 1384 if ((hasBackground() && background()->isTransparent()) 1528 || (hasBorder() && border()->hasBorderImage() && border()->borderImage()->middleRect.isValid()))1385 || (hasBorder() && border()->hasBorderImage() && !border()->borderImage()->pixmap.isNull())) 1529 1386 p->setBrush(cg, w->backgroundRole(), Qt::NoBrush); 1530 1387 } … … 1709 1566 parser.init(wid->styleSheet()); 1710 1567 if (!parser.parse(&ss)) { 1711 parser.init(QLatin1String("* {") + wid->styleSheet() + QLatin1 String("}"));1568 parser.init(QLatin1String("* {") + wid->styleSheet() + QLatin1Char('}')); 1712 1569 if (!parser.parse(&ss)) 1713 1570 qWarning("Could not parse stylesheet of widget %p", wid); … … 1903 1760 1904 1761 if (!(complex->activeSubControls & subControl)) 1905 state = QStyle::State(state & (QStyle::State_Enabled | QStyle::State_Horizontal));1762 state &= (QStyle::State_Enabled | QStyle::State_Horizontal | QStyle::State_HasFocus); 1906 1763 } 1907 1764 … … 2158 2015 } else 2159 2016 #endif 2160 { } // required for the above ifdef'ery 2017 if (const QFrame *frm = qobject_cast<const QFrame *>(w)) { 2018 if (frm->lineWidth() == 0) 2019 extraClass |= PseudoClass_Frameless; 2020 } 2161 2021 } 2162 2022 … … 2738 2598 widget->style()->polish(widget); 2739 2599 QEvent event(QEvent::StyleChange); 2740 qApp->sendEvent(widget, &event);2600 QApplication::sendEvent(widget, &event); 2741 2601 widget->update(); 2742 2602 widget->updateGeometry(); … … 2784 2644 if (base) 2785 2645 return base; 2786 if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>( qApp->style()))2646 if (QStyleSheetStyle *me = qobject_cast<QStyleSheetStyle *>(QApplication::style())) 2787 2647 return me->base; 2788 return qApp->style();2648 return QApplication::style(); 2789 2649 } 2790 2650 … … 2856 2716 if ((rule.hasBorder() && rule.border()->hasBorderImage()) 2857 2717 || (rule.hasBackground() && !rule.background()->pixmap.isNull())) { 2858 QObject::disconnect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),2859 sa, SLOT(update()));2860 QObject::disconnect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)),2861 sa, SLOT(update()));2862 2718 QObject::connect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)), 2863 sa, SLOT(update()) );2719 sa, SLOT(update()), Qt::UniqueConnection); 2864 2720 QObject::connect(sa->verticalScrollBar(), SIGNAL(valueChanged(int)), 2865 sa, SLOT(update()) );2721 sa, SLOT(update()), Qt::UniqueConnection); 2866 2722 } 2867 2723 } … … 2877 2733 if (rule.hasDrawable() || rule.hasBox()) { 2878 2734 if (w->metaObject() == &QWidget::staticMetaObject 2879 #ifndef QT_NO_MENUBAR2880 || qobject_cast<QMenuBar *>(w)2881 #endif2882 #ifndef QT_NO_MENU2883 || qobject_cast<QMenu *>(w)2884 #endif2885 2735 #ifndef QT_NO_ITEMVIEWS 2886 2736 || qobject_cast<QHeaderView *>(w) … … 2897 2747 #ifndef QT_NO_MDIAREA 2898 2748 || qobject_cast<QMdiSubWindow *>(w) 2749 #endif 2750 #ifndef QT_NO_MENUBAR 2751 || qobject_cast<QMenuBar *>(w) 2899 2752 #endif 2900 2753 || qobject_cast<QDialog *>(w)) { … … 3014 2867 rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button); 3015 2868 bool customDropDown = (opt->subControls & QStyle::SC_ComboBoxArrow) 3016 && hasStyleRule(w, PseudoElement_ComboBoxDropDown);2869 && (hasStyleRule(w, PseudoElement_ComboBoxDropDown) || hasStyleRule(w, PseudoElement_ComboBoxArrow)); 3017 2870 if (customDropDown) 3018 2871 cmbOpt.subControls &= ~QStyle::SC_ComboBoxArrow; … … 3051 2904 QStyleOptionSpinBox spinOpt(*spin); 3052 2905 rule.configurePalette(&spinOpt.palette, QPalette::ButtonText, QPalette::Button); 2906 rule.configurePalette(&spinOpt.palette, QPalette::Text, QPalette::Base); 3053 2907 spinOpt.rect = rule.borderRect(opt->rect); 3054 2908 bool customUp = true, customDown = true; 3055 2909 QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); 3056 2910 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); 3057 bool upRuleMatch = upRule.hasGeometry() ;3058 bool downRuleMatch = downRule.hasGeometry() ;2911 bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); 2912 bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition(); 3059 2913 if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) { 3060 2914 rule.drawBackgroundImage(p, spinOpt.rect); 3061 2915 customUp = (opt->subControls & QStyle::SC_SpinBoxUp) 3062 && hasStyleRule(w, PseudoElement_SpinBoxUpButton);2916 && (hasStyleRule(w, PseudoElement_SpinBoxUpButton) || hasStyleRule(w, PseudoElement_UpArrow)); 3063 2917 if (customUp) 3064 2918 spinOpt.subControls &= ~QStyle::SC_SpinBoxUp; 3065 2919 customDown = (opt->subControls & QStyle::SC_SpinBoxDown) 3066 && hasStyleRule(w, PseudoElement_SpinBoxDownButton);2920 && (hasStyleRule(w, PseudoElement_SpinBoxDownButton) || hasStyleRule(w, PseudoElement_DownArrow)); 3067 2921 if (customDown) 3068 2922 spinOpt.subControls &= ~QStyle::SC_SpinBoxDown; … … 3190 3044 QStyleOptionToolButton toolOpt(*tool); 3191 3045 rule.configurePalette(&toolOpt.palette, QPalette::ButtonText, QPalette::Button); 3046 toolOpt.font = rule.font.resolve(toolOpt.font); 3192 3047 toolOpt.rect = rule.borderRect(opt->rect); 3193 3048 bool customArrow = (tool->features & (QStyleOptionToolButton::HasMenu | QStyleOptionToolButton::MenuButtonPopup)); … … 3282 3137 rule.drawRule(p, opt->rect); 3283 3138 3284 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove); 3285 if (!subRule.hasDrawable()) { 3286 baseStyle()->drawComplexControl(cc, slider, p, w); 3287 return; 3139 QRenderRule grooveSubRule = renderRule(w, opt, PseudoElement_SliderGroove); 3140 QRenderRule handleSubRule = renderRule(w, opt, PseudoElement_SliderHandle); 3141 if (!grooveSubRule.hasDrawable()) { 3142 QStyleOptionSlider slOpt(*slider); 3143 bool handleHasRule = handleSubRule.hasDrawable(); 3144 // If the style specifies a different handler rule, draw the groove without the handler. 3145 if (handleHasRule) 3146 slOpt.subControls &= ~SC_SliderHandle; 3147 baseStyle()->drawComplexControl(cc, &slOpt, p, w); 3148 if (!handleHasRule) 3149 return; 3288 3150 } 3289 3151 3290 3152 QRect gr = subControlRect(cc, opt, SC_SliderGroove, w); 3291 3153 if (slider->subControls & SC_SliderGroove) { 3292 subRule.drawRule(p, gr);3154 grooveSubRule.drawRule(p, gr); 3293 3155 } 3294 3156 3295 3157 if (slider->subControls & SC_SliderHandle) { 3296 QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderHandle);3297 3158 QRect hr = subControlRect(cc, opt, SC_SliderHandle, w); 3298 3159 … … 3315 3176 } 3316 3177 3317 subRule.drawRule(p, subRule.boxRect(hr, Margin));3178 handleSubRule.drawRule(p, grooveSubRule.boxRect(hr, Margin)); 3318 3179 } 3319 3180 … … 3349 3210 QRect rect = subRule.boxRect(subControlRect(CC_MdiControls, opt, control, w), Margin); 3350 3211 subRule.drawRule(p, rect); 3351 QIcon icon = standardIcon(subControlIcon(layoutButton) );3212 QIcon icon = standardIcon(subControlIcon(layoutButton), opt); 3352 3213 icon.paint(p, subRule.contentsRect(rect), Qt::AlignCenter); 3353 3214 } else { … … 3465 3326 3466 3327 case CE_PushButton: 3467 ParentStyle::drawControl(ce, opt, p, w); 3468 return; 3469 3328 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { 3329 if (rule.hasDrawable() || rule.hasBox() || rule.hasPosition() || rule.hasPalette() || 3330 ((btn->features & QStyleOptionButton::HasMenu) && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator))) { 3331 ParentStyle::drawControl(ce, opt, p, w); 3332 return; 3333 } 3334 } 3335 break; 3470 3336 case CE_PushButtonBevel: 3471 3337 if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { … … 3510 3376 Qt::Alignment textAlignment = rule.position()->textAlignment; 3511 3377 QRect textRect = button->rect; 3512 uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic; 3378 uint tf = Qt::TextShowMnemonic; 3379 const uint verticalAlignMask = Qt::AlignVCenter | Qt::AlignTop | Qt::AlignLeft; 3380 tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) : Qt::AlignVCenter; 3513 3381 if (!styleHint(SH_UnderlineShortcut, button, w)) 3514 3382 tf |= Qt::TextHideMnemonic; … … 3619 3487 case CE_MenuBarEmptyArea: 3620 3488 if (rule.hasDrawable()) { 3489 // Drawn by PE_Widget 3621 3490 return; 3622 3491 } … … 3736 3605 drawPrimitive(arrow, &mi, p, w); 3737 3606 } 3738 } else if (hasStyleRule(w, PseudoElement_MenuCheckMark) ) {3607 } else if (hasStyleRule(w, PseudoElement_MenuCheckMark) || hasStyleRule(w, PseudoElement_MenuRightArrow)) { 3739 3608 QWindowsStyle::drawControl(ce, &mi, p, w); 3609 if (mi.checkType != QStyleOptionMenuItem::NotCheckable && !mi.checked) { 3610 // We have a style defined, but QWindowsStyle won't draw anything if not checked. 3611 // So we mimick what QWindowsStyle would do. 3612 int checkcol = qMax<int>(mi.maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth); 3613 QRect vCheckRect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x(), mi.rect.y(), checkcol, mi.rect.height())); 3614 if (mi.state.testFlag(State_Enabled) && mi.state.testFlag(State_Selected)) { 3615 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &mi.palette.brush(QPalette::Button)); 3616 } else { 3617 QBrush fill(mi.palette.light().color(), Qt::Dense4Pattern); 3618 qDrawShadePanel(p, vCheckRect, mi.palette, true, 1, &fill); 3619 } 3620 QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); 3621 if (subSubRule.hasDrawable()) { 3622 QStyleOptionMenuItem newMi(mi); 3623 newMi.rect = visualRect(opt->direction, mi.rect, QRect(mi.rect.x() + QWindowsStylePrivate::windowsItemFrame, 3624 mi.rect.y() + QWindowsStylePrivate::windowsItemFrame, 3625 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, 3626 mi.rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); 3627 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, w); 3628 } 3629 } 3740 3630 } else { 3741 3631 if (rule.hasDrawable() && !subRule.hasDrawable() && !(opt->state & QStyle::State_Selected)) { … … 3769 3659 QCommonStyle::drawControl(ce, &mi, p, w); 3770 3660 } else { 3661 if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) { 3662 // So that the menu bar background is not hidden by the items 3663 mi.palette.setColor(QPalette::Window, Qt::transparent); 3664 mi.palette.setColor(QPalette::Button, Qt::transparent); 3665 } 3771 3666 baseStyle()->drawControl(ce, &mi, p, w); 3772 3667 } … … 3790 3685 QRect iconRect(editRect); 3791 3686 iconRect.setWidth(cb->iconSize.width()); 3792 iconRect = alignedRect( QApplication::layoutDirection(),3793 3794 3687 iconRect = alignedRect(cb->direction, 3688 Qt::AlignLeft | Qt::AlignVCenter, 3689 iconRect.size(), editRect); 3795 3690 drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); 3796 3691 … … 3802 3697 if (!cb->currentText.isEmpty() && !cb->editable) { 3803 3698 drawItemText(p, editRect.adjusted(0, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, cb->palette, 3804 cb->state & State_Enabled, cb->currentText );3699 cb->state & State_Enabled, cb->currentText, QPalette::Text); 3805 3700 } 3806 3701 p->restore(); … … 4093 3988 if (subRule.hasFont) 4094 3989 p->setFont(subRule.font); 4095 if (subRule.hasBox() ) {3990 if (subRule.hasBox() || !subRule.hasNativeBorder()) { 4096 3991 tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r) 4097 3992 : subRule.contentsRect(r); … … 4165 4060 frmOpt.rect = rule.borderRect(frmOpt.rect); 4166 4061 baseStyle()->drawControl(ce, &frmOpt, p, w); 4167 } else { 4168 rule.drawBorder(p, rule.borderRect(opt->rect)); 4169 } 4062 } 4063 // else, borders are already drawn in PE_Widget 4170 4064 } 4171 4065 return; … … 4221 4115 4222 4116 switch (pe) { 4223 case PE_PanelStatusBar:4224 if (rule.hasDrawable()) {4225 rule.drawRule(p, opt->rect);4226 return;4227 }4228 break;4229 4117 4230 4118 case PE_FrameStatusBar: { … … 4317 4205 if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw()) 4318 4206 return; 4207 rule = spinboxRule; 4319 4208 } 4320 4209 #endif … … 4338 4227 4339 4228 case PE_Widget: 4340 if (!rule.has Background()) {4229 if (!rule.hasDrawable()) { 4341 4230 QWidget *container = containerWidget(w); 4342 4231 if (autoFillDisabledWidgets->contains(container) … … 4348 4237 break; 4349 4238 } 4350 4351 4239 #ifndef QT_NO_SCROLLAREA 4352 4240 if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) { 4353 4241 const QAbstractScrollAreaPrivate *sap = sa->d_func(); 4354 4242 rule.drawBackground(p, opt->rect, sap->contentsOffset()); 4355 } else 4243 if (rule.hasBorder()) 4244 rule.drawBorder(p, rule.borderRect(opt->rect)); 4245 break; 4246 } 4356 4247 #endif 4357 { 4358 rule.drawBackground(p, opt->rect); 4359 } 4360 4248 //fall tghought 4249 case PE_PanelMenu: 4250 case PE_PanelStatusBar: 4251 if(rule.hasDrawable()) { 4252 rule.drawRule(p, opt->rect); 4253 return; 4254 } 4255 break; 4256 4257 case PE_PanelMenuBar: 4258 if (rule.hasDrawable()) { 4259 // Drawn by PE_Widget 4361 4260 return; 4362 4363 case PE_FrameMenu: 4364 case PE_PanelMenuBar: 4365 if (!rule.hasNativeBorder()) { 4366 rule.drawBorder(p, rule.borderRect(opt->rect)); 4367 return; 4368 } 4369 break; 4261 } 4262 break; 4370 4263 4371 4264 case PE_IndicatorToolBarSeparator: … … 4411 4304 subRule.drawRule(p, opt->rect); 4412 4305 } else { 4413 QStyleOptionViewItemV2 v2Copy(*v2); 4414 if (v2->showDecorationSelected) { 4415 QRenderRule subRule2 = renderRule(w, opt, PseudoElement_ViewItem); 4416 if (v2->state & QStyle::State_Selected) { 4417 subRule2.configurePalette(&v2Copy.palette, QPalette::NoRole, QPalette::Highlight); 4418 } else if (v2->features & QStyleOptionViewItemV2::Alternate) { 4419 subRule2.configurePalette(&v2Copy.palette, QPalette::NoRole, QPalette::AlternateBase); 4420 } else if (subRule2.hasBackground()) { 4421 p->fillRect(v2->rect, subRule2.background()->brush); 4422 } 4423 } else if (v2->features & QStyleOptionViewItemV2::Alternate) { 4424 quint64 pc = v2->state & QStyle::State_Enabled ? PseudoClass_Enabled : PseudoClass_Disabled; 4425 pc |= PseudoClass_Alternate; 4426 QRenderRule subRule2 = renderRule(w, PseudoElement_ViewItem, pc); 4427 subRule2.configurePalette(&v2Copy.palette, QPalette::NoRole, QPalette::AlternateBase); 4428 } 4429 baseStyle()->drawPrimitive(pe, &v2Copy, p, w); 4306 baseStyle()->drawPrimitive(pe, v2, p, w); 4430 4307 } 4431 4308 } … … 4461 4338 if (subRule.hasNativeBorder()) { 4462 4339 subRule.drawBackground(p, opt->rect); 4463 QStyleOptionTabWidgetFrame frmCopy(*frm);4340 QStyleOptionTabWidgetFrameV2 frmCopy(*frm); 4464 4341 subRule.configurePalette(&frmCopy.palette, QPalette::WindowText, QPalette::Window); 4465 4342 baseStyle()->drawPrimitive(pe, &frmCopy, p, w); … … 4492 4369 4493 4370 case PE_PanelItemViewItem: 4494 if (!styleHint(SH_ItemView_ShowDecorationSelected, opt, w)) {4495 rect = subElementRect(QStyle::SE_ItemViewItemText, opt, w)4496 | subElementRect(QStyle::SE_ItemViewItemDecoration, opt, w)4497 | subElementRect(QStyle::SE_ItemViewItemCheckIndicator, opt, w);4498 }4499 pseudoElement = PseudoElement_ViewItem;4500 break;4501 4502 case PE_PanelItemViewRow:4503 ParentStyle::drawPrimitive(pe, opt, p, w);4504 if (!styleHint(SH_ItemView_ShowDecorationSelected, opt, w))4505 return;4506 4371 pseudoElement = PseudoElement_ViewItem; 4507 4372 break; … … 4510 4375 pseudoElement = PseudoElement_ScrollAreaCorner; 4511 4376 break; 4377 4378 case PE_IndicatorSpinDown: 4379 case PE_IndicatorSpinMinus: 4380 pseudoElement = PseudoElement_SpinBoxDownArrow; 4381 break; 4382 4383 case PE_IndicatorSpinUp: 4384 case PE_IndicatorSpinPlus: 4385 pseudoElement = PseudoElement_SpinBoxUpArrow; 4386 break; 4387 #ifndef QT_NO_TABBAR 4388 case PE_IndicatorTabClose: 4389 if (w) 4390 w = w->parentWidget(); //match on the QTabBar instead of the CloseButton 4391 pseudoElement = PseudoElement_TabBarTabCloseButton; 4392 #endif 4512 4393 4513 4394 default: … … 4757 4638 break; 4758 4639 4640 #ifndef QT_NO_TABWIDGET 4759 4641 case PM_TabBarTabHSpace: 4760 4642 case PM_TabBarTabVSpace: … … 4780 4662 break; 4781 4663 4782 case PM_TabBarBaseOverlap: 4783 if (hasStyleRule(w->parentWidget(), PseudoElement_TabWidgetPane)) { 4664 case PM_TabBarBaseOverlap: { 4665 const QWidget *tabWidget = qobject_cast<const QTabWidget *>(w) ? w : w->parentWidget(); 4666 if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) { 4784 4667 return 0; 4785 4668 } 4786 4669 break; 4670 } 4671 #endif // QT_NO_TABWIDGET 4787 4672 4788 4673 case PM_SliderThickness: // horizontal slider's height (sizeHint) … … 4842 4727 else if (subRule.hasBox() || subRule.hasBorder()) { 4843 4728 QFontMetrics fm = opt ? opt->fontMetrics : w->fontMetrics(); 4844 return subRule.size(QSize(0, fm. lineSpacing())).height();4729 return subRule.size(QSize(0, fm.height())).height(); 4845 4730 } 4846 4731 break; … … 4927 4812 #ifndef QT_NO_SPINBOX 4928 4813 // ### hopelessly broken QAbstractSpinBox (part 2) 4929 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ->parentWidget())) {4814 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) { 4930 4815 QRenderRule rule = renderRule(spinBox, opt); 4931 4816 if (rule.hasBox() || !rule.hasNativeBorder()) … … 4974 4859 return QSize(sz.width(), subRule.size().height()); 4975 4860 } else if ((pe == PseudoElement_Item) && (subRule.hasBox() || subRule.hasBorder())) { 4976 int width = csz.width(), height = qMax(csz.height(), mi->fontMetrics.height()); 4977 if (!mi->icon.isNull()) { 4978 int iconExtent = pixelMetric(PM_SmallIconSize); 4979 height = qMax(height, mi->icon.actualSize(QSize(iconExtent, iconExtent)).height()); 4980 } 4981 width += mi->tabWidth; 4982 return subRule.boxSize(csz.expandedTo(subRule.minimumContentsSize())); 4861 int width = csz.width(); 4862 if (mi->text.contains(QLatin1Char('\t'))) 4863 width += 12; //as in QCommonStyle 4864 return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height()))); 4983 4865 } 4984 4866 } … … 5247 5129 s = QLatin1String("alignment"); 5248 5130 break; 5131 #ifndef QT_NO_TABBAR 5132 case SH_TabBar_CloseButtonPosition: 5133 rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); 5134 if (rule.hasPosition()) { 5135 Qt::Alignment align = rule.position()->position; 5136 if (align & Qt::AlignLeft || align & Qt::AlignTop) 5137 return QTabBar::LeftSide; 5138 if (align & Qt::AlignRight || align & Qt::AlignBottom) 5139 return QTabBar::RightSide; 5140 } 5141 break; 5142 #endif 5249 5143 case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; 5250 5144 case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; … … 5253 5147 if (qobject_cast<const QComboBox *>(w)) { 5254 5148 QAbstractItemView *view = qFindChild<QAbstractItemView *>(w); 5255 QRenderRule subRule = renderRule(view, PseudoElement_None); 5256 if (subRule.hasBox() || !subRule.hasNativeBorder()) 5257 return QFrame::NoFrame; 5149 if (view) { 5150 view->ensurePolished(); 5151 QRenderRule subRule = renderRule(view, PseudoElement_None); 5152 if (subRule.hasBox() || !subRule.hasNativeBorder()) 5153 return QFrame::NoFrame; 5154 } 5258 5155 } 5259 5156 #endif // QT_NO_COMBOBOX … … 5329 5226 QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); 5330 5227 bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder(); 5331 bool upRuleMatch = upRule.hasGeometry() ;5332 bool downRuleMatch = downRule.hasGeometry() ;5228 bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); 5229 bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition(); 5333 5230 if (ruleMatch || upRuleMatch || downRuleMatch) { 5334 5231 switch (sc) { … … 5822 5719 break; 5823 5720 } 5721 case SE_TabBarTabText: 5722 case SE_TabBarTabLeftButton: 5723 case SE_TabBarTabRightButton: { 5724 QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); 5725 if (subRule.hasBox() || !subRule.hasNativeBorder()) { 5726 return ParentStyle::subElementRect(se, opt, w); 5727 } 5728 break; 5729 } 5824 5730 #endif // QT_NO_TABBAR 5825 5731 … … 5843 5749 bool QStyleSheetStyle::event(QEvent *e) 5844 5750 { 5845 return baseStyle()->event(e) || ParentStyle::event(e);5751 return (baseStyle()->event(e) && e->isAccepted()) || ParentStyle::event(e); 5846 5752 } 5847 5753 … … 5888 5794 } 5889 5795 5890 // Returns the palette that should be used when the particular widget is focused. 5891 // This needs to be called by some widgets that do drawing themselves instead 5892 // of through the style. 5893 // ### This should be removed ideally by Qt 4.5, and at least by Qt 5, and fixed 5894 // for good by letting the style draw everything. 5796 // Polish palette that should be used for a particular widget, with particular states 5797 // (eg. :focus, :hover, ...) 5798 // this is called by widgets that paint themself in their paint event 5895 5799 // Returns true if there is a new palette in pal. 5896 bool QStyleSheetStyle:: focusPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal)5800 bool QStyleSheetStyle::styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal) 5897 5801 { 5898 5802 if (!w || !opt || !pal) -
trunk/src/gui/styles/qstylesheetstyle_default.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 155 155 Pseudo pseudo; 156 156 AttributeSelector attr; 157 157 158 158 // pixmap based style doesn't support any features 159 159 bool styleIsPixmapBased = baseStyle()->inherits("QMacStyle") 160 160 || baseStyle()->inherits("QWindowsXPStyle") 161 || baseStyle()->inherits("QGtkStyle"); 161 || baseStyle()->inherits("QGtkStyle") 162 || baseStyle()->inherits("QS60Style"); 162 163 163 164 … … 198 199 SET_PROPERTY(QLatin1String("border"), Border); 199 200 ADD_VALUE(Value::KnownIdentifier, Value_None); 200 ADD_DECLARATION;201 202 ADD_STYLE_RULE;203 }204 205 /*QLineEdit[style="QCleanlooksStyle"] {206 padding-top: 2px;207 padding-bottom: 2px;208 }*/209 if (baseStyle()->inherits("QCleanlooksStyle"))210 {211 SET_ELEMENT_NAME(QLatin1String("QLineEdit"));212 ADD_BASIC_SELECTOR;213 ADD_SELECTOR;214 215 216 SET_PROPERTY(QLatin1String("padding-top"), PaddingTop);217 ADD_VALUE(Value::Identifier, QString::fromLatin1("2px"));218 ADD_DECLARATION;219 220 SET_PROPERTY(QLatin1String("padding-bottom"), PaddingBottom);221 ADD_VALUE(Value::Identifier, QString::fromLatin1("2px"));222 ADD_DECLARATION;223 224 ADD_STYLE_RULE;225 }226 227 /*QLineEdit[style="QWindowsXPStyle"],228 QLineEdit[style="QWindowsVistaStyle"],229 QLineEdit[style="QGtkStyle"] {230 padding-top: 1px;231 padding-bottom: 1px;232 }*/233 if (baseStyle()->inherits("QWindowsXPStyle") || baseStyle()->inherits("QGtkStyle"))234 {235 SET_ELEMENT_NAME(QLatin1String("QLineEdit"));236 237 SET_PROPERTY(QLatin1String("padding-top"), PaddingTop);238 ADD_VALUE(Value::Identifier, QString::fromLatin1("1px"));239 ADD_DECLARATION;240 241 SET_PROPERTY(QLatin1String("padding-bottom"), PaddingBottom);242 ADD_VALUE(Value::Identifier, QString::fromLatin1("1px"));243 201 ADD_DECLARATION; 244 202 -
trunk/src/gui/styles/qstylesheetstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 132 132 void clearWidgetFont(QWidget* w) const; 133 133 134 bool focusPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal);134 bool styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal); 135 135 136 136 protected Q_SLOTS: -
trunk/src/gui/styles/qwindowscestyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 57 57 58 58 static const int windowsItemFrame = 2; // menu item frame width 59 static const int windowsSepHeight = 9; // separator item height60 59 static const int windowsItemHMargin = 3; // menu item hor text margin 61 60 static const int windowsItemVMargin = 2; // menu item ver text margin … … 1952 1951 break; 1953 1952 case SC_SpinBoxEditField: 1954 rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw); 1953 if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) { 1954 rect = QRect(lx, fw, spinbox->rect.width() - 2*fw - 2, spinbox->rect.height() - 2*fw); 1955 } else { 1956 rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw); 1957 } 1955 1958 break; 1956 1959 case SC_SpinBoxFrame: … … 2292 2295 case SH_EtchDisabledText: 2293 2296 ret = false; 2297 case SH_RequestSoftwareInputPanel: 2298 ret = RSIP_OnMouseClick; 2299 break; 2294 2300 default: 2295 2301 ret = QWindowsStyle::styleHint(hint, opt, widget, returnData); -
trunk/src/gui/styles/qwindowscestyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowscestyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowsmobilestyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 73 73 #include "qtabwidget.h" 74 74 75 #ifdef Q_ OS_WINCE75 #ifdef Q_WS_WINCE 76 76 #include "qt_windows.h" 77 77 #include "qguifunctions_wince.h" 78 extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp 79 extern bool qt_wince_is_smartphone(); //defined in qguifunctions_wince.cpp 80 #endif // Q_OS_WINCE 78 extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp 79 extern bool qt_wince_is_smartphone(); //defined in qguifunctions_wince.cpp 80 extern bool qt_wince_is_windows_mobile_65(); //defined in qguifunctions_wince.cpp 81 #endif // Q_WS_WINCE 81 82 82 83 QT_BEGIN_NAMESPACE 83 84 84 85 static const int windowsItemFrame = 1; // menu item frame width 85 static const int windowsItemHMargin = 2; // menu item hor text margin86 static const int windowsItemVMargin = 2; // menu item ver text margin87 static const int windowsArrowHMargin = 6; // arrow horizontal margin88 static const int windowsRightBorder = 15; // right border on windows89 static const int windowsCheckMarkWidth = 14; // checkmarks width on windows90 86 91 87 static const int windowsMobileitemViewCheckBoxSize = 13; … … 670 666 " "}; 671 667 668 #ifdef Q_WS_WINCE_WM 669 670 static char * sbhandleup_xpm[] = { 671 "26 41 45 1", 672 " c None", 673 ". c #000000", 674 "+ c #E7E7E7", 675 "@ c #D6D7D6", 676 "# c #949294", 677 "$ c #737573", 678 "% c #636563", 679 "& c #636163", 680 "* c #5A5D5A", 681 "= c #5A595A", 682 "- c #525552", 683 "; c #525152", 684 "> c #4A4D4A", 685 ", c #7B797B", 686 "' c #CECFCE", 687 ") c #CED3CE", 688 "! c #6B6D6B", 689 "~ c #6B696B", 690 "{ c #737173", 691 "] c #7B7D7B", 692 "^ c #848684", 693 "/ c #848284", 694 "( c #8C8A8C", 695 "_ c #8C8E8C", 696 ": c #B5B2B5", 697 "< c #FFFFFF", 698 "[ c #949694", 699 "} c #B5B6B5", 700 "| c #9C9A9C", 701 "1 c #ADAEAD", 702 "2 c #9C9E9C", 703 "3 c #BDBABD", 704 "4 c #BDBEBD", 705 "5 c #F7F3F7", 706 "6 c #C6C3C6", 707 "7 c #C6C7C6", 708 "8 c #A5A2A5", 709 "9 c #CECBCE", 710 "0 c #FFFBFF", 711 "a c #ADAAAD", 712 "b c #A5A6A5", 713 "c c #D6D3D6", 714 "d c #B5BAB5", 715 "e c #DEDFDE", 716 "f c #DEDBDE", 717 "..........................", 718 "+@#$%%&&&**===---;;;;>=,'+", 719 "+@#$%%&&&**===---;;;;>=$'+", 720 ")$!!~~%%&&&**===---;;;;>;'", 721 "#{$]],,$${{{!!~~%%%&&&*-;]", 722 "#{$]],,$${{{!!~~%%%&&&*-;]", 723 ",$^//]],,$${{{!!~~%%%&&*;*", 724 ",,(^^//]],$${!!!!!~~%%%&-*", 725 ",,(^^//]],$${!!!!!~~%%%&-*", 726 "]]_((^^//]$!%%~!{{!!~~%%-*", 727 "//#__((^^]{:<<:~!{{{!!~~=*", 728 "//#__((^^]{:<<:~!{{{!!~~=&", 729 "//###__(/$:<<<<:~{${{!!~*&", 730 "^^[[##_^]:<<<<<<}!{$${{!*%", 731 "^^[[##_^]:<<<<<<}!{$${{!*%", 732 "((|[[#_/:<<<<<<<<}!$$${{&~", 733 "((||[#^1<<<<1:<<<<}!$$$$&~", 734 "((||[#^1<<<<1:<<<<}!$$$$&~", 735 "__2|#(1<<<<}],}<<<<}{$,$%~", 736 "##2|_1<<<<}^((]3<<<<}{$,~!", 737 "##2|_1<<<<}^((]3<<<<}{$,~!", 738 "##2#1<<<<3^###(/4<<<<}{,~{", 739 "##2#1<<<<3^###(/4<<<<}{,~!", 740 "[[2_5<<<4(#|[[#_/6<<<<,,!{", 741 "[|2_5<<4_[||||[[_/7<<<,]{$", 742 "[|2_5<<4_[||||[[_/7<<<,]{$", 743 "||8_5<6#|2222|||[_/9<<,]{$", 744 "228#06[28888222||[_/'<,/$,", 745 "228#06[28888222||[_/'<,/$,", 746 "22a|6[8bbbb88822||[(/c](,]", 747 "881b8baaabbbb88222|[(^(_,]", 748 "881b8baaabbbb88222|[(^(_,]", 749 "88111111aaabbb88822|[###]/", 750 "bb:::11111aaabbb8822||[[/^", 751 "bb:::11111aaabbb8822||[[//", 752 "bb:::::1111aaabbb8822||[/(", 753 "3a1::::::1111aaabb8822|_^8", 754 "da1::::::1111aaabb8822|_^8", 755 "e1aaabbbb888822||[[##__((@", 756 "+e4:aaabbbb88822||[[[#[b@+", 757 "+e4:aaabbbb88822||[[[#[bf+"}; 758 759 static char * sbhandledown_xpm[] = { 760 "26 40 46 1", 761 " c None", 762 ". c #E7E7E7", 763 "+ c #DEDFDE", 764 "@ c #BDBEBD", 765 "# c #B5B2B5", 766 "$ c #ADAAAD", 767 "% c #A5A6A5", 768 "& c #A5A2A5", 769 "* c #9C9E9C", 770 "= c #9C9A9C", 771 "- c #949694", 772 "; c #949294", 773 "> c #D6D7D6", 774 ", c #DEDBDE", 775 "' c #D6DBD6", 776 ") c #ADAEAD", 777 "! c #8C8E8C", 778 "~ c #8C8A8C", 779 "{ c #BDBABD", 780 "] c #848684", 781 "^ c #B5BAB5", 782 "/ c #848284", 783 "( c #848A84", 784 "_ c #7B7D7B", 785 ": c #7B797B", 786 "< c #C6C3C6", 787 "[ c #D6D3D6", 788 "} c #FFFBFF", 789 "| c #CECFCE", 790 "1 c #FFFFFF", 791 "2 c #737573", 792 "3 c #F7F3F7", 793 "4 c #CECBCE", 794 "5 c #737173", 795 "6 c #C6C7C6", 796 "7 c #6B6D6B", 797 "8 c #B5B6B5", 798 "9 c #6B696B", 799 "0 c #636563", 800 "a c #636163", 801 "b c #5A5D5A", 802 "c c #5A595A", 803 "d c #525552", 804 "e c #525152", 805 "f c #4A4D4A", 806 "g c #C6CBC6", 807 ".+@#$$$%%%%&&&**==---;-%>.", 808 ".+@#$$$%%%%&&&**==---;-%,.", 809 "')$$$%%%%&&&&**==--;;!!~~>", 810 "{$)######))))$$$%%&&**=!]&", 811 "^$)######))))$$$%%&&**=!]&", 812 "%%#####))))$$$%%%&&**==-/(", 813 "%%###)))))$$$%%%&&**==--/]", 814 "%%###)))))$$$%%%&&**==--//", 815 "&&))))))$$$%%%&&&**=-;;;_/", 816 "&&)%&%$$$%%%%&&***=-~]~!:_", 817 "&&)%&%$$$%%%%&&***=-~]~!:_", 818 "**$=<-&%%%%&&&**==-~/[_~:_", 819 "**&;}<-*&&&&***==-!/|1:/2:", 820 "**&;}<-*&&&&***==-!/|1:/2:", 821 "==&!31<;=****===-!/411:_5:", 822 "-=*!311@!-====--!/6111:_52", 823 "-=*!311@!-====--!/6111:_52", 824 "--*!3111@~;=--;!/<1111::75", 825 ";;*;)1111{];;;~/@111185:95", 826 ";;*;)1111{];;;~/@111185:97", 827 ";;*=!)11118]~~_{1111852:97", 828 ";;*=!)11118]~~_{1111852:97", 829 "!!*=;~)11118_:81111852:207", 830 "~~==-;])1111)#1111872222a9", 831 "~~==-;])1111)#1111872222a9", 832 "~~=--;!/#111111118722255a0", 833 "]]--;;!]_#11111187522557b0", 834 "]]--;;!]_#11111187522557b0", 835 "//;;;!!~/2#1111#95255779ba", 836 "//;!!~~]]_5#11#975557799cb", 837 "//;!!~~]]_5#11#975557799ca", 838 "__!~~]]//_27009755779900db", 839 "::~]]//__:2257777799000adb", 840 "::~]]//__:2257777799000adb", 841 ":2]//__::225557799000aabeb", 842 ";52__::225557799000aaabde_", 843 ";52__::225557799000aaabde_", 844 "[2779900aaabbcccdddeeeefeg", 845 ".>;200aaabbcccdddeeeefc:|.", 846 ".>;200aaabbcccdddeeeefc2|."}; 847 848 static char * sbgripdown_xpm[] = { 849 "26 34 39 1", 850 " c None", 851 ". c #949294", 852 "+ c #9C9E9C", 853 "@ c #9C9A9C", 854 "# c #949694", 855 "$ c #8C8E8C", 856 "% c #8C8A8C", 857 "& c #848684", 858 "* c #848284", 859 "= c #7B7D7B", 860 "- c #7B797B", 861 "; c #6B696B", 862 "> c #636563", 863 ", c #737573", 864 "' c #636163", 865 ") c #737173", 866 "! c #5A5D5A", 867 "~ c #6B6D6B", 868 "{ c #5A595A", 869 "] c #B5B6B5", 870 "^ c #BDBEBD", 871 "/ c #ADAEAD", 872 "( c #BDBABD", 873 "_ c #525552", 874 ": c #313031", 875 "< c #525152", 876 "[ c #ADAAAD", 877 "} c #BDBAB5", 878 "| c #4A4D4A", 879 "1 c #4A494A", 880 "2 c #C6C3C6", 881 "3 c #C6CBC6", 882 "4 c #E7E7E7", 883 "5 c #DEDFDE", 884 "6 c #E7E3E7", 885 "7 c #DEE3DE", 886 "8 c #CECBCE", 887 "9 c #8C928C", 888 "0 c #CECFCE", 889 "..+++@@@###...$$%&&**==-;>", 890 "$.++@@@@##...$$%%&**==-->>", 891 "$$+@@@@###..$$%%&&*==--,>>", 892 "$$@@@@###..$$%%&&**==-,,>'", 893 "%%@@@###..$$$%&&**==--,,''", 894 "%%@@###..$$$%&&**==--,,)''", 895 "%%@###...$$%%&&*==--,,))'!", 896 "&&###...$$%%&&**==--,)))!!", 897 "&&##...$$%%&&**==--,,))~!!", 898 "&&#...$$%%&&**==--,,))~~!{", 899 "**...$$%%&&**==--,,))~~;!{", 900 "**..$$%%&&**===--,)))~~;{{", 901 "**.$$%%&]^&===//,,))~~;;{{", 902 "==$$%%&&]^*==-((,))~~;;>{_", 903 "==$%%&&***::--,,::~~;;;>__", 904 "==%%&&&**=::-,,)::~~;;>>__", 905 "--%&&&**==--,,)))~~;;>>>__", 906 "--&&&**==--,,)))~~;;>>>'_<", 907 ",-&&**==]^-,))[[~;;>>>''<<", 908 ",,&**==-]^-)))}};;>>>'''<<", 909 ",,**==--,,::)~~;::>>'''!<<", 910 "))*==--,,)::~~;;::>'''!!<|", 911 "))==--,,)))~~;;;>>'''!!!||", 912 "))=--,,)))~~;;;>>'''!!!{||", 913 "~~--,,)))~~;;;>>'''!!!{{||", 914 "~~-,,)))~~;;>>>'''!!!{{{|1", 915 ";;,,)))~~;;>>>'''!!!{{{_1<", 916 "~;,)))~~;;>>>'''!!!{{{__1'", 917 "%>~))~~;;>>>'''!!!{{{__|1$", 918 "2>>~~~;;>>>''!!!{{{{__<113", 919 "4%'';;;>>>''!!!{{{{__<11%4", 920 "45-!!'>>>''!!!{{{{_<|11)64", 921 "447+!{{___<<<||||1111|+444", 922 "444489~__<<<||||111>$04444"}; 923 924 static char * sbgripup_xpm[] = { 925 "26 34 38 1", 926 " c None", 927 ". c #E7E7E7", 928 "+ c #D6DBD6", 929 "@ c #C6C7C6", 930 "# c #B5B6B5", 931 "$ c #ADAEAD", 932 "% c #ADAAAD", 933 "& c #A5A6A5", 934 "* c #A5A2A5", 935 "= c #BDBEBD", 936 "- c #DEDFDE", 937 "; c #C6CBC6", 938 "> c #9C9E9C", 939 ", c #E7E3E7", 940 "' c #BDBABD", 941 ") c #B5B2B5", 942 "! c #9C9A9C", 943 "~ c #DEE3DE", 944 "{ c #949694", 945 "] c #D6D7D6", 946 "^ c #949294", 947 "/ c #DEDBDE", 948 "( c #8C8E8C", 949 "_ c #8C8A8C", 950 ": c #848684", 951 "< c #D6D3CE", 952 "[ c #CECBCE", 953 "} c #D6D3D6", 954 "| c #848284", 955 "1 c #313031", 956 "2 c #7B7D7B", 957 "3 c #CECFCE", 958 "4 c #CECBC6", 959 "5 c #7B797B", 960 "6 c #737573", 961 "7 c #737173", 962 "8 c #6B6D6B", 963 "9 c #6B696B", 964 "....+@#$$%%%%&&&***$=-....", 965 "...;$$$$$%%%&&&&**>>>>@...", 966 ".,'$$)#'#####)))$$$%*!!$~.", 967 ".=$)#'''####))))$$$%%*!{'.", 968 "]$$''''#####)))$$$%%%&*{^/", 969 "=$#'''#####)))$$$$%%&&&!^#", 970 "$$'''#####))))$$$%%%&&*>(!", 971 "$$''#####))))$$$%%%&&&*>(^", 972 "$$######))))$$$$%%&&&**>(_", 973 "%$#####))))$$$$%%%&&***>__", 974 "%$####))))$$$$%%%&&&**>>__", 975 "%%###)))))$$$%%%&&&**>>>_:", 976 "%%##))))<])$$%[[&&***>>!::", 977 "%%#)))))<]$$%%}<&&**>>!!:|", 978 "&%)))))$$$11%%&&11*>>>!!:|", 979 "&&))))$$$$11%&&&11*>>!!{||", 980 "&&)))$$$$$%%%&&&**>>!!!{|2", 981 "&&))$$$$$%%%&&&**>>>!!{{|2", 982 "*&)$$$$$3]%&&&4@*>>!!{{{22", 983 "**$$$$$%3]%&&&<<>>!!!{{^25", 984 "**$$$$%%%%11&**>11!!{{^^25", 985 "**$$$%%%%&11***>11!!{{^^55", 986 "**$$%%%%&&&***>>!!!{{^^(55", 987 ">>$%%%%&&&***>>>!!{{^^((56", 988 ">>%%%%&&&&***>>!!!{{^^((66", 989 ">>%%%&&&&***>>!!!{{^^((_67", 990 "!>%%&&&&***>>>!!{{{^^(__67", 991 "!!%&&&&***>>>!!!{{^^((_:77", 992 "!!&&&&***>>>!!!{{^^((__:77", 993 "!!&&&****>>!!!{{^^^(__::78", 994 "{!&&****>>>!!{{{^^((_::|88", 995 "{{&****>>>!!!{{^^((__:||88", 996 "{{****>>>!!!{{^^^(__::|289", 997 "{{***>>>!!!{{{^^((_::||289"}; 998 999 static char * sbgripmiddle_xpm[] = { 1000 "26 2 12 1", 1001 " c None", 1002 ". c #949294", 1003 "+ c #A5A2A5", 1004 "@ c #9C9E9C", 1005 "# c #9C9A9C", 1006 "$ c #949694", 1007 "% c #8C8E8C", 1008 "& c #8C8A8C", 1009 "* c #848684", 1010 "= c #848284", 1011 "- c #7B7D7B", 1012 "; c #6B696B", 1013 "..++@@@###$$$..%%&&*==--;;", 1014 "..++@@@###$$$..%%&&*==--;;"}; 1015 1016 1017 static char * listviewhighmiddle_xpm[] = { 1018 "8 46 197 2", 1019 " c None", 1020 ". c #66759E", 1021 "+ c #6C789D", 1022 "@ c #6A789E", 1023 "# c #6B789E", 1024 "$ c #6A779D", 1025 "% c #6C789C", 1026 "& c #6F7D9B", 1027 "* c #6F7D9A", 1028 "= c #9DB6EE", 1029 "- c #9DB6ED", 1030 "; c #9CB6ED", 1031 "> c #A1B6EF", 1032 ", c #A2B6F0", 1033 "' c #93AAE9", 1034 ") c #95ABEA", 1035 "! c #94ABEA", 1036 "~ c #94A9E8", 1037 "{ c #8BA8EA", 1038 "] c #8BA7EA", 1039 "^ c #8AA7EA", 1040 "/ c #8EAAE8", 1041 "( c #8FAAE8", 1042 "_ c #88A2E7", 1043 ": c #8CA3E8", 1044 "< c #8BA3E7", 1045 "[ c #8BA3E8", 1046 "} c #8BA2E7", 1047 "| c #8CA2E7", 1048 "1 c #8DA2E7", 1049 "2 c #87A1E8", 1050 "3 c #87A1E9", 1051 "4 c #86A0E8", 1052 "5 c #86A1E7", 1053 "6 c #87A2E7", 1054 "7 c #859EE9", 1055 "8 c #849DE9", 1056 "9 c #869EE9", 1057 "0 c #869FE9", 1058 "a c #7C9BEA", 1059 "b c #7C9CEA", 1060 "c c #7B9CEA", 1061 "d c #7C9BE9", 1062 "e c #7E9CE9", 1063 "f c #7B9AEA", 1064 "g c #7C99E9", 1065 "h c #7C9AEA", 1066 "i c #7B9AE8", 1067 "j c #7A9AEA", 1068 "k c #7996E1", 1069 "l c #7C96E4", 1070 "m c #7B96E3", 1071 "n c #7B95E3", 1072 "o c #7E95E5", 1073 "p c #7E95E6", 1074 "q c #7292E1", 1075 "r c #7490DF", 1076 "s c #7591E0", 1077 "t c #7590DF", 1078 "u c #7392E1", 1079 "v c #6D8CDE", 1080 "w c #6F8EDD", 1081 "x c #6E8DDD", 1082 "y c #6E8DDE", 1083 "z c #6F8EDE", 1084 "A c #6E8EDE", 1085 "B c #718EDD", 1086 "C c #728EDD", 1087 "D c #6B89E0", 1088 "E c #6C89DF", 1089 "F c #6D89E0", 1090 "G c #6D89DF", 1091 "H c #6C88DF", 1092 "I c #6D88DF", 1093 "J c #6D86DD", 1094 "K c #6086E0", 1095 "L c #6686E0", 1096 "M c #6586E0", 1097 "N c #6486E0", 1098 "O c #6485E0", 1099 "P c #6786DF", 1100 "Q c #5F85E0", 1101 "R c #6583DE", 1102 "S c #6683DE", 1103 "T c #6682DD", 1104 "U c #6086DF", 1105 "V c #5F86E0", 1106 "W c #567ED7", 1107 "X c #567ED8", 1108 "Y c #557DD7", 1109 "Z c #5A7FD8", 1110 "` c #6281DA", 1111 " . c #5379D9", 1112 ".. c #5278D9", 1113 "+. c #547BD8", 1114 "@. c #4C73D7", 1115 "#. c #4B72D2", 1116 "$. c #4C73D4", 1117 "%. c #4C73D3", 1118 "&. c #4B72D4", 1119 "*. c #4F75D3", 1120 "=. c #5074D2", 1121 "-. c #4971D0", 1122 ";. c #4871D0", 1123 ">. c #335ECF", 1124 ",. c #325ECB", 1125 "'. c #335ECD", 1126 "). c #335ECE", 1127 "!. c #325DCD", 1128 "~. c #2E59C9", 1129 "{. c #3059C9", 1130 "]. c #2F59C9", 1131 "^. c #2F59C8", 1132 "/. c #2B59CA", 1133 "(. c #3355C6", 1134 "_. c #3354C5", 1135 ":. c #3156C7", 1136 "<. c #3056C7", 1137 "[. c #3355C7", 1138 "}. c #3355C5", 1139 "|. c #254EBF", 1140 "1. c #1F51C1", 1141 "2. c #234FC0", 1142 "3. c #234FBF", 1143 "4. c #2350C0", 1144 "5. c #1E50BE", 1145 "6. c #1D50C0", 1146 "7. c #264DBE", 1147 "8. c #264CBD", 1148 "9. c #254DBE", 1149 "0. c #244EBF", 1150 "a. c #254DBF", 1151 "b. c #234CBF", 1152 "c. c #244CC0", 1153 "d. c #244BC0", 1154 "e. c #234BC0", 1155 "f. c #234BBF", 1156 "g. c #234CBE", 1157 "h. c #2049B7", 1158 "i. c #2A49B5", 1159 "j. c #2749B5", 1160 "k. c #2749B6", 1161 "l. c #2D49B4", 1162 "m. c #2649B6", 1163 "n. c #2946B5", 1164 "o. c #2A48B6", 1165 "p. c #2947B5", 1166 "q. c #2946B6", 1167 "r. c #2848B6", 1168 "s. c #2549B5", 1169 "t. c #2648B6", 1170 "u. c #2744B5", 1171 "v. c #2744B4", 1172 "w. c #2744AF", 1173 "x. c #2543B4", 1174 "y. c #2543B2", 1175 "z. c #2442B2", 1176 "A. c #2442B3", 1177 "B. c #2442B5", 1178 "C. c #2543B3", 1179 "D. c #1F40B1", 1180 "E. c #1E40B1", 1181 "F. c #243EAE", 1182 "G. c #273BAC", 1183 "H. c #263DAC", 1184 "I. c #253CAB", 1185 "J. c #273CAB", 1186 "K. c #273CAC", 1187 "L. c #263BAA", 1188 "M. c #253CAE", 1189 "N. c #263BA6", 1190 "O. c #253BA5", 1191 "P. c #253AA5", 1192 "Q. c #253BA6", 1193 "R. c #253CA7", 1194 "S. c #263AA6", 1195 "T. c #243CA6", 1196 "U. c #253CA5", 1197 "V. c #273BA8", 1198 "W. c #2F4DA4", 1199 "X. c #2F4DA3", 1200 "Y. c #1B2F85", 1201 "Z. c #B5B5B6", 1202 "`. c #B5B5B5", 1203 " + c #B5B6B6", 1204 ".+ c #B5B4B6", 1205 "++ c #C2C3C5", 1206 "@+ c #C0C3C3", 1207 "#+ c #C1C3C4", 1208 "$+ c #E3E3E3", 1209 "%+ c #E3E3E4", 1210 "&+ c #E4E3E4", 1211 "*+ c #E2E3E4", 1212 "=+ c #ECEEEB", 1213 "-+ c #EBEDEA", 1214 ";+ c #EEF0ED", 1215 ">+ c #EFF0EE", 1216 ". + @ @ # # $ % ", 1217 "& & * & & & & & ", 1218 "= = - = = ; > , ", 1219 "' ) ! ! ! ) ' ~ ", 1220 "{ ] { { { ^ / ( ", 1221 "_ : < [ : } | 1 ", 1222 "2 2 2 3 2 4 5 6 ", 1223 "7 7 7 7 7 8 9 0 ", 1224 "a b a a a c d e ", 1225 "f g h h h h i j ", 1226 "k l m m m n o p ", 1227 "q q q q q q q q ", 1228 "r r s s s t q u ", 1229 "v w x y z A B C ", 1230 "D E F F G F H I ", 1231 "J K L M N O P Q ", 1232 "R R S S S T U V ", 1233 "W W X X X Y Z ` ", 1234 " . . . . ...+.W ", 1235 " . . . . ..... .", 1236 "@.#.$.$.%.&.*.=.", 1237 "-.-.;.-.-.-.-.-.", 1238 ">.,.'.).).!.!.>.", 1239 "~.{.].^.].^././.", 1240 "(.(.(.(.(._.:.<.", 1241 "(.(.[.[.[.[.(.}.", 1242 "|.1.2.3.3.4.5.6.", 1243 "7.7.7.7.7.8.9.0.", 1244 "a.b.c.d.c.e.f.g.", 1245 "h.i.j.k.j.k.l.m.", 1246 "n.o.p.q.r.p.s.t.", 1247 "u.u.v.u.u.u.u.u.", 1248 "w.x.y.z.A.y.B.C.", 1249 "D.D.E.D.D.D.D.D.", 1250 "D.D.E.D.D.D.D.D.", 1251 "F.G.H.I.J.K.L.M.", 1252 "N.N.O.N.N.P.Q.R.", 1253 "N.N.S.N.N.N.N.N.", 1254 "T.N.T.T.T.U.N.V.", 1255 "W.W.X.W.W.W.W.W.", 1256 "W.W.W.W.W.W.W.W.", 1257 "Y.Y.Y.Y.Y.Y.Y.Y.", 1258 "Z.`. + +.+Z.`.`.", 1259 "++@+#+#+#+#+@+@+", 1260 "$+%+&+&+*+%+%+%+", 1261 "=+-+;+-+-+>+-+-+"}; 1262 1263 1264 1265 static char * listviewhighcornerleft_xpm[] = { 1266 "100 46 1475 2", 1267 " c None", 1268 ". c #FBFBFC", 1269 "+ c #E8EAE7", 1270 "@ c #758DC3", 1271 "# c #42599E", 1272 "$ c #28418A", 1273 "% c #19418F", 1274 "& c #3F5695", 1275 "* c #415896", 1276 "= c #435A98", 1277 "- c #445C99", 1278 "; c #465E9B", 1279 "> c #48609B", 1280 ", c #49629C", 1281 "' c #4A639D", 1282 ") c #49639D", 1283 "! c #4A629D", 1284 "~ c #4B639D", 1285 "{ c #4B649D", 1286 "] c #4C659D", 1287 "^ c #4D669D", 1288 "/ c #4E689D", 1289 "( c #506A9D", 1290 "_ c #516A9D", 1291 ": c #536B9C", 1292 "< c #546C9C", 1293 "[ c #566D9B", 1294 "} c #576D9B", 1295 "| c #586E9C", 1296 "1 c #5B6F9D", 1297 "2 c #61739D", 1298 "3 c #63749E", 1299 "4 c #64749E", 1300 "5 c #68769E", 1301 "6 c #6A779E", 1302 "7 c #6B789E", 1303 "8 c #66759E", 1304 "9 c #6C789D", 1305 "0 c #EEF0ED", 1306 "a c #D0D3DC", 1307 "b c #3E51A3", 1308 "c c #28428B", 1309 "d c #29428C", 1310 "e c #425996", 1311 "f c #455C99", 1312 "g c #485F9C", 1313 "h c #49619E", 1314 "i c #4A63A0", 1315 "j c #4B64A1", 1316 "k c #4B65A1", 1317 "l c #4C66A2", 1318 "m c #4D67A2", 1319 "n c #4F69A1", 1320 "o c #516AA1", 1321 "p c #536CA0", 1322 "q c #556DA1", 1323 "r c #576EA0", 1324 "s c #586F9F", 1325 "t c #586E9F", 1326 "u c #596F9E", 1327 "v c #5A6F9E", 1328 "w c #5C709E", 1329 "x c #5E719E", 1330 "y c #5F729F", 1331 "z c #62739F", 1332 "A c #63739E", 1333 "B c #64749D", 1334 "C c #65749E", 1335 "D c #69769D", 1336 "E c #6C799E", 1337 "F c #6D799F", 1338 "G c #707D9F", 1339 "H c #717F9E", 1340 "I c #6E7AA1", 1341 "J c #6C789E", 1342 "K c #6F7C9C", 1343 "L c #6F7D9B", 1344 "M c #2A4AA0", 1345 "N c #4971D0", 1346 "O c #4C72D8", 1347 "P c #5472C0", 1348 "Q c #5573BF", 1349 "R c #5774BF", 1350 "S c #5875BF", 1351 "T c #5976C1", 1352 "U c #5A76C1", 1353 "V c #5C78C2", 1354 "W c #5E7AC2", 1355 "X c #607CC3", 1356 "Y c #627EC3", 1357 "Z c #637FC4", 1358 "` c #6581C5", 1359 " . c #6682C6", 1360 ".. c #6783C7", 1361 "+. c #6984C8", 1362 "@. c #6B85C9", 1363 "#. c #6D87CA", 1364 "$. c #6F89CB", 1365 "%. c #718CCD", 1366 "&. c #748ECF", 1367 "*. c #7690D0", 1368 "=. c #7992D2", 1369 "-. c #7A93D3", 1370 ";. c #7C95D5", 1371 ">. c #7F98D7", 1372 ",. c #8099D8", 1373 "'. c #859CDB", 1374 "). c #8AA0DD", 1375 "!. c #8DA3DF", 1376 "~. c #8FA5E0", 1377 "{. c #90A5E0", 1378 "]. c #91A6E1", 1379 "^. c #91A5E1", 1380 "/. c #90A4E0", 1381 "(. c #8EA3DE", 1382 "_. c #92A6E2", 1383 ":. c #8FA4DF", 1384 "<. c #90A5DE", 1385 "[. c #90A5DC", 1386 "}. c #90A6DB", 1387 "|. c #91A6E0", 1388 "1. c #93A7E2", 1389 "2. c #95AAE6", 1390 "3. c #99AEEA", 1391 "4. c #9AB2EA", 1392 "5. c #99B1E9", 1393 "6. c #99B1E7", 1394 "7. c #98AFE6", 1395 "8. c #93A8E2", 1396 "9. c #97ACE7", 1397 "0. c #9AB3EB", 1398 "a. c #9DB5ED", 1399 "b. c #9DB6EE", 1400 "c. c #375095", 1401 "d. c #4056AD", 1402 "e. c #506DCD", 1403 "f. c #4360CC", 1404 "g. c #345ED6", 1405 "h. c #335ECF", 1406 "i. c #355ED6", 1407 "j. c #355FD6", 1408 "k. c #365FD6", 1409 "l. c #355FD0", 1410 "m. c #3760D5", 1411 "n. c #3A63D4", 1412 "o. c #3C63D1", 1413 "p. c #3B63CD", 1414 "q. c #3B63C9", 1415 "r. c #3B62C9", 1416 "s. c #3D63C8", 1417 "t. c #4065C5", 1418 "u. c #4567C5", 1419 "v. c #496BC5", 1420 "w. c #4F70C7", 1421 "x. c #5273C8", 1422 "y. c #5475CA", 1423 "z. c #5777CB", 1424 "A. c #5879CD", 1425 "B. c #5A7BCE", 1426 "C. c #5D7DCF", 1427 "D. c #5F7ECF", 1428 "E. c #617FD0", 1429 "F. c #6381D1", 1430 "G. c #6583D2", 1431 "H. c #6785D2", 1432 "I. c #6886D3", 1433 "J. c #6A88D4", 1434 "K. c #6C89D5", 1435 "L. c #6E8BD6", 1436 "M. c #708CD7", 1437 "N. c #718DD8", 1438 "O. c #738EDA", 1439 "P. c #748FDB", 1440 "Q. c #7691DC", 1441 "R. c #7893DD", 1442 "S. c #7994DD", 1443 "T. c #7A96DE", 1444 "U. c #7B97DF", 1445 "V. c #7C98E0", 1446 "W. c #7E9AE2", 1447 "X. c #7F9BE3", 1448 "Y. c #829DE4", 1449 "Z. c #849FE5", 1450 "`. c #87A0E6", 1451 " + c #88A1E7", 1452 ".+ c #89A2E6", 1453 "++ c #8CA3E7", 1454 "@+ c #8EA5E9", 1455 "#+ c #8EA6E9", 1456 "$+ c #8FA7E9", 1457 "%+ c #8FA8E8", 1458 "&+ c #8FA9E8", 1459 "*+ c #91A9E8", 1460 "=+ c #90A7E8", 1461 "-+ c #8FA8EA", 1462 ";+ c #90AAEA", 1463 ">+ c #93ABEA", 1464 ",+ c #95ABEA", 1465 "'+ c #93ABE9", 1466 ")+ c #94ABEA", 1467 "!+ c #90A9EA", 1468 "~+ c #93AAE9", 1469 "{+ c #273E7E", 1470 "]+ c #345ED5", 1471 "^+ c #3D60CE", 1472 "/+ c #3D60CF", 1473 "(+ c #345ECF", 1474 "_+ c #335ED0", 1475 ":+ c #355FD3", 1476 "<+ c #3A60CE", 1477 "[+ c #3A5FCB", 1478 "}+ c #385FC9", 1479 "|+ c #3B60C8", 1480 "1+ c #3C63CB", 1481 "2+ c #3E64CB", 1482 "3+ c #4166CA", 1483 "4+ c #4568C9", 1484 "5+ c #4A6CC7", 1485 "6+ c #4F71C8", 1486 "7+ c #5172CA", 1487 "8+ c #5475CE", 1488 "9+ c #5678D3", 1489 "0+ c #597CD6", 1490 "a+ c #5C7ED7", 1491 "b+ c #5E7FD8", 1492 "c+ c #6181D9", 1493 "d+ c #6383DA", 1494 "e+ c #6585DA", 1495 "f+ c #6786DB", 1496 "g+ c #6988DC", 1497 "h+ c #6B8ADD", 1498 "i+ c #6D8BDE", 1499 "j+ c #6F8DDE", 1500 "k+ c #718EDF", 1501 "l+ c #728FE0", 1502 "m+ c #7390E1", 1503 "n+ c #7390E2", 1504 "o+ c #7491E3", 1505 "p+ c #7592E4", 1506 "q+ c #7693E4", 1507 "r+ c #7794E5", 1508 "s+ c #7894E5", 1509 "t+ c #7995E6", 1510 "u+ c #7B96E6", 1511 "v+ c #7C97E7", 1512 "w+ c #7D9AE8", 1513 "x+ c #7F9CE9", 1514 "y+ c #829DE9", 1515 "z+ c #849EE9", 1516 "A+ c #859EE9", 1517 "B+ c #87A0E7", 1518 "C+ c #8AA2E7", 1519 "D+ c #8BA3E8", 1520 "E+ c #89A2E7", 1521 "F+ c #8CA6EA", 1522 "G+ c #8BA6EA", 1523 "H+ c #8BA7EA", 1524 "I+ c #8CA3E8", 1525 "J+ c #8BA8EA", 1526 "K+ c #8CA7EA", 1527 "L+ c #8CA8EA", 1528 "M+ c #4659C7", 1529 "N+ c #355ECF", 1530 "O+ c #3660CF", 1531 "P+ c #3860CE", 1532 "Q+ c #3961CD", 1533 "R+ c #3B61CB", 1534 "S+ c #3B61CA", 1535 "T+ c #3D62CA", 1536 "U+ c #3D63CA", 1537 "V+ c #4165CB", 1538 "W+ c #456ACB", 1539 "X+ c #4B6FCD", 1540 "Y+ c #5174CE", 1541 "Z+ c #5275D1", 1542 "`+ c #5477D4", 1543 " @ c #5678D9", 1544 ".@ c #587ADB", 1545 "+@ c #597BDB", 1546 "@@ c #5B7DDC", 1547 "#@ c #5E7FDC", 1548 "$@ c #6081DD", 1549 "%@ c #6283DE", 1550 "&@ c #6484DF", 1551 "*@ c #6787E0", 1552 "=@ c #6989E1", 1553 "-@ c #6B8BE1", 1554 ";@ c #6D8DE2", 1555 ">@ c #6F8EE3", 1556 ",@ c #718FE4", 1557 "'@ c #7290E4", 1558 ")@ c #7491E5", 1559 "!@ c #7692E6", 1560 "~@ c #7793E5", 1561 "{@ c #7894E6", 1562 "]@ c #7895E7", 1563 "^@ c #7996E8", 1564 "/@ c #7A97E8", 1565 "(@ c #7B98E9", 1566 "_@ c #7D99E8", 1567 ":@ c #7F9AE8", 1568 "<@ c #7F9BE9", 1569 "[@ c #7F9CEA", 1570 "}@ c #859EE8", 1571 "|@ c #859FE8", 1572 "1@ c #85A0E9", 1573 "2@ c #869FE9", 1574 "3@ c #86A1E7", 1575 "4@ c #86A0E9", 1576 "5@ c #87A1E7", 1577 "6@ c #88A2E7", 1578 "7@ c #87A1E9", 1579 "8@ c #5A6FCA", 1580 "9@ c #365FCF", 1581 "0@ c #345ED0", 1582 "a@ c #385FCC", 1583 "b@ c #385FCE", 1584 "c@ c #3A61CC", 1585 "d@ c #3B62CD", 1586 "e@ c #3E64CD", 1587 "f@ c #4167CF", 1588 "g@ c #4469CF", 1589 "h@ c #486CD1", 1590 "i@ c #4D71D2", 1591 "j@ c #5175D4", 1592 "k@ c #5376D6", 1593 "l@ c #5578DA", 1594 "m@ c #5679DC", 1595 "n@ c #587BDD", 1596 "o@ c #5A7DDE", 1597 "p@ c #5D80DE", 1598 "q@ c #5F82DF", 1599 "r@ c #6284DF", 1600 "s@ c #6585E0", 1601 "t@ c #6787E1", 1602 "u@ c #6988E2", 1603 "v@ c #6B8AE2", 1604 "w@ c #6D8CE3", 1605 "x@ c #6E8DE3", 1606 "y@ c #708EE4", 1607 "z@ c #718FE3", 1608 "A@ c #7391E4", 1609 "B@ c #7592E5", 1610 "C@ c #7895E5", 1611 "D@ c #7996E6", 1612 "E@ c #7A97E6", 1613 "F@ c #7B98E7", 1614 "G@ c #7A98E8", 1615 "H@ c #7B99E9", 1616 "I@ c #7E9AE9", 1617 "J@ c #7D9AE9", 1618 "K@ c #7E9AEA", 1619 "L@ c #809CE9", 1620 "M@ c #819DE8", 1621 "N@ c #7F9BEA", 1622 "O@ c #819DE9", 1623 "P@ c #819CE9", 1624 "Q@ c #839EE9", 1625 "R@ c #839EE8", 1626 "S@ c #839DEA", 1627 "T@ c #859FE9", 1628 "U@ c #87A0E8", 1629 "V@ c #86A0E8", 1630 "W@ c #87A1E8", 1631 "X@ c #3760CF", 1632 "Y@ c #3A61CE", 1633 "Z@ c #3A62CD", 1634 "`@ c #3F66CE", 1635 " # c #4368D0", 1636 ".# c #466CD2", 1637 "+# c #496DD5", 1638 "@# c #4E72D6", 1639 "## c #5175D8", 1640 "$# c #5276DA", 1641 "%# c #5578DC", 1642 "&# c #577ADC", 1643 "*# c #597CDD", 1644 "=# c #5B7DDD", 1645 "-# c #5D7FDE", 1646 ";# c #5E81DE", 1647 "># c #6183DF", 1648 ",# c #6386DF", 1649 "'# c #6687E0", 1650 ")# c #6888E0", 1651 "!# c #6A89E1", 1652 "~# c #6C8AE1", 1653 "{# c #6E8CE2", 1654 "]# c #6F8DE2", 1655 "^# c #7390E4", 1656 "/# c #7390E3", 1657 "(# c #7491E4", 1658 "_# c #7693E5", 1659 ":# c #7895E6", 1660 "<# c #7896E6", 1661 "[# c #7997E7", 1662 "}# c #7B97E7", 1663 "|# c #7B98E8", 1664 "1# c #7C98E8", 1665 "2# c #7E9BE9", 1666 "3# c #809CEA", 1667 "4# c #819CEA", 1668 "5# c #839DE9", 1669 "6# c #365FD0", 1670 "7# c #3660D0", 1671 "8# c #3961CF", 1672 "9# c #3B63CF", 1673 "0# c #3D64D0", 1674 "a# c #4067D0", 1675 "b# c #4469D2", 1676 "c# c #466BD3", 1677 "d# c #496ED5", 1678 "e# c #4C71D6", 1679 "f# c #4E72D8", 1680 "g# c #5074D9", 1681 "h# c #5376DB", 1682 "i# c #5578DB", 1683 "j# c #587ADC", 1684 "k# c #5B7CDC", 1685 "l# c #5D7EDD", 1686 "m# c #5F80DD", 1687 "n# c #6081DE", 1688 "o# c #6383DE", 1689 "p# c #6686DF", 1690 "q# c #6887E0", 1691 "r# c #6988E0", 1692 "s# c #6B89E1", 1693 "t# c #6C8AE0", 1694 "u# c #6E8CE1", 1695 "v# c #708EE2", 1696 "w# c #718FE2", 1697 "x# c #7290E3", 1698 "y# c #7391E2", 1699 "z# c #7492E1", 1700 "A# c #7592E2", 1701 "B# c #7691E3", 1702 "C# c #7591E3", 1703 "D# c #7692E3", 1704 "E# c #7693E3", 1705 "F# c #7793E4", 1706 "G# c #7893E4", 1707 "H# c #7994E5", 1708 "I# c #7D97E8", 1709 "J# c #7E98E8", 1710 "K# c #7D98E8", 1711 "L# c #7D99E9", 1712 "M# c #7D9BEA", 1713 "N# c #7D9CEA", 1714 "O# c #7E99E8", 1715 "P# c #7D9AEA", 1716 "Q# c #7C9BEA", 1717 "R# c #7C9CEA", 1718 "S# c #355FCF", 1719 "T# c #3860D0", 1720 "U# c #3A62D0", 1721 "V# c #3C64D1", 1722 "W# c #4167D1", 1723 "X# c #4369D3", 1724 "Y# c #466BD4", 1725 "Z# c #486DD5", 1726 "`# c #4A6ED7", 1727 " $ c #4C70D8", 1728 ".$ c #5478D9", 1729 "+$ c #577BDA", 1730 "@$ c #597DDB", 1731 "#$ c #5B7EDB", 1732 "$$ c #5D7FDC", 1733 "%$ c #6182DE", 1734 "&$ c #6284DE", 1735 "*$ c #6485DF", 1736 "=$ c #6586DF", 1737 "-$ c #6787DF", 1738 ";$ c #6888DF", 1739 ">$ c #6A8ADF", 1740 ",$ c #6C8BE0", 1741 "'$ c #6D8CE0", 1742 ")$ c #6E8DE1", 1743 "!$ c #6F8DE1", 1744 "~$ c #708EE1", 1745 "{$ c #718FE0", 1746 "]$ c #728FE1", 1747 "^$ c #7390E0", 1748 "/$ c #738FE0", 1749 "($ c #7490E1", 1750 "_$ c #7590E1", 1751 ":$ c #7591E1", 1752 "<$ c #7592E1", 1753 "[$ c #7692E2", 1754 "}$ c #7794E2", 1755 "|$ c #7894E3", 1756 "1$ c #7996E3", 1757 "2$ c #7A96E5", 1758 "3$ c #7B98E6", 1759 "4$ c #7B9AE8", 1760 "5$ c #7C99E8", 1761 "6$ c #7C96E5", 1762 "7$ c #7D97E7", 1763 "8$ c #7C99E9", 1764 "9$ c #7B9AE9", 1765 "0$ c #7B9AEA", 1766 "a$ c #5B6DCF", 1767 "b$ c #305EC8", 1768 "c$ c #335ECE", 1769 "d$ c #305ECA", 1770 "e$ c #345FCF", 1771 "f$ c #3761D0", 1772 "g$ c #3A62D1", 1773 "h$ c #3C64D2", 1774 "i$ c #4066D3", 1775 "j$ c #466BD5", 1776 "k$ c #486ED6", 1777 "l$ c #4A6ED6", 1778 "m$ c #4D71D8", 1779 "n$ c #4F72D9", 1780 "o$ c #5073D9", 1781 "p$ c #4F72D8", 1782 "q$ c #5074D8", 1783 "r$ c #5276D9", 1784 "s$ c #587ADA", 1785 "t$ c #5B7CDB", 1786 "u$ c #5D7EDC", 1787 "v$ c #5F7FDD", 1788 "w$ c #6081DC", 1789 "x$ c #6182DD", 1790 "y$ c #6283DD", 1791 "z$ c #6484DE", 1792 "A$ c #6585DD", 1793 "B$ c #6787DE", 1794 "C$ c #6988DF", 1795 "D$ c #6A89DE", 1796 "E$ c #6C8ADF", 1797 "F$ c #6D8BDF", 1798 "G$ c #6E8CE0", 1799 "H$ c #6F8DE0", 1800 "I$ c #718EE0", 1801 "J$ c #728FDF", 1802 "K$ c #728FDE", 1803 "L$ c #7290E0", 1804 "M$ c #7190E0", 1805 "N$ c #7291E0", 1806 "O$ c #7191E0", 1807 "P$ c #7392E1", 1808 "Q$ c #7493E1", 1809 "R$ c #7594E1", 1810 "S$ c #7594E2", 1811 "T$ c #7694E2", 1812 "U$ c #7695E2", 1813 "V$ c #7A96E4", 1814 "W$ c #7895E2", 1815 "X$ c #7A96E2", 1816 "Y$ c #7A96E3", 1817 "Z$ c #7B96E3", 1818 "`$ c #7996E1", 1819 " % c #7C96E4", 1820 ".% c #305EC9", 1821 "+% c #315ECC", 1822 "@% c #325ECE", 1823 "#% c #3760D0", 1824 "$% c #3962D1", 1825 "%% c #3E66D3", 1826 "&% c #4268D4", 1827 "*% c #446BD5", 1828 "=% c #476CD6", 1829 "-% c #496ED7", 1830 ";% c #4B6FD7", 1831 ">% c #4C70D7", 1832 ",% c #4E71D7", 1833 "'% c #5074D7", 1834 ")% c #5276D8", 1835 "!% c #5376D8", 1836 "~% c #5779DA", 1837 "{% c #597ADA", 1838 "]% c #5A7BDB", 1839 "^% c #5B7CDA", 1840 "/% c #5D7EDB", 1841 "(% c #5E7FDB", 1842 "_% c #6182DB", 1843 ":% c #6384DC", 1844 "<% c #6586DD", 1845 "[% c #6686DC", 1846 "}% c #6887DD", 1847 "|% c #6988DD", 1848 "1% c #6A8ADE", 1849 "2% c #6B8BDE", 1850 "3% c #6C8CDE", 1851 "4% c #6E8DDF", 1852 "5% c #6E8CDF", 1853 "6% c #6D8DDF", 1854 "7% c #6C8BDF", 1855 "8% c #6F8DDF", 1856 "9% c #718FDF", 1857 "0% c #7290DF", 1858 "a% c #7391E0", 1859 "b% c #7491E0", 1860 "c% c #7292E1", 1861 "d% c #3959C5", 1862 "e% c #345BC5", 1863 "f% c #315EC8", 1864 "g% c #355BC5", 1865 "h% c #325EC8", 1866 "i% c #315ECB", 1867 "j% c #345DCC", 1868 "k% c #335ECD", 1869 "l% c #345ECD", 1870 "m% c #355FCE", 1871 "n% c #3862D0", 1872 "o% c #3E66D2", 1873 "p% c #456BD5", 1874 "q% c #476CD5", 1875 "r% c #4B6ED7", 1876 "s% c #4B6FD6", 1877 "t% c #4B6FD5", 1878 "u% c #4D71D6", 1879 "v% c #5073D7", 1880 "w% c #5174D7", 1881 "x% c #5275D8", 1882 "y% c #5577D8", 1883 "z% c #5678D8", 1884 "A% c #5779D9", 1885 "B% c #587AD8", 1886 "C% c #597CD9", 1887 "D% c #5B7DD9", 1888 "E% c #5D7FDA", 1889 "F% c #5F80DB", 1890 "G% c #6182DC", 1891 "H% c #6484DC", 1892 "I% c #6585DC", 1893 "J% c #6787DD", 1894 "K% c #6988DE", 1895 "L% c #6B8ADE", 1896 "M% c #6B8ADF", 1897 "N% c #6989DE", 1898 "O% c #6B89DE", 1899 "P% c #6E8BDF", 1900 "Q% c #708CDE", 1901 "R% c #708DDF", 1902 "S% c #708FDF", 1903 "T% c #728EDF", 1904 "U% c #6F8EDD", 1905 "V% c #728EDD", 1906 "W% c #7390DF", 1907 "X% c #7490DF", 1908 "Y% c #335DC8", 1909 "Z% c #3759C5", 1910 "`% c #3859C5", 1911 " & c #335EC8", 1912 ".& c #325DCA", 1913 "+& c #345CCB", 1914 "@& c #335DCC", 1915 "#& c #345DCD", 1916 "$& c #355FCD", 1917 "%& c #3861D0", 1918 "&& c #3B64D1", 1919 "*& c #3E65D2", 1920 "=& c #4168D3", 1921 "-& c #456AD5", 1922 ";& c #4B6ED5", 1923 ">& c #4C6FD4", 1924 ",& c #4D70D5", 1925 "'& c #4F72D6", 1926 ")& c #5173D6", 1927 "!& c #5375D7", 1928 "~& c #5476D8", 1929 "{& c #5577D7", 1930 "]& c #5477D8", 1931 "^& c #5677D8", 1932 "/& c #5879D9", 1933 "(& c #597AD9", 1934 "_& c #5C7DDA", 1935 ":& c #6080DC", 1936 "<& c #6080DB", 1937 "[& c #6181DC", 1938 "}& c #6282DC", 1939 "|& c #6383DD", 1940 "1& c #6484DD", 1941 "2& c #6686DE", 1942 "3& c #6685DE", 1943 "4& c #6786DE", 1944 "5& c #6687DE", 1945 "6& c #6887DE", 1946 "7& c #6987DE", 1947 "8& c #6788DF", 1948 "9& c #6785DF", 1949 "0& c #6B89DF", 1950 "a& c #6C89DF", 1951 "b& c #6F8DDD", 1952 "c& c #6D8CDE", 1953 "d& c #445BBB", 1954 "e& c #3759BE", 1955 "f& c #375AC6", 1956 "g& c #355CC8", 1957 "h& c #345CCA", 1958 "i& c #355ECC", 1959 "j& c #365FCD", 1960 "k& c #3761CE", 1961 "l& c #3A63D0", 1962 "m& c #3D65D1", 1963 "n& c #466AD4", 1964 "o& c #476BD4", 1965 "p& c #486CD3", 1966 "q& c #4A6ED4", 1967 "r& c #4B6ED4", 1968 "s& c #4E71D6", 1969 "t& c #4F71D5", 1970 "u& c #5072D6", 1971 "v& c #5274D7", 1972 "w& c #5273D7", 1973 "x& c #5274D6", 1974 "y& c #5476D7", 1975 "z& c #5779D8", 1976 "A& c #587AD9", 1977 "B& c #5A7CDA", 1978 "C& c #5C7DDB", 1979 "D& c #5D7EDA", 1980 "E& c #6081DA", 1981 "F& c #6181DB", 1982 "G& c #6283DC", 1983 "H& c #6483DD", 1984 "I& c #6483DE", 1985 "J& c #6585DE", 1986 "K& c #6786DF", 1987 "L& c #6886DE", 1988 "M& c #6887DF", 1989 "N& c #6987DF", 1990 "O& c #6A88DF", 1991 "P& c #6786E0", 1992 "Q& c #6A86DE", 1993 "R& c #6B89E0", 1994 "S& c #365BC8", 1995 "T& c #365CC8", 1996 "U& c #375DCA", 1997 "V& c #375FCB", 1998 "W& c #3860CD", 1999 "X& c #3C63D0", 2000 "Y& c #4167D2", 2001 "Z& c #4268D2", 2002 "`& c #4368D2", 2003 " * c #4367D2", 2004 ".* c #4568D2", 2005 "+* c #466AD2", 2006 "@* c #496CD3", 2007 "#* c #4A6DD3", 2008 "$* c #4A6DD4", 2009 "%* c #4D70D4", 2010 "&* c #4F72D5", 2011 "** c #4C70D4", 2012 "=* c #4E72D5", 2013 "-* c #5173D5", 2014 ";* c #5375D6", 2015 ">* c #597BDA", 2016 ",* c #5B7DDA", 2017 "'* c #5C7EDB", 2018 ")* c #5D7FDB", 2019 "!* c #5E80DB", 2020 "~* c #5E81DA", 2021 "{* c #5F81DB", 2022 "]* c #5F82DB", 2023 "^* c #6384DD", 2024 "/* c #6384DE", 2025 "(* c #6585DF", 2026 "_* c #6486E0", 2027 ":* c #6583DD", 2028 "<* c #6386E0", 2029 "[* c #6686E0", 2030 "}* c #6B86DD", 2031 "|* c #6D86DD", 2032 "1* c #6086E0", 2033 "2* c #5573CD", 2034 "3* c #3959C3", 2035 "4* c #3959C4", 2036 "5* c #3759C0", 2037 "6* c #375BC7", 2038 "7* c #365CC7", 2039 "8* c #395FCC", 2040 "9* c #3B62CE", 2041 "0* c #3E64D0", 2042 "a* c #4066D1", 2043 "b* c #4166D1", 2044 "c* c #4064CF", 2045 "d* c #4065CF", 2046 "e* c #4266D0", 2047 "f* c #4468D1", 2048 "g* c #4569D1", 2049 "h* c #476BD2", 2050 "i* c #466AD1", 2051 "j* c #476AD2", 2052 "k* c #456AD1", 2053 "l* c #496DD2", 2054 "m* c #4A6FD3", 2055 "n* c #496ED2", 2056 "o* c #4B70D4", 2057 "p* c #4D71D4", 2058 "q* c #4E72D4", 2059 "r* c #5073D4", 2060 "s* c #5174D5", 2061 "t* c #5175D5", 2062 "u* c #5276D6", 2063 "v* c #5377D6", 2064 "w* c #5478D7", 2065 "x* c #5579D7", 2066 "y* c #567AD8", 2067 "z* c #577BD9", 2068 "A* c #597CD8", 2069 "B* c #5A7DD9", 2070 "C* c #5A7ED9", 2071 "D* c #5B7FDA", 2072 "E* c #5C80DA", 2073 "F* c #5D80DA", 2074 "G* c #5E81DB", 2075 "H* c #5D80DB", 2076 "I* c #6082DC", 2077 "J* c #6183DD", 2078 "K* c #6183DE", 2079 "L* c #6082DB", 2080 "M* c #6282DE", 2081 "N* c #6682DE", 2082 "O* c #6583DE", 2083 "P* c #3759BF", 2084 "Q* c #375AC2", 2085 "R* c #375AC1", 2086 "S* c #375AC4", 2087 "T* c #395DCA", 2088 "U* c #3A5ECA", 2089 "V* c #3C60CC", 2090 "W* c #3D61CD", 2091 "X* c #3D61CC", 2092 "Y* c #3C61CD", 2093 "Z* c #3E62CD", 2094 "`* c #3F64CE", 2095 " = c #4266CF", 2096 ".= c #4468D0", 2097 "+= c #4267CF", 2098 "@= c #4166CE", 2099 "#= c #4065CE", 2100 "$= c #4166CD", 2101 "%= c #4267CE", 2102 "&= c #456AD0", 2103 "*= c #4368CE", 2104 "== c #4468CF", 2105 "-= c #4569D0", 2106 ";= c #486BD1", 2107 ">= c #4B6FD3", 2108 ",= c #4C70D3", 2109 "'= c #4F73D4", 2110 ")= c #5275D5", 2111 "!= c #5477D6", 2112 "~= c #577BD7", 2113 "{= c #587CD8", 2114 "]= c #577CD8", 2115 "^= c #597DD9", 2116 "/= c #5A7DDA", 2117 "(= c #597DDA", 2118 "_= c #587CDA", 2119 ":= c #5A7EDA", 2120 "<= c #567BD8", 2121 "[= c #557AD9", 2122 "}= c #567BD9", 2123 "|= c #577CD9", 2124 "1= c #587DD9", 2125 "2= c #587ED9", 2126 "3= c #577ED8", 2127 "4= c #587DD8", 2128 "5= c #587ED8", 2129 "6= c #567ED7", 2130 "7= c #526ABD", 2131 "8= c #3759C1", 2132 "9= c #385BC7", 2133 "0= c #395CC8", 2134 "a= c #3B5DC9", 2135 "b= c #3B5ECA", 2136 "c= c #3A5FCA", 2137 "d= c #3B60CC", 2138 "e= c #3C61CC", 2139 "f= c #3D62CD", 2140 "g= c #3E63CD", 2141 "h= c #3C61CB", 2142 "i= c #3C61CA", 2143 "j= c #3D62CB", 2144 "k= c #3F64CC", 2145 "l= c #4065CD", 2146 "m= c #4669D0", 2147 "n= c #476AD0", 2148 "o= c #496BD1", 2149 "p= c #4A6DD2", 2150 "q= c #4B6ED2", 2151 "r= c #4D71D3", 2152 "s= c #4E73D4", 2153 "t= c #4F74D4", 2154 "u= c #5075D5", 2155 "v= c #5276D5", 2156 "w= c #5377D7", 2157 "x= c #5278D7", 2158 "y= c #5277D6", 2159 "z= c #5378D7", 2160 "A= c #5379D8", 2161 "B= c #5379D9", 2162 "C= c #5278D8", 2163 "D= c #5178D7", 2164 "E= c #3355C0", 2165 "F= c #3556C1", 2166 "G= c #395AC6", 2167 "H= c #385AC7", 2168 "I= c #395BC7", 2169 "J= c #395EC9", 2170 "K= c #395FCA", 2171 "L= c #3B60CA", 2172 "M= c #3B60CB", 2173 "N= c #375DC7", 2174 "O= c #385EC8", 2175 "P= c #395FC9", 2176 "Q= c #3A60CA", 2177 "R= c #3D63CC", 2178 "S= c #4367CF", 2179 "T= c #476BD1", 2180 "U= c #4A6ED2", 2181 "V= c #4B6FD2", 2182 "W= c #4C6FD2", 2183 "X= c #4D70D1", 2184 "Y= c #4E71D2", 2185 "Z= c #4E72D2", 2186 "`= c #4E74D4", 2187 " - c #4E75D5", 2188 ".- c #4E75D4", 2189 "+- c #4F75D3", 2190 "@- c #5075D2", 2191 "#- c #5075D3", 2192 "$- c #5177D7", 2193 "%- c #5178D8", 2194 "&- c #4F75D5", 2195 "*- c #5076D5", 2196 "=- c #4F76D6", 2197 "-- c #5279D9", 2198 ";- c #3C52B1", 2199 ">- c #3656C3", 2200 ",- c #3757C5", 2201 "'- c #3758C6", 2202 ")- c #3759C6", 2203 "!- c #375BC6", 2204 "~- c #385CC7", 2205 "{- c #385DC8", 2206 "]- c #365CC6", 2207 "^- c #355BC6", 2208 "/- c #355CC6", 2209 "(- c #365DC7", 2210 "_- c #375EC8", 2211 ":- c #375CC6", 2212 "<- c #385EC6", 2213 "[- c #3A5FC7", 2214 "}- c #3C60C8", 2215 "|- c #3D61C9", 2216 "1- c #3E62CA", 2217 "2- c #4063CC", 2218 "3- c #4165CE", 2219 "4- c #4268D0", 2220 "5- c #4269D1", 2221 "6- c #436AD2", 2222 "7- c #446AD2", 2223 "8- c #456BD2", 2224 "9- c #496CD1", 2225 "0- c #4C6CD0", 2226 "a- c #4D6CCF", 2227 "b- c #4E6DD0", 2228 "c- c #4F6ECF", 2229 "d- c #4E6FCF", 2230 "e- c #4C70CF", 2231 "f- c #4A71D0", 2232 "g- c #4F6FCF", 2233 "h- c #4B71D0", 2234 "i- c #4A72D1", 2235 "j- c #4B73D4", 2236 "k- c #4F70D0", 2237 "l- c #4C73D3", 2238 "m- c #4C73D6", 2239 "n- c #4B72D2", 2240 "o- c #4B71D1", 2241 "p- c #4C73D7", 2242 "q- c #3354C0", 2243 "r- c #3152BE", 2244 "s- c #3052BE", 2245 "t- c #3051BF", 2246 "u- c #2E4FBF", 2247 "v- c #2E4FBE", 2248 "w- c #2E50BF", 2249 "x- c #2F50BF", 2250 "y- c #3156C4", 2251 "z- c #2F56C5", 2252 "A- c #2E57C5", 2253 "B- c #2F57C5", 2254 "C- c #3057C6", 2255 "D- c #3258C6", 2256 "E- c #3459C7", 2257 "F- c #365AC7", 2258 "G- c #385BC8", 2259 "H- c #3B5DCA", 2260 "I- c #3B5DCB", 2261 "J- c #3C5ECC", 2262 "K- c #3C60CD", 2263 "L- c #3C62CE", 2264 "M- c #3D65D0", 2265 "N- c #3D66D1", 2266 "O- c #4166D2", 2267 "P- c #4667D2", 2268 "Q- c #4A67D1", 2269 "R- c #4C68D0", 2270 "S- c #4C69CF", 2271 "T- c #4D6BCE", 2272 "U- c #4E6DCD", 2273 "V- c #4E6ECE", 2274 "W- c #4E6DCE", 2275 "X- c #4970D0", 2276 "Y- c #4770D0", 2277 "Z- c #4B6BCE", 2278 "`- c #4A6CCE", 2279 " ; c #496DCF", 2280 ".; c #476FD0", 2281 "+; c #4870D0", 2282 "@; c #486DCF", 2283 "#; c #242F79", 2284 "$; c #2F41AC", 2285 "%; c #2040B8", 2286 "&; c #2041B8", 2287 "*; c #2243B3", 2288 "=; c #2243B8", 2289 "-; c #2343B8", 2290 ";; c #2444B8", 2291 ">; c #2445B8", 2292 ",; c #2445B6", 2293 "'; c #2445B7", 2294 "); c #2444B9", 2295 "!; c #2949BE", 2296 "~; c #2649BF", 2297 "{; c #234BBF", 2298 "]; c #224CBF", 2299 "^; c #224AC0", 2300 "/; c #244CC0", 2301 "(; c #254DC0", 2302 "_; c #254DC1", 2303 ":; c #264DC2", 2304 "<; c #274EC3", 2305 "[; c #274CC3", 2306 "}; c #274DC4", 2307 "|; c #254DC5", 2308 "1; c #214EC5", 2309 "2; c #204FC6", 2310 "3; c #1F50C8", 2311 "4; c #2151C9", 2312 "5; c #2B53C8", 2313 "6; c #3154C7", 2314 "7; c #3255C6", 2315 "8; c #2F57C7", 2316 "9; c #2C58C9", 2317 "0; c #2D59CA", 2318 "a; c #2D58C9", 2319 "b; c #2E5BCC", 2320 "c; c #325ECC", 2321 "d; c #325ECB", 2322 "e; c #1F40B1", 2323 "f; c #1F40B2", 2324 "g; c #1F40B3", 2325 "h; c #2A44BD", 2326 "i; c #2845BE", 2327 "j; c #2745BE", 2328 "k; c #2646BF", 2329 "l; c #2546BE", 2330 "m; c #2347BF", 2331 "n; c #2147BF", 2332 "o; c #2048C0", 2333 "p; c #1D48C0", 2334 "q; c #1C48C0", 2335 "r; c #1B47C0", 2336 "s; c #1C48BF", 2337 "t; c #1E49BE", 2338 "u; c #214ABD", 2339 "v; c #244CBD", 2340 "w; c #264DBE", 2341 "x; c #254EC0", 2342 "y; c #214FC2", 2343 "z; c #1B51C5", 2344 "A; c #1C51C7", 2345 "B; c #2250C8", 2346 "C; c #2A52C8", 2347 "D; c #3254C6", 2348 "E; c #3355C5", 2349 "F; c #3154C8", 2350 "G; c #3355C6", 2351 "H; c #2F57C8", 2352 "I; c #2E58C9", 2353 "J; c #2E59C9", 2354 "K; c #3059C9", 2355 "L; c #2040B6", 2356 "M; c #2743BB", 2357 "N; c #2844BC", 2358 "O; c #2743BD", 2359 "P; c #2844BE", 2360 "Q; c #2844BD", 2361 "R; c #2346BE", 2362 "S; c #2047BF", 2363 "T; c #1E48C0", 2364 "U; c #1D47C0", 2365 "V; c #1D49BF", 2366 "W; c #1F49BF", 2367 "X; c #204ABE", 2368 "Y; c #254DBF", 2369 "Z; c #234EC0", 2370 "`; c #2050C1", 2371 " > c #1C51C3", 2372 ".> c #1F51C6", 2373 "+> c #2651C8", 2374 "@> c #2D53C7", 2375 "#> c #3155C6", 2376 "$> c #3155C7", 2377 "%> c #3355C7", 2378 "&> c #3254C7", 2379 "*> c #1E40B1", 2380 "=> c #2141B8", 2381 "-> c #2442B9", 2382 ";> c #2744BB", 2383 ">> c #2945BB", 2384 ",> c #2A45BB", 2385 "'> c #2944BA", 2386 ")> c #2745BB", 2387 "!> c #2545BC", 2388 "~> c #2246BD", 2389 "{> c #2047BE", 2390 "]> c #1F47BD", 2391 "^> c #1D48BE", 2392 "/> c #1E49C0", 2393 "(> c #1F4AC0", 2394 "_> c #214BBF", 2395 ":> c #244CBE", 2396 "<> c #254DBE", 2397 "[> c #244DBE", 2398 "}> c #224FBF", 2399 "|> c #2051C1", 2400 "1> c #2151C3", 2401 "2> c #2252C5", 2402 "3> c #2151C1", 2403 "4> c #2851C6", 2404 "5> c #2A50C6", 2405 "6> c #2E54C6", 2406 "7> c #1F51C2", 2407 "8> c #1D52C5", 2408 "9> c #2651C9", 2409 "0> c #2950C7", 2410 "a> c #2D40A5", 2411 "b> c #2040B0", 2412 "c> c #1F40B0", 2413 "d> c #223CAE", 2414 "e> c #233CAE", 2415 "f> c #253BAC", 2416 "g> c #253BAD", 2417 "h> c #233CB0", 2418 "i> c #213EB2", 2419 "j> c #1F3FB4", 2420 "k> c #1E40B6", 2421 "l> c #1F3FB7", 2422 "m> c #1E3EB8", 2423 "n> c #1F3FB8", 2424 "o> c #2040B7", 2425 "p> c #2141B6", 2426 "q> c #2140B7", 2427 "r> c #2241B6", 2428 "s> c #2342B5", 2429 "t> c #2442B6", 2430 "u> c #2543B5", 2431 "v> c #2643B4", 2432 "w> c #2544B6", 2433 "x> c #2346B8", 2434 "y> c #2247B9", 2435 "z> c #2048BC", 2436 "A> c #1F48BF", 2437 "B> c #2049C0", 2438 "C> c #214AC0", 2439 "D> c #224BBF", 2440 "E> c #234CBE", 2441 "F> c #244DBF", 2442 "G> c #234CBF", 2443 "H> c #264DC0", 2444 "I> c #274EBF", 2445 "J> c #264DBF", 2446 "K> c #254EBF", 2447 "L> c #2050C0", 2448 "M> c #1F51C1", 2449 "N> c #1E42A4", 2450 "O> c #263BA6", 2451 "P> c #253BA7", 2452 "Q> c #253CA7", 2453 "R> c #1E41A5", 2454 "S> c #1F40AF", 2455 "T> c #273AAC", 2456 "U> c #1E40B0", 2457 "V> c #1F40B5", 2458 "W> c #1F40B6", 2459 "X> c #1F40B8", 2460 "Y> c #1E40B8", 2461 "Z> c #1F3EB8", 2462 "`> c #203FB7", 2463 " , c #2240B6", 2464 "., c #2341B7", 2465 "+, c #2345B9", 2466 "@, c #2147BB", 2467 "#, c #2148BA", 2468 "$, c #2049BB", 2469 "%, c #2049BD", 2470 "&, c #2049BF", 2471 "*, c #224BBE", 2472 "=, c #244DBD", 2473 "-, c #244CBF", 2474 ";, c #182969", 2475 ">, c #273BAD", 2476 ",, c #2739AB", 2477 "', c #263AAC", 2478 "), c #243CAE", 2479 "!, c #233DAE", 2480 "~, c #213EAF", 2481 "{, c #1F3FB0", 2482 "], c #2040B4", 2483 "^, c #1F3FB6", 2484 "/, c #1E3EB7", 2485 "(, c #2240B7", 2486 "_, c #2341B6", 2487 ":, c #2543B4", 2488 "<, c #2644B3", 2489 "[, c #2544B5", 2490 "}, c #2545B5", 2491 "|, c #2547B6", 2492 "1, c #2548B7", 2493 "2, c #2349BA", 2494 "3, c #1F49BE", 2495 "4, c #2149BD", 2496 "5, c #2049BE", 2497 "6, c #214BBE", 2498 "7, c #2249BE", 2499 "8, c #234CBD", 2500 "9, c #2149BE", 2501 "0, c #1E49BF", 2502 "a, c #253BA9", 2503 "b, c #253BAB", 2504 "c, c #263AAB", 2505 "d, c #213DAF", 2506 "e, c #203EAF", 2507 "f, c #1D40AF", 2508 "g, c #1D40B0", 2509 "h, c #1E40B4", 2510 "i, c #2241B7", 2511 "j, c #2643B6", 2512 "k, c #2744B5", 2513 "l, c #2643B5", 2514 "m, c #2346B6", 2515 "n, c #2147B7", 2516 "o, c #2644B6", 2517 "p, c #2247B7", 2518 "q, c #2248B8", 2519 "r, c #2647B7", 2520 "s, c #2549B7", 2521 "t, c #2645B7", 2522 "u, c #2148B8", 2523 "v, c #2847B6", 2524 "w, c #2549B6", 2525 "x, c #2849B6", 2526 "y, c #2049B7", 2527 "z, c #2A49B5", 2528 "A, c #243BA4", 2529 "B, c #253BA5", 2530 "C, c #253BA6", 2531 "D, c #263AA7", 2532 "E, c #263AA8", 2533 "F, c #2739AA", 2534 "G, c #243CAD", 2535 "H, c #223DAE", 2536 "I, c #1F3EAF", 2537 "J, c #1E3FB0", 2538 "K, c #1D40B1", 2539 "L, c #1E3FB1", 2540 "M, c #1F3FB3", 2541 "N, c #1F3FB5", 2542 "O, c #2140B6", 2543 "P, c #2140B8", 2544 "Q, c #2744B4", 2545 "R, c #2746B6", 2546 "S, c #2947B6", 2547 "T, c #2946B5", 2548 "U, c #2A48B6", 2549 "V, c #3551A8", 2550 "W, c #1F399C", 2551 "X, c #143D9F", 2552 "Y, c #263BA5", 2553 "Z, c #273BA8", 2554 "`, c #273BAA", 2555 " ' c #263AAD", 2556 ".' c #233CAD", 2557 "+' c #213DAE", 2558 "@' c #203FB2", 2559 "#' c #2342B6", 2560 "$' c #2443B6", 2561 "%' c #2543B6", 2562 "&' c #2644B5", 2563 "*' c #133D9E", 2564 "=' c #263BA7", 2565 "-' c #263BA9", 2566 ";' c #273BA9", 2567 ">' c #263AAA", 2568 ",' c #2539AB", 2569 "'' c #2639AB", 2570 ")' c #253AAC", 2571 "!' c #243BAD", 2572 "~' c #223DAF", 2573 "{' c #203FB0", 2574 "]' c #2040B1", 2575 "^' c #2140B3", 2576 "/' c #2543B1", 2577 "(' c #2744AF", 2578 "_' c #1A3CA0", 2579 ":' c #1D3BA2", 2580 "<' c #233BA4", 2581 "[' c #263AA5", 2582 "}' c #253AA5", 2583 "|' c #263AA6", 2584 "1' c #263BA4", 2585 "2' c #243BA5", 2586 "3' c #263BA8", 2587 "4' c #223EAF", 2588 "5' c #3B4CA5", 2589 "6' c #1D379A", 2590 "7' c #1E389C", 2591 "8' c #1E399F", 2592 "9' c #1F3BA2", 2593 "0' c #1F3BA3", 2594 "a' c #213BA4", 2595 "b' c #233AA3", 2596 "c' c #243AA3", 2597 "d' c #2539A4", 2598 "e' c #253AA6", 2599 "f' c #243BA7", 2600 "g' c #253CAA", 2601 "h' c #253CAC", 2602 "i' c #253CAD", 2603 "j' c #253CAE", 2604 "k' c #243DAE", 2605 "l' c #213FAF", 2606 "m' c #223FAF", 2607 "n' c #2040AF", 2608 "o' c #253D93", 2609 "p' c #1D3894", 2610 "q' c #1F379A", 2611 "r' c #1E389B", 2612 "s' c #1D399C", 2613 "t' c #1C3A9D", 2614 "u' c #1B3A9D", 2615 "v' c #183B9E", 2616 "w' c #163C9E", 2617 "x' c #153C9E", 2618 "y' c #163B9D", 2619 "z' c #173B9D", 2620 "A' c #193A9D", 2621 "B' c #1C3A9E", 2622 "C' c #1F3AA1", 2623 "D' c #223AA4", 2624 "E' c #253BA8", 2625 "F' c #273BA7", 2626 "G' c #263CAB", 2627 "H' c #263CAC", 2628 "I' c #243EAE", 2629 "J' c #273BAC", 2630 "K' c #2A3795", 2631 "L' c #1F389B", 2632 "M' c #1D389B", 2633 "N' c #1C399C", 2634 "O' c #1B399C", 2635 "P' c #1A3A9D", 2636 "Q' c #1D399B", 2637 "R' c #1B399B", 2638 "S' c #1A3A9C", 2639 "T' c #1B3A9F", 2640 "U' c #1D3AA0", 2641 "V' c #203BA2", 2642 "W' c #203BA3", 2643 "X' c #2639A6", 2644 "Y' c #1B3692", 2645 "Z' c #1C3794", 2646 "`' c #1D3796", 2647 " ) c #1E3898", 2648 ".) c #1E389A", 2649 "+) c #1F399B", 2650 "@) c #1A399C", 2651 "#) c #193A9E", 2652 "$) c #1A3BA0", 2653 "%) c #1C3BA2", 2654 "&) c #1D3CA3", 2655 "*) c #203CA4", 2656 "=) c #223BA5", 2657 "-) c #3C4699", 2658 ";) c #2B4595", 2659 ">) c #1C3793", 2660 ",) c #1D3895", 2661 "') c #1E3897", 2662 ")) c #1F3998", 2663 "!) c #1F3999", 2664 "~) c #1F399A", 2665 "{) c #1E399C", 2666 "]) c #1C3B9E", 2667 "^) c #1D3BA0", 2668 "/) c #1E3CA2", 2669 "() c #223CA5", 2670 "_) c #243CA6", 2671 ":) c #596FA9", 2672 "<) c #3B4894", 2673 "[) c #314993", 2674 "}) c #29499F", 2675 "|) c #28489E", 2676 "1) c #2B4BA1", 2677 "2) c #2C4BA1", 2678 "3) c #2D4CA2", 2679 "4) c #2E4CA3", 2680 "5) c #2F4CA4", 2681 "6) c #2E4CA4", 2682 "7) c #2F4DA3", 2683 "8) c #2F4DA4", 2684 "9) c #D3D5D2", 2685 "0) c #3B4794", 2686 "a) c #314791", 2687 "b) c #304892", 2688 "c) c #304893", 2689 "d) c #2F4995", 2690 "e) c #2F4997", 2691 "f) c #2D4A9A", 2692 "g) c #2A4A9D", 2693 "h) c #294A9F", 2694 "i) c #284AA0", 2695 "j) c #294AA0", 2696 "k) c #2B4AA1", 2697 "l) c #2D4CA3", 2698 "m) c #C9CAC9", 2699 "n) c #455D9B", 2700 "o) c #242F78", 2701 "p) c #1B2F85", 2702 "q) c #C6C3C8", 2703 "r) c #B5B2B6", 2704 "s) c #B5B7B4", 2705 "t) c #B5B7B3", 2706 "u) c #B5B2B5", 2707 "v) c #B5B3B4", 2708 "w) c #B5B5B4", 2709 "x) c #B5B6B3", 2710 "y) c #B5B4B4", 2711 "z) c #B5B3B5", 2712 "A) c #B5B4B5", 2713 "B) c #B5B5B5", 2714 "C) c #B5B5B3", 2715 "D) c #B5B5B6", 2716 "E) c #BAC3BE", 2717 "F) c #B9C3BD", 2718 "G) c #C1C3C4", 2719 "H) c #BFC3C2", 2720 "I) c #B9C3BE", 2721 "J) c #BBC3BF", 2722 "K) c #BDC3C1", 2723 "L) c #C0C3C3", 2724 "M) c #BEC3C1", 2725 "N) c #C2C3C5", 2726 "O) c #E6E3E8", 2727 "P) c #E0E2DF", 2728 "Q) c #E1E1E1", 2729 "R) c #E2E1E3", 2730 "S) c #E4E1E6", 2731 "T) c #E4E2E7", 2732 "U) c #E4E2E6", 2733 "V) c #E3E3E4", 2734 "W) c #E2E3E3", 2735 "X) c #E1E3E2", 2736 "Y) c #E3E3E3", 2737 "Z) c #E3E3E2", 2738 "`) c #EBEDEA", 2739 " ! c #EAECE9", 2740 ".! c #E9EBE8", 2741 "+! c #ECEEEB", 2742 ". . + @ # $ $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ $ $ $ % $ $ & * = - ; > , , ' ) ! ! ~ { ] ^ / ( _ : < [ } | | 1 2 3 3 4 4 4 4 4 4 4 5 6 4 4 4 5 6 7 8 9 4 5 6 7 8 9 6 7 8 9 ", 2743 "0 a b % $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ c d d d d $ $ $ $ $ c d e f g h i i i i j k l m n o p q r s t u v w x y z 4 A B C D 9 9 E 9 E F G H I F J K L L L L J K L L L L L L L L ", 2744 "@ % M N O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.b.b.b.b.b.", 2745 "c.$ d.O e.f.g.g.g.h.g.g.g.g.g.h.h.g.g.g.g.g.h.h.g.g.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+@+$+%+&+*+=+$+-+;+>+,+'+)+!+;+>+,+~+,+>+,+~+,+", 2746 "$ {+N N f.f.f.f.h.h.h.g.f.f.h.h.h.h.g.f.f.h.h.h.h.]+^+/+(+h._+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+.+C+D+E+D+F+G+H+C+I+F+G+J+K+L+H+F+G+J+K+L+H+J+H+J+H+", 2747 "{+{+N N M+M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.N+N+h.h.(+O+P+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@[@y+}@|@1@A+1@2@3@ +2@4@2@5@C+D+6@D+7@5@C+D+6@I+C+D+6@I+", 2748 "{+{+8@N M+M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.9@9@0@N+a@b@c@d@e@f@g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@q+r+C@D@E@F@G@H@_@I@J@K@<@L@M@N@O@P@Q@R@S@T@A+A+U@V@W@W@A+2@U@V@W@W@U@V@W@W@", 2749 "{+{+8@N f.M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.(+(+(+9@9@X@Y@Z@e@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#z@^#/#(#p+_#r+:#s+t+<#[#}#|#|#1#_@|#_@_@2#L@3#4#y+y+5#z+z+z+5#z+z+z+z+A+A+A+A+A+", 2750 "{+{+8@8@f.f.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.(+6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#&@p#q#r#s#t#u#v#w#x#x#y#y#z#A#B#C#D#E#E#F#G#H#F#H#H#u+v+I#J#K#L#J@J@M#N#O#P#M#M#M#N#M#Q#Q#R#", 2751 "$ {+8@e.f.f.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.S#l.7#T#U#V#W#X#Y#Z#`# $f#g###.$+$@$#$$$$@%$&$*$=$-$;$>$,$'$)$!$~$~${$]$^$/$($($_$_$:$<$_$<$[$}$|$|$1$2$2$3$}#4$5$6$7$8$8$9$8$8$8$0$8$", 2752 "$ {+a$e.f.f.h.h.h.h.h.h.h.h.h.b$h.c$c$c$c$c$d$c$c$c$c$c$c$c$c$c$c$e$e$7#f$g$h$i$X#j$k$l$m$n$o$p$q$r$l@s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$I$J$J$K$K$J$L$L$L$L$L$M$N$O$P$Q$R$S$T$U$1$V$T$W$X$Y$1$V$Y$Z$`$ %", 2753 "$ $ a$a$f.f.b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$.%b$b$b$.%d$+%+%@%h.e$l.#%$%h$%%&%*%=%-%;%>%,%'%)%!% @ @~%{%]%^%/%(%w$_%:%<%[%}%|%D$1%2%3%4%5%4%4%6%5%5%4%4%4%5%7%5%8%9%L$0%a%a%a%P$b%P$P$z#z#z#P$c%c%c%", 2754 "$ $ 8@e.f.f.d%b$b$b$b$b$d%b$b$b$b$b$b$e%f%b$b$b$b$b$g%h%b$.%i%i%j%k%l%m%X@n%h$o%&%p%q%`#r%s%t%u%v%w%x%y% @z%A%B%C%D%E%F%G%:%H%I%[%J%}%K%|%D$K%D$D$L%M%M%M%M%M%D$N%O%i+P%j+Q%R%S%T%0%U%V%W%W%W%W%X%X%X%X%", 2755 "$ $ 8@8@f.f.d%d%b$b$b$b$d%d%b$b$b$h%Y%Z%Z%h%f%f%h%Y%`%`% &h%h%.&+&@&#&$&X@%&&&*&=&-&j$Z#+#;&>&,&'&)&)&!&~&{&]&^&/&(&^%_&(%:&<&[&}&|&1&A$A$2&3&4&4&5&B$6&7&B$7&8&9&6&7&0&a&a&i+i+i+b&a&a&j+U%c&U%j+U%c&U%", 2756 "$ $ 8@8@d&e&d%d%d%d%d%d%d%d%d%d%d%`%d%d%d%d%`%`%`%d%d%d%d%`%`%f&g&h&j%i&j&k&l&m&=&X#Y#n&o&p&q&r&>&s&t&t&u&v&w&x&y&{&z&A&B&C&D&(%(%F%F%E&F&}&}&|&G&|&H&1&I%I&A$1&}&z$z$J&K&L&M&N&O&0&P&Q&0&a&R&a&a&a&R&a&", 2757 "{+$ 8@8@e&e&d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%`%f&S&T&U&V&W&Y@X&Y&Z&`& *.*+*@*#*@*r&$*#*r&%*&***=*-*;*y&z%A%z&A&A&>*B&,*,*'*)*!*!*~*{*F&}&{*}&{*]*G%G%y$^*/*J&(*2&_*:*<*=$[*}*<*=$<*|*1*", 2758 "{+{+8@2*e&e&d%d%d%d%d%d%d%d%d%e&3*4*4*4*4*4*5*4*4*4*4*4*4*4*4*4*`%f&6*6*7*8*9*0*a*b*c*d*e*f*g*h*i*j*+*k*h*l*m*n*m*o*p*q*r*s*t*u*v*w*x*y*y*z*A*B*C*D*E*F*G*E*G*F*H*G*F*~*]*{*I*x$J*K*L*G%K*M*o#o#I&N*O*O*", 2759 "{+{+8@2*e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&P*e&e&e&e&e&e&P*P*e&e&e&P*P*5*Q*R*S*T*U*V*W*X*Y*Z*`*d* =.=+=@=#=$=%=g@&=*===-=i*;=l*>=,=q*'=s*)=k@!=x*~={=]=^=/=(=_=:=(=<=<=]=[=}=|=]=]=1=2=3=|=4=5=2=2=2=3=6=6=6=", 2760 "{+{+7=e.e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&P*P*8=9=0=a=b=U*c=d=e=f=e@#=g=h=i=i=j=k=k=l=%===m=n=o=p=q=,=r=s=t=u=v=v*w=x=x=y=z=z=A=z=A=B=C=B=D=C=B=x=B=B=B=B=B=B=B=B=B=B=B=B=B=B=", 2761 "{+{+7=7=e&e&e&e&E=E=e&e&e&e&E=E=E=e&e&e&e&E=E=E=e&e&e&e&E=E=e&e&e&e&E=E=E=F=d%G=G=H=I=J=K=L=M=R+}+N=O=P=Q=j=i=h=R=e@@=S=-=T=h@l*U=V=W=X=Y=Z=`= - - -.-+-@- -#-$-%-$-&-*-$-=-%-----C=$-%---------B=B=B=B=", 2762 "{+{+7=7=;-;-E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=>-,-'-)-!-6*~-{-{-]-^-/-/-(-_-:-N=<-[-}-|-1-2-3- =4-5-6-7-8-9-0-0-a-b-c-d-e-f-g-h-h-i-j-k-h-h-i-j-l-m-n-o-i-j-l-m-n-j-l-p-n-", 2763 "{+{+7=7=;-;-E=E=E=E=E=E=E=E=q-r-s-t-t-u-u-v-v-v-u-w-x-u-u-u-u-u-u-u-u-v-v-u-u-u-u-u-v-v-u-u-u-u-v-v-u-y-z-A-B-C-D-E-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-U-V-W-V-e-X-Y-Z-`- ;.;Y-N N +;@;.;Y-N N N N N N N ", 2764 "#;#;d&d&$;$;%;%;%;%;%;%;%;%;&;*;=;-;-;-;;;>;,;>;>;>;;;>;>;>;>;>;>;>;>;>;';);>;>;>;>;>;';>;>;>;>;>;';);!;~;{;];^;/;(;_;_;:;<;[;};};|;1;2;3;4;5;6;7;8;9;9;0;a;0;0;b;h.a;0;0;b;h.c;h.d;0;b;h.c;h.d;h.c;h.d;", 2765 "#;#;;-;-$;$;e;e;e;e;e;e;e;e;e;e;e;f;f;f;f;e;e;e;f;f;f;f;f;f;f;f;f;f;f;f;g;%;f;f;f;f;f;g;f;f;f;f;f;g;%;h;i;j;k;l;m;n;o;p;q;r;r;s;t;u;v;w;x;y;z;A;B;C;6;D;E;F;G;G;H;I;F;G;G;H;I;J;J;K;G;H;I;J;J;K;I;J;J;K;", 2766 "#;#;;-;-$;$;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;L;e;e;e;e;e;e;e;e;e;e;e;e;L;M;N;O;P;Q;i;i;k;R;S;T;U;q;q;V;W;X;{;Y;Z;`; >.>+>@>#>+>$>6;#>#>+>%>&>G;G;G;G;G;&>G;G;G;G;G;G;G;G;G;", 2767 "#;#;d.;-$;$;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;*>e;e;e;e;e;e;e;e;e;e;e;e;*>=>->;>>>,>'>'>)>!>~>{>]>^>^>V;V;/>(>_>:><>[>}>|>1>2>3>2>4>5>6>7>8>9>0>G;G;G;G;9>0>G;G;G;G;G;G;G;G;", 2768 "#;#;d.d.a>a>e;e;e;e;e;e;e;e;e;e;b>b>c>c>c>c>c>b>e;e;e;e;e;e;e;e;e;e;e;e;e;e;d>e>f>g>h>i>j>k>l>l>m>m>n>n>o>o>p>q>r>r>s>t>u>v>v>u>w>';x>y>z>t;A>B>C>D>E>E>F>G>F>H>H>I>F>Y;J>w;K>L>K>M>J>w;K>L>K>M>K>L>K>M>", 2769 "#;#;d.d.a>a>N>e;N>O>O>O>N>e;N>O>O>P>Q>R>S>R>Q>O>O>O>N>e;N>O>O>O>N>e;N>N>O>T>e;e;e;U>U>U>U>f;V>W>o>o>o>o>X>X>Y>Y>n>n>Z>Z>`> ,.,t>t>u>u>w>+,@,#,$,%,A>&,*,=,B>[>-,w;<>C>[>-,w;w;w;w;w;-,w;w;w;w;w;w;w;w;w;", 2770 "#;;,;-;-a>a>N>N>N>O>O>O>N>N>N>O>O>O>O>N>N>N>O>O>O>O>N>N>N>O>O>O>N>N>N>N>O>>,,,,,,,',g>),!,~,{,{,*>U>e;f;],o>%;o>^,^,/,/,l>q>(,_,t>u>:,<,v>[,},|,1,2,%,%,3,4,5,6,7,8,9,5,6,0,G>G>Y;G>6,0,G>G>Y;G>G>G>Y;G>", 2771 ";,;,;-;-O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>P>a,b,',',c,c,f>),e>d,e,{,{,U>U>f,f,U>U>g,g,*>g;h,^,^,`>`>q>i,t>j,k,k,l,w>m,n,o,p,q,r,s,t,p,u,v,w,x,y,z,u,v,w,x,y,z,w,x,y,z,", 2772 ";,;,b b O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>A,A,A,B,C,D,E,F,c,',g>G,!,H,~,e,{,I,J,J,K,K,U>f,f,J,L,M,N,L;O,i,P,.,l,Q,k,k,k,k,k,k,R,v,k,k,k,R,v,S,T,U,k,R,v,S,T,U,v,S,T,U,", 2773 ";,;,b V,W,W,X,X,O>X,X,X,X,X,O>X,X,X,X,X,X,O>X,X,X,X,X,X,O>X,X,X,X,X,O>X,X,O>O>O>O>B,B,B,B,Y,O>O>Z,`,T>T> '',g>.'+'e,{,{,e,+'+'e,e,{,J,K,e;@'N,O,#'$'%'%'j,%'j,&'k,k,%'j,&'k,k,k,k,k,&'k,k,k,k,k,k,k,k,k,", 2774 ";,;,b V,W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,*'O>O>O>O>O>O>O>O>B,B,A,A,B,C,='-'`,;'>'>',''')'!'!'e>e>~'~'~,~,{'{,*>*>e;]']']']']']'^'/']']']'^'/':,(':,]'^'/':,(':,/':,(':,", 2775 ";,;,V,V,W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,_':'<'['}'|'|'O>O>O>O>O>O>O>Y,Y,1'1'B,B,2'2'C,3'-'>'c,)')'!'),4'{'e;]'e;*>*>e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;", 2776 ";,;,5'5'W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,W,6'6'6'7'8'9'0'a'b'c'd'd'}'}'O>O>O>O>O>O>O>O>Y,1'1'['['e'e'f'g'h'i'j'k'G,),!,l'j'm'n'b>b>),m'b>e;e;e;e;e;b>e;e;e;e;e;e;e;e;e;", 2777 ";,;,b b o'o'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'W,q'q'q'r's't'u'v'w'x'y'z'A'B'C'D'2'2'B,B,O>O>O>O>O>O>O>O>O>O>O>Y,Y,C,C,='='='E'F'3'3'3'G'Z,='F'F'G'H'I'J'F'F'G'H'I'J'G'H'I'J'", 2778 ";,;,b b K'K'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'W,W,W,W,W,L'L'q'r'M'N'O'P'u'N's'Q'R'S'A'T'U'C'V'9'0'W'D'}'X'|'O>O>B,B,O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>", 2779 ";,;,b b K'K'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'Y'Y'Y'Z'`' ).)+)+)+)W,W,W,W,L'L'q'q'r'r's'M'N'P'@)A'#)$)%)&)*)=)B,|'|'O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>", 2780 "{+;,$ -);)K'p'p'o'p'p'p'p'p'o'p'p'p'p'p'p'o'p'p'p'p'p'p'o'p'p'p'p'p'o'o'p'p'p'p'p'p'p'p'p'p'>)>)Y'Y'>)Z',)')))!)~)+)W,W,W,W,W,W,W,W,W,W,W,L'L'{)s't'])^)/)])/)/)O>()])/)/)O>()O>_)O>/)O>()O>_)O>()O>_)O>", 2781 ":);,;,;)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)[)M M M M M M M M M M M M M M M M M M })})|)|)})M M 1)2)3)4)5)6)6)6)7)7)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)", 2782 "9)#;;,;,$ -)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)0)a)a)a)b)c)d)e)f)g)h)i)i)j)j)M M M M M M M M M M M })})})})M k)k)M M k)l)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)", 2783 "+ 9)m)n)$ #;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;o)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)", 2784 "+ + 9)a m)q)r)s)r)s)r)s)r)s)r)r)s)r)s)r)s)r)r)s)r)s)r)s)r)s)r)s)r)s)r)s)r)t)u)v)w)x)x)w)y)z)A)A)B)B)B)B)w)w)C)C)w)w)B)B)B)B)B)w)w)w)w)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)D)B)B)B)B)B)D)B)B)B)D)B)", 2785 ". + + 9)9)9)q)E)q)E)q)E)q)E)q)q)E)q)E)q)E)q)q)E)q)E)q)E)q)E)q)E)q)E)q)E)q)F)G)H)E)I)J)K)H)L)L)L)L)L)L)L)H)H)M)M)H)H)L)L)G)L)L)H)H)H)H)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)N)L)L)L)L)L)N)L)L)L)N)L)", 2786 ". . 0 . + O)P)O)P)O)P)O)P)O)P)P)O)P)O)P)O)P)P)O)P)O)P)O)P)O)P)O)P)O)P)O)P)O)Q)R)S)T)U)V)W)X)W)W)V)V)V)V)V)V)V)V)Y)Y)Z)Z)Y)Z)Z)Y)Y)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)Y)V)V)V)V)V)Y)V)V)V)Y)V)", 2787 ". . . 0 0 0 . 0 0 0 + 0 + 0 + 0 + 0 + 0 + 0 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 0 `) !+ + + .! !`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)+!`)`)`)`)`)+!`)`)`)+!`)"}; 2788 2789 2790 static char * listviewhighcornerright_xpm[] = { 2791 "100 46 780 2", 2792 " c None", 2793 ". c #6A779D", 2794 "+ c #6C789C", 2795 "@ c #6C789D", 2796 "# c #6B789D", 2797 "$ c #6A779E", 2798 "% c #66759E", 2799 "& c #64749E", 2800 "* c #63749E", 2801 "= c #61739D", 2802 "- c #576D9B", 2803 "; c #556C9C", 2804 "> c #4D679D", 2805 ", c #4A649D", 2806 "' c #49629D", 2807 ") c #465E9C", 2808 "! c #40579C", 2809 "~ c #3B5394", 2810 "{ c #2C4E97", 2811 "] c #314993", 2812 "^ c #2B4595", 2813 "/ c #1B4296", 2814 "( c #253D93", 2815 "_ c #19418F", 2816 ": c #0F3C96", 2817 "< c #42599E", 2818 "[ c #758DC3", 2819 "} c #E8EAE7", 2820 "| c #EEF0ED", 2821 "1 c #FBFBFC", 2822 "2 c #6F7D9B", 2823 "3 c #6F7D9A", 2824 "4 c #6E7B9C", 2825 "5 c #67759E", 2826 "6 c #63739E", 2827 "7 c #62739D", 2828 "8 c #596F9C", 2829 "9 c #4A639D", 2830 "0 c #47609C", 2831 "a c #445B9F", 2832 "b c #3E5697", 2833 "c c #2E509A", 2834 "d c #2D509A", 2835 "e c #2D4F99", 2836 "f c #2D4F98", 2837 "g c #28418A", 2838 "h c #3E51A3", 2839 "i c #D0D3DC", 2840 "j c #A1B6EF", 2841 "k c #A2B6F0", 2842 "l c #A1B6F0", 2843 "m c #A3B6F0", 2844 "n c #A0B6EF", 2845 "o c #9DB6EE", 2846 "p c #9CB5EF", 2847 "q c #9CB2F0", 2848 "r c #9FB5EE", 2849 "s c #9CB4EB", 2850 "t c #9AB3EC", 2851 "u c #9AB0EC", 2852 "v c #9DB3EB", 2853 "w c #9BB4EC", 2854 "x c #9BB4EE", 2855 "y c #9BB1EF", 2856 "z c #9BB0F0", 2857 "A c #90ACF0", 2858 "B c #93ABEE", 2859 "C c #91A8EB", 2860 "D c #8BA3E8", 2861 "E c #88A1E7", 2862 "F c #809DE9", 2863 "G c #7A99E8", 2864 "H c #7491E5", 2865 "I c #698AE4", 2866 "J c #6184E3", 2867 "K c #507EDC", 2868 "L c #4E7CDB", 2869 "M c #4F7DDC", 2870 "N c #5479DA", 2871 "O c #567BDC", 2872 "P c #577CDD", 2873 "Q c #5074DA", 2874 "R c #5174DB", 2875 "S c #5175DC", 2876 "T c #5276DD", 2877 "U c #4D71DE", 2878 "V c #4C72D8", 2879 "W c #3A6CE0", 2880 "X c #2B49A6", 2881 "Y c #E0E2DF", 2882 "Z c #93AAE9", 2883 "` c #94A9E8", 2884 " . c #94AAE9", 2885 ".. c #93A9E9", 2886 "+. c #92AAE9", 2887 "@. c #8DA9E8", 2888 "#. c #8CA7E9", 2889 "$. c #92ABE9", 2890 "%. c #8EAAE9", 2891 "&. c #8EA9E9", 2892 "*. c #8FAAE9", 2893 "=. c #8CA8E9", 2894 "-. c #8CA2E7", 2895 ";. c #86A1E6", 2896 ">. c #839EE9", 2897 ",. c #7F9CE9", 2898 "'. c #7A97E8", 2899 "). c #7693E7", 2900 "!. c #6E8EE8", 2901 "~. c #678AE9", 2902 "{. c #5D84E3", 2903 "]. c #577CDF", 2904 "^. c #4E77DF", 2905 "/. c #4A70DB", 2906 "(. c #4870DB", 2907 "_. c #4870DC", 2908 ":. c #4770E3", 2909 "<. c #496FDC", 2910 "[. c #486EDB", 2911 "}. c #466FE4", 2912 "|. c #466EE3", 2913 "1. c #4167D9", 2914 "2. c #4066D8", 2915 "3. c #3F66D8", 2916 "4. c #3D64D7", 2917 "5. c #3960DA", 2918 "6. c #476DD9", 2919 "7. c #446EE5", 2920 "8. c #305EC8", 2921 "9. c #8EAAE8", 2922 "0. c #8FAAE8", 2923 "a. c #91AAE9", 2924 "b. c #8FA9E8", 2925 "c. c #8BA8E8", 2926 "d. c #8AA7E9", 2927 "e. c #8BA5EA", 2928 "f. c #8AA7E8", 2929 "g. c #87A2E6", 2930 "h. c #859FE8", 2931 "i. c #7F9DE8", 2932 "j. c #7C9AE8", 2933 "k. c #7B95E7", 2934 "l. c #7090E8", 2935 "m. c #6B8BE9", 2936 "n. c #6386E6", 2937 "o. c #5881E1", 2938 "p. c #5479DE", 2939 "q. c #4D74DE", 2940 "r. c #476EDB", 2941 "s. c #446EE1", 2942 "t. c #446EE0", 2943 "u. c #446EDF", 2944 "v. c #446DE0", 2945 "w. c #426ADF", 2946 "x. c #3C64DA", 2947 "y. c #4360CC", 2948 "z. c #D3D5D2", 2949 "A. c #E6E3E8", 2950 "B. c #8DA2E7", 2951 "C. c #8CA6EA", 2952 "D. c #8DA3E9", 2953 "E. c #88A2E7", 2954 "F. c #87A1E7", 2955 "G. c #8AA1E7", 2956 "H. c #849EE9", 2957 "I. c #7D9AE9", 2958 "J. c #7B98E8", 2959 "K. c #7796E5", 2960 "L. c #7191E7", 2961 "M. c #688CE9", 2962 "N. c #6687E5", 2963 "O. c #5C83E1", 2964 "P. c #557BDE", 2965 "Q. c #4F76DE", 2966 "R. c #4C72DE", 2967 "S. c #456EDF", 2968 "T. c #426AD9", 2969 "U. c #4269D9", 2970 "V. c #4269D8", 2971 "W. c #3D64D9", 2972 "X. c #3A61DA", 2973 "Y. c #345ED6", 2974 "Z. c #335ECF", 2975 "`. c #C6C3C8", 2976 " + c #86A1E7", 2977 ".+ c #87A2E7", 2978 "++ c #87A0E7", 2979 "@+ c #859EE8", 2980 "#+ c #849DE9", 2981 "$+ c #7E9BE9", 2982 "%+ c #7A99E9", 2983 "&+ c #7A95E5", 2984 "*+ c #7593E7", 2985 "=+ c #6F8EE9", 2986 "-+ c #668AE5", 2987 ";+ c #6386E0", 2988 ">+ c #5B82DF", 2989 ",+ c #5379DE", 2990 "'+ c #5075DE", 2991 ")+ c #4B6FDC", 2992 "!+ c #446AD7", 2993 "~+ c #4269D6", 2994 "{+ c #4269D5", 2995 "]+ c #3E65D7", 2996 "^+ c #C9CAC9", 2997 "/+ c #869EE9", 2998 "(+ c #859FE9", 2999 "_+ c #849FE9", 3000 ":+ c #829DE8", 3001 "<+ c #819DE8", 3002 "[+ c #7B9AE9", 3003 "}+ c #7A96E6", 3004 "|+ c #7290E8", 3005 "1+ c #698CE6", 3006 "2+ c #6689E0", 3007 "3+ c #5D84E0", 3008 "4+ c #587FDF", 3009 "5+ c #5377DD", 3010 "6+ c #4B74DE", 3011 "7+ c #496BD8", 3012 "8+ c #7C9BE9", 3013 "9+ c #7E9CE9", 3014 "0+ c #7D9AEA", 3015 "a+ c #7D9BEA", 3016 "b+ c #7D98E8", 3017 "c+ c #7C98E8", 3018 "d+ c #7796E4", 3019 "e+ c #7592E6", 3020 "f+ c #7390E1", 3021 "g+ c #698DE0", 3022 "h+ c #6588DE", 3023 "i+ c #5E84E0", 3024 "j+ c #5880DF", 3025 "k+ c #5479DC", 3026 "l+ c #4F75DE", 3027 "m+ c #4A6FDB", 3028 "n+ c #436AD7", 3029 "o+ c #3F65D7", 3030 "p+ c #BAC3BE", 3031 "q+ c #7B9AE8", 3032 "r+ c #7B9AEA", 3033 "s+ c #7A9AEA", 3034 "t+ c #7B99E9", 3035 "u+ c #7D97E7", 3036 "v+ c #7D95E6", 3037 "w+ c #7D95E5", 3038 "x+ c #7C95E6", 3039 "y+ c #7493E3", 3040 "z+ c #7290DF", 3041 "A+ c #6C8DDE", 3042 "B+ c #6B89E1", 3043 "C+ c #6486DF", 3044 "D+ c #5D81DF", 3045 "E+ c #567DDE", 3046 "F+ c #4F73DE", 3047 "G+ c #496EDA", 3048 "H+ c #355ED6", 3049 "I+ c #345ED5", 3050 "J+ c #7E95E5", 3051 "K+ c #7C97E8", 3052 "L+ c #7C97E7", 3053 "M+ c #7B94E6", 3054 "N+ c #7A95E4", 3055 "O+ c #7695E5", 3056 "P+ c #7694E4", 3057 "Q+ c #7994E6", 3058 "R+ c #7995E4", 3059 "S+ c #7594E4", 3060 "T+ c #7391E2", 3061 "U+ c #6E8EDE", 3062 "V+ c #6B8ADE", 3063 "W+ c #6688DF", 3064 "X+ c #5F84E0", 3065 "Y+ c #5980E0", 3066 "Z+ c #4D72DD", 3067 "`+ c #456BD7", 3068 " @ c #4168D6", 3069 ".@ c #3C64D7", 3070 "+@ c #335ED0", 3071 "@@ c #4659C7", 3072 "#@ c #7292E1", 3073 "$@ c #7392E1", 3074 "%@ c #7492E1", 3075 "&@ c #718FDF", 3076 "*@ c #6F8EDE", 3077 "=@ c #6D8BDE", 3078 "-@ c #6B88DF", 3079 ";@ c #597FDF", 3080 ">@ c #557ADD", 3081 ",@ c #5176DC", 3082 "'@ c #4D74DD", 3083 ")@ c #496DDA", 3084 "!@ c #3860D8", 3085 "~@ c #7391E0", 3086 "{@ c #7290DE", 3087 "]@ c #6D8EDD", 3088 "^@ c #6D8DDD", 3089 "/@ c #7190E0", 3090 "(@ c #6C8DDD", 3091 "_@ c #6B89DF", 3092 ":@ c #6487E0", 3093 "<@ c #6085DF", 3094 "[@ c #5F81DE", 3095 "}@ c #567EDE", 3096 "|@ c #4F74D9", 3097 "1@ c #466BD7", 3098 "2@ c #4067D5", 3099 "3@ c #3C63D7", 3100 "4@ c #335ED3", 3101 "5@ c #335ED1", 3102 "6@ c #718EDD", 3103 "7@ c #728EDD", 3104 "8@ c #748EDD", 3105 "9@ c #708EDD", 3106 "0@ c #6F8DDD", 3107 "a@ c #6E8DDD", 3108 "b@ c #6C8ADE", 3109 "c@ c #6C89DF", 3110 "d@ c #6988DF", 3111 "e@ c #6387DF", 3112 "f@ c #6282DE", 3113 "g@ c #5681E0", 3114 "h@ c #577BDD", 3115 "i@ c #5277DB", 3116 "j@ c #4D73D8", 3117 "k@ c #4A70D8", 3118 "l@ c #436AD5", 3119 "m@ c #3F66D6", 3120 "n@ c #3C63D8", 3121 "o@ c #3960D8", 3122 "p@ c #3860D7", 3123 "q@ c #335ED2", 3124 "r@ c #345ED4", 3125 "s@ c #6C88DF", 3126 "t@ c #6D88DF", 3127 "u@ c #6B89DE", 3128 "v@ c #6888DF", 3129 "w@ c #6587E0", 3130 "x@ c #6989DF", 3131 "y@ c #6687E0", 3132 "z@ c #6287E0", 3133 "A@ c #6281DD", 3134 "B@ c #5881E0", 3135 "C@ c #557ADB", 3136 "D@ c #5176D9", 3137 "E@ c #4E75D7", 3138 "F@ c #4A6FD8", 3139 "G@ c #476BD6", 3140 "H@ c #4067D6", 3141 "I@ c #3C62D7", 3142 "J@ c #3C60D4", 3143 "K@ c #365ED1", 3144 "L@ c #345ED3", 3145 "M@ c #6786DF", 3146 "N@ c #5F85E0", 3147 "O@ c #5F86E0", 3148 "P@ c #6186DF", 3149 "Q@ c #6286E0", 3150 "R@ c #6284DF", 3151 "S@ c #6384DF", 3152 "T@ c #5B7FDE", 3153 "U@ c #577DDC", 3154 "V@ c #557BDA", 3155 "W@ c #5278D8", 3156 "X@ c #4E76D6", 3157 "Y@ c #4C72D7", 3158 "Z@ c #486DD8", 3159 "`@ c #4469D6", 3160 " # c #3F62D2", 3161 ".# c #3C60CF", 3162 "+# c #345ECF", 3163 "@# c #6086DF", 3164 "## c #6085E0", 3165 "$# c #6285DF", 3166 "%# c #6383DD", 3167 "&# c #6481DC", 3168 "*# c #6380DD", 3169 "=# c #6183DE", 3170 "-# c #6083DD", 3171 ";# c #6081DC", 3172 "># c #6080DD", 3173 ",# c #6083DE", 3174 "'# c #6181DC", 3175 ")# c #6280DD", 3176 "!# c #577EDB", 3177 "~# c #557CD7", 3178 "{# c #4F76D6", 3179 "]# c #4E74D7", 3180 "^# c #466CD7", 3181 "/# c #3B64D6", 3182 "(# c #4261CD", 3183 "_# c #375FCE", 3184 ":# c #5A7FD8", 3185 "<# c #6281DA", 3186 "[# c #5F81D8", 3187 "}# c #5C80D8", 3188 "|# c #557DD7", 3189 "1# c #577ED8", 3190 "2# c #567ED7", 3191 "3# c #587DD8", 3192 "4# c #577DD8", 3193 "5# c #587ED8", 3194 "6# c #567DD8", 3195 "7# c #5379D9", 3196 "8# c #5177D7", 3197 "9# c #4D74D5", 3198 "0# c #486ED9", 3199 "a# c #4068D4", 3200 "b# c #3D65D2", 3201 "c# c #4361CC", 3202 "d# c #345ECE", 3203 "e# c #325DCF", 3204 "f# c #2C5AD1", 3205 "g# c #3959C5", 3206 "h# c #547BD8", 3207 "i# c #567DD7", 3208 "j# c #557BD8", 3209 "k# c #5279D9", 3210 "l# c #5278D9", 3211 "m# c #4D74D6", 3212 "n# c #4B71D8", 3213 "o# c #496CD8", 3214 "p# c #4669D7", 3215 "q# c #3D66D3", 3216 "r# c #3F62CF", 3217 "s# c #4260CC", 3218 "t# c #5379D8", 3219 "u# c #4E75D4", 3220 "v# c #4C73D7", 3221 "w# c #476CD7", 3222 "x# c #4869D0", 3223 "y# c #4067D2", 3224 "z# c #3D64D1", 3225 "A# c #4261CC", 3226 "B# c #395FCE", 3227 "C# c #4F75D3", 3228 "D# c #5074D2", 3229 "E# c #5174D1", 3230 "F# c #5175D1", 3231 "G# c #4F74D3", 3232 "H# c #4C73D5", 3233 "I# c #4C73D4", 3234 "J# c #4A72D1", 3235 "K# c #4B70CF", 3236 "L# c #506CCC", 3237 "M# c #4D6BCE", 3238 "N# c #4167D0", 3239 "O# c #3D65D1", 3240 "P# c #3F63CF", 3241 "Q# c #3B5FCD", 3242 "R# c #3159CD", 3243 "S# c #4971D0", 3244 "T# c #4870CF", 3245 "U# c #4C6FCF", 3246 "V# c #4E6CCE", 3247 "W# c #4E6BCE", 3248 "X# c #4769CF", 3249 "Y# c #3D66D0", 3250 "Z# c #3C65D1", 3251 "`# c #4062CE", 3252 " $ c #3D5FCD", 3253 ".$ c #365FCF", 3254 "+$ c #325DCD", 3255 "@$ c #2D5AD0", 3256 "#$ c #3859C5", 3257 "$$ c #355FCF", 3258 "%$ c #355ECF", 3259 "&$ c #335ECE", 3260 "*$ c #305CCD", 3261 "=$ c #2B5ACE", 3262 "-$ c #3056C9", 3263 ";$ c #2553C6", 3264 ">$ c #2153C8", 3265 ",$ c #1F4FC7", 3266 "'$ c #274CC5", 3267 ")$ c #214AC7", 3268 "!$ c #1C48C8", 3269 "~$ c #1244C9", 3270 "{$ c #1043C9", 3271 "]$ c #1144C9", 3272 "^$ c #2A45BE", 3273 "/$ c #2744B5", 3274 "($ c #1D49C0", 3275 "_$ c #2B58DE", 3276 ":$ c #002D94", 3277 "<$ c #2B59CA", 3278 "[$ c #2A59CA", 3279 "}$ c #2E57C8", 3280 "|$ c #3255C6", 3281 "1$ c #3355C5", 3282 "2$ c #1C52C8", 3283 "3$ c #1D50C7", 3284 "4$ c #234FC6", 3285 "5$ c #264CC5", 3286 "6$ c #1D48C7", 3287 "7$ c #1245C8", 3288 "8$ c #1F44C2", 3289 "9$ c #2945BE", 3290 "0$ c #2A45BD", 3291 "a$ c #2040BF", 3292 "b$ c #3156C7", 3293 "c$ c #3056C7", 3294 "d$ c #3354C5", 3295 "e$ c #3355C6", 3296 "f$ c #3255C5", 3297 "g$ c #3254C5", 3298 "h$ c #1952C7", 3299 "i$ c #1951C8", 3300 "j$ c #2050C7", 3301 "k$ c #274CC4", 3302 "l$ c #244CC6", 3303 "m$ c #1F49C7", 3304 "n$ c #1E47C5", 3305 "o$ c #2045C3", 3306 "p$ c #1C44BF", 3307 "q$ c #2045BE", 3308 "r$ c #2040B8", 3309 "s$ c #3254C6", 3310 "t$ c #3055C6", 3311 "u$ c #2A54C6", 3312 "v$ c #2353C7", 3313 "w$ c #3054C5", 3314 "x$ c #2F55C5", 3315 "y$ c #2A54C5", 3316 "z$ c #2553C5", 3317 "A$ c #2F54C5", 3318 "B$ c #3155C6", 3319 "C$ c #2A54C7", 3320 "D$ c #1A52C8", 3321 "E$ c #204FC2", 3322 "F$ c #264DC6", 3323 "G$ c #234BC5", 3324 "H$ c #1D48C1", 3325 "I$ c #1E48BF", 3326 "J$ c #2646BE", 3327 "K$ c #2B45BD", 3328 "L$ c #1E43BE", 3329 "M$ c #2643BF", 3330 "N$ c #2243BF", 3331 "O$ c #3049BC", 3332 "P$ c #1E50BE", 3333 "Q$ c #1D50C0", 3334 "R$ c #1D50BF", 3335 "S$ c #1852C1", 3336 "T$ c #1E51C0", 3337 "U$ c #214FBF", 3338 "V$ c #2050C0", 3339 "W$ c #244EBF", 3340 "X$ c #2151C0", 3341 "Y$ c #234FBF", 3342 "Z$ c #2350C0", 3343 "`$ c #2351C0", 3344 " % c #244FBF", 3345 ".% c #2250C0", 3346 "+% c #2051C0", 3347 "@% c #1E50C0", 3348 "#% c #244DBE", 3349 "$% c #274DBF", 3350 "%% c #244CBF", 3351 "&% c #1C48C0", 3352 "*% c #2247BF", 3353 "=% c #2C44BD", 3354 "-% c #1C44BE", 3355 ";% c #1444BF", 3356 ">% c #1841BF", 3357 ",% c #1F40BF", 3358 "'% c #254DBE", 3359 ")% c #224FBE", 3360 "!% c #224FBF", 3361 "~% c #234EBF", 3362 "{% c #254CBD", 3363 "]% c #244DBD", 3364 "^% c #244CBD", 3365 "/% c #264DBE", 3366 "(% c #264DBD", 3367 "_% c #214BC0", 3368 ":% c #1D48C0", 3369 "<% c #2347BF", 3370 "[% c #2B44BD", 3371 "}% c #2444BE", 3372 "|% c #0F42BF", 3373 "1% c #0641BF", 3374 "2% c #0F41BF", 3375 "3% c #1741BE", 3376 "4% c #1F40BD", 3377 "5% c #234BBF", 3378 "6% c #234CBE", 3379 "7% c #214BBE", 3380 "8% c #244CBE", 3381 "9% c #214ABE", 3382 "0% c #214ABF", 3383 "a% c #1F48C0", 3384 "b% c #2746BE", 3385 "c% c #1F43BE", 3386 "d% c #0941BE", 3387 "e% c #0342BA", 3388 "f% c #0242BC", 3389 "g% c #1241B8", 3390 "h% c #1F40B7", 3391 "i% c #2F41AC", 3392 "j% c #2644AE", 3393 "k% c #2D49B4", 3394 "l% c #2649B6", 3395 "m% c #2949B7", 3396 "n% c #2849B5", 3397 "o% c #2149B8", 3398 "p% c #1E49B9", 3399 "q% c #1F48B8", 3400 "r% c #1F49B9", 3401 "s% c #2545B6", 3402 "t% c #2744B7", 3403 "u% c #2844B7", 3404 "v% c #2043B8", 3405 "w% c #1241B7", 3406 "x% c #1340B8", 3407 "y% c #0D41B8", 3408 "z% c #1941B8", 3409 "A% c #1F40B8", 3410 "B% c #203FB8", 3411 "C% c #2549B5", 3412 "D% c #2648B6", 3413 "E% c #2547B7", 3414 "F% c #2248B7", 3415 "G% c #2048B7", 3416 "H% c #2346B6", 3417 "I% c #2146B6", 3418 "J% c #2247B7", 3419 "K% c #2148B7", 3420 "L% c #2743B4", 3421 "M% c #2643B5", 3422 "N% c #2542B6", 3423 "O% c #1D42B7", 3424 "P% c #0E42B8", 3425 "Q% c #0C41B8", 3426 "R% c #1341B8", 3427 "S% c #1740B8", 3428 "T% c #1C41B8", 3429 "U% c #1F40B1", 3430 "V% c #2644B5", 3431 "W% c #2544B5", 3432 "X% c #2544B4", 3433 "Y% c #2444B5", 3434 "Z% c #2444B4", 3435 "`% c #2744B4", 3436 " & c #2241B7", 3437 ".& c #1D41B8", 3438 "+& c #0B42B8", 3439 "@& c #0942B8", 3440 "#& c #0C42B8", 3441 "$& c #0F41B8", 3442 "%& c #1641B8", 3443 "&& c #2442B5", 3444 "*& c #2543B3", 3445 "=& c #2342B2", 3446 "-& c #2341B4", 3447 ";& c #2141B3", 3448 ">& c #2141B5", 3449 ",& c #2140B5", 3450 "'& c #2040B5", 3451 ")& c #1C40B7", 3452 "!& c #1B41B3", 3453 "~& c #0142B6", 3454 "{& c #0E41B7", 3455 "]& c #1141B7", 3456 "^& c #1440B2", 3457 "/& c #113FB0", 3458 "(& c #1440B0", 3459 "_& c #213EAF", 3460 ":& c #233DAE", 3461 "<& c #223EAF", 3462 "[& c #1E40B1", 3463 "}& c #173EAD", 3464 "|& c #1440AF", 3465 "1& c #0D40AF", 3466 "2& c #0941B0", 3467 "3& c #0D3FAE", 3468 "4& c #1B3CAC", 3469 "5& c #233CAD", 3470 "6& c #203FB0", 3471 "7& c #273BAD", 3472 "8& c #1D40B0", 3473 "9& c #2040B1", 3474 "0& c #1E40B0", 3475 "a& c #1C40B0", 3476 "b& c #1B3DAC", 3477 "c& c #143DAC", 3478 "d& c #193DAD", 3479 "e& c #1B3DAD", 3480 "f& c #173DAD", 3481 "g& c #153DAC", 3482 "h& c #1C3CAC", 3483 "i& c #243CAD", 3484 "j& c #213FB0", 3485 "k& c #263BAA", 3486 "l& c #253CAE", 3487 "m& c #273AAC", 3488 "n& c #273AAD", 3489 "o& c #253BAD", 3490 "p& c #1D3CAC", 3491 "q& c #243BAD", 3492 "r& c #1E3CAC", 3493 "s& c #263BAD", 3494 "t& c #1A3DAC", 3495 "u& c #143DAB", 3496 "v& c #163DAC", 3497 "w& c #1A3CAC", 3498 "x& c #1F3CAD", 3499 "y& c #263BAB", 3500 "z& c #263BA6", 3501 "A& c #1E42A4", 3502 "B& c #2D40A5", 3503 "C& c #253BA6", 3504 "D& c #253CA7", 3505 "E& c #263AA5", 3506 "F& c #253BA7", 3507 "G& c #1E3BA6", 3508 "H& c #193DA6", 3509 "I& c #173DA5", 3510 "J& c #143DA6", 3511 "K& c #1A3DA7", 3512 "L& c #133DA6", 3513 "M& c #123DA5", 3514 "N& c #1A3CA7", 3515 "O& c #243BA6", 3516 "P& c #263AA7", 3517 "Q& c #273BA7", 3518 "R& c #263AA6", 3519 "S& c #223BA6", 3520 "T& c #1D3BA6", 3521 "U& c #173CA6", 3522 "V& c #133DA5", 3523 "W& c #1B3DA6", 3524 "X& c #193DA5", 3525 "Y& c #123DA4", 3526 "Z& c #163CA5", 3527 "`& c #213CA6", 3528 " * c #273BA8", 3529 ".* c #263BA7", 3530 "+* c #253BA5", 3531 "@* c #263BA5", 3532 "#* c #1C3BA6", 3533 "$* c #1B3BA9", 3534 "%* c #133BA8", 3535 "&* c #0A3BA7", 3536 "** c #083AA6", 3537 "=* c #123CA5", 3538 "-* c #0839A8", 3539 ";* c #0239A6", 3540 ">* c #123AA8", 3541 ",* c #1F49C8", 3542 "'* c #2F4DA4", 3543 ")* c #2E4DA3", 3544 "!* c #384CA4", 3545 "~* c #3C4DA7", 3546 "{* c #394EA7", 3547 "]* c #3B4CA5", 3548 "^* c #3C52B1", 3549 "/* c #3551A8", 3550 "(* c #3759BE", 3551 "_* c #4161C7", 3552 ":* c #0033A8", 3553 "<* c #596FA9", 3554 "[* c #2F4DA3", 3555 "}* c #2D4BA5", 3556 "|* c #2E4CA4", 3557 "1* c #2C4AA5", 3558 "2* c #2D4BA4", 3559 "3* c #354DA4", 3560 "4* c #3A4BA4", 3561 "5* c #394DA6", 3562 "6* c #4056AD", 3563 "7* c #445BBB", 3564 "8* c #B5B7B4", 3565 "9* c #1B2F85", 3566 "0* c #242F79", 3567 "a* c #B5B5B5", 3568 "b* c #B5B2B6", 3569 "c* c #C0C3C3", 3570 "d* c #E3E3E4", 3571 "e* c #EBEDEA", 3572 ". + @ + # $ % & # $ % & # $ % & # $ % & & * = - ; > , ' ) ! ~ { { { { { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / / / ( / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / _ _ / / : / < [ } | | | 1 1 ", 3573 "2 2 2 2 3 2 4 @ 3 2 4 @ 3 2 4 @ 3 2 4 @ # 5 6 7 8 ; > 9 0 a b c d e f { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ( ( ( ( ( ( ( ( ( / / / / / / / / / / / / / / / / / _ _ _ _ _ _ _ _ _ _ _ g g _ / / : : : h i } 1 | 1 ", 3574 "j k l m n o p q n o p q r s t u v w x y z A B C D E F G H I J K L M N O P O O Q R S T T T T T T T T T T T T T T T T T T U U U U U U U U U U U U U U U U U U U U U U U U U U U U V V V U U W X : [ Y | | ", 3575 "Z ` . ...+.@.#...+.@.#.Z $.%.&.Z $.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.6.7.8.: h Y } 1 ", 3576 "9.0.a.b.c.c.d.e.f.c.d.e.f.c.d.e.f.c.d.e.g.h.i.j.k.l.m.n.o.p.q.r.s.s.t.u.u.v.w.x.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.y.5.7.6.: / z.A.} ", 3577 "-.B.C.D.-.E.g.F.G.E.g.F.G.E.g.F.G.E.g.F.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.V.U.U.W.X.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.y.Y.7.7.: : `.z.} ", 3578 " +.+g.;.++F.@+#+++F.@+#+++F.@+#+++F.@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+{+{+4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.Z.Z.y.y.5.7.7.: : ^+z.Y ", 3579 "/+(+_+#+H.H.>.:+H.H.>.:+H.H.>.:+H.H.>.<+[+}+*+|+1+2+3+4+5+6+7+{+{+4.4.4.4.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.Y.Y.Y.Y.Y.5.Y.Y.Y.Y.Y.Y.Y.Y.5.Y.Y.5.5.5.5.Y.Y.Y.Y.Y.Y.Z.Z.Z.Z.y.y.y.y.y.y.7.7.: : ^+i } ", 3580 "8+9+0+0+a+0+0+b+a+0+0+b+a+0+0+b+a+0+0+c+d+e+f+g+h+i+j+k+l+m+n+o+4.4.4.4.5.5.5.5.5.5.Y.Y.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.7.7.: : p+z.Y ", 3581 "q+r+r+s+t+u+v+w+t+u+v+w+t+u+v+w+t+u+x+&+y+z+A+B+C+D+E+5+F+G+~+4.4.4.4.5.5.5.5.5.H+Y.Y.Y.Y.Y.Y.Y.Y.I+Y.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.7.7.: : `.z.A.", 3582 "J+v+K+L+M+N+O+P+Q+R+O+P+Q+R+O+P+Q+R+O+S+T+U+V+W+X+Y+P.T Z+`+ @4.4..@5.5.5.5.5.5.Y.Y.Y.I+I+I+I+I++@+@Z.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.@@Z.7.7.: : p+z.Y ", 3583 "#@$@$@%@%@$@#@&@#@#@#@&@#@#@#@&@#@#@#@*@=@-@;+i+;@>@,@'@)@ @4.X.5.5.H+Y.Y.Y.!@Y.Y.I++@+@Z.Z.+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : `.z.A.", 3584 "#@$@~@~@~@{@]@^@/@{@]@^@/@{@]@^@/@{@]@(@_@:@<@[@}@k+|@V 1@2@3@5.5.5.Y.Y.I+4@I+5@+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : p+z.Y ", 3585 "6@7@8@9@0@a@b@c@a@a@b@c@a@a@b@c@a@a@b@d@e@<@f@g@h@i@j@k@l@m@n@o@o@p@Y.I+q@q@r@+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : `.z.A.", 3586 "s@t@u@_@_@v@w@w@x@v@w@w@x@v@y@y@x@v@:@z@A@B@P C@D@E@F@G@H@I@J@K@5@+@+@+@r@I+L@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.@@Z.W W : : p+z.Y ", 3587 "M@N@O@P@C+Q@Q@R@C+;+Q@R@C+;+;+S@C+Q@Q@R@T@U@V@W@X@Y@Z@`@4. #.#+#Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.8.Z.Z.Z.Z.8.8.Z.Z.y.@@@@W W : : `.z.A.", 3588 "@#O@O@##$#%#&#*#=#-#;#>#,#-#;#>#,#-#'#)#!#~#W@{#]#k@^#H@/#(#_#Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.8.8.Z.Z.Z.Z.Z.Z.Z.8.8.8.8.8.8.8.8.8.8.8.Z.Z.y.y.@@W W : : p+z.Y ", 3589 ":#<#[#}#|#1#2#3#4#5#1#4#4#1#1#4#4#1#1#6#7#8#9#V 0#`+a#b#c#d#e#Z.Z.Z.f#Z.Z.Z.f#f#f#f#f#f#f#f#f#f#g#g#g#g#g#8.8.8.8.8.8.8.8.8.g#g#g#g#8.g#8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.y.y.@@W W : : `.z.A.", 3590 "h#2#i#6#|#j#7#k#|#j#7#7#|#j#7#7#|#j#7#l#8#m#n#n#o#p#q#r#s#d#e#Z.Z.Z.f#f#f#f#Z.f#f#g#g#g#g#g#g#g#g#g#g#g#g#8.8.8.g#g#8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.y.y.y.y.8.8.8.y.y.@@W W : : p+z.Y ", 3591 "l#7#7#l#7#7#7#W@7#7#7#W@7#7#k#W@t#7#7#W@u#v#n#w#x#y#z#A#B#Z.e#f#f#Z.f#f#f#Z.Z.g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#8.8.8.g#g#g#g#8.8.g#g#g#g#g#g#8.8.g#8.8.y.8.8.y.y.8.y.y.y.y.@@W W : : `.z.A.", 3592 "C#D#E#F#G#H#I#J#G#H#I#J#G#H#I#J#G#H#I#J#K#L#M#N#O#P#s#Q#+#f#R#f#f#f#f#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#@@@@y.y.@@@@y.y.W W : : p+z.Y ", 3593 "S#S#S#S#S#T#S#U#S#T#S#U#S#T#S#U#S#T#S#U#V#W#X#Y#Z#`# $.$+$@$#$g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#@@@@@@@@@@@@@@@@@@y.y.W W : : `.z.A.", 3594 "+$Z..$$$%$+$&$*$%$+$&$*$%$+$&$*$%$+$&$*$=$-$;$>$,$'$)$!$~${$]$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$/$($($_$_$:$:$p+z.Y ", 3595 "<$<$<$<$<$[$}$|$<$[$}$|$<$[$}$|$<$[$}$|$1$2$3$4$5$)$6$7$8$9$0$a$a$a$a$a$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$($($_$_$:$:$`.z.A.", 3596 "b$c$c$c$d$e$e$f$g$|$|$1$d$e$e$1$d$e$e$1$h$i$j$k$l$m$n$o$p$9$q$a$a$a$a$a$a$a$a$^$a$a$^$^$^$^$^$^$a$r$r$r$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$($($_$_$:$:$p+z.Y ", 3597 "e$1$s$s$1$t$u$v$w$x$y$z$A$x$u$v$g$B$C$>$D$E$F$G$H$I$J$K$L$M$N$a$a$a$a$a$a$a$a$^$r$r$a$^$^$^$a$r$r$r$r$r$/$^$r$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$O$($_$_$:$:$`.z.A.", 3598 "P$Q$R$S$T$U$V$W$X$Y$Z$W$`$ %.%W$+%U$@%#%$%%%&%($*%=%-%;%>%>%,%r$r$r$r$r$a$a$a$/$/$/$r$r$r$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$O$($_$_$:$:$p+z.Y ", 3599 "'%W$)%!%~%{%'%]%~%^%'%]%~%^%'%]%~%^%/%(%_%&%:%<%[%}%|%1%2%3%4%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$r$/$/$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$r$/$/$/$/$/$O$($_$_$:$:$`.z.A.", 3600 "5%6%'%'%6%7%8%9%6%7%8%9%6%7%8%9%6%7%8%0%&%a%<%b%[%c%d%e%f%g%h%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$r$r$/$/$r$r$/$r$i%j%O$($_$_$:$:$p+z.Y ", 3601 "k%l%m%n%o%o%p%q%o%o%r%q%o%o%r%q%o%o%p%q%s%t%/$u%v%w%x%y%z%A%B%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$/$/$/$/$/$/$r$r$i%i%i%r$r$i%i%i%i%i%i%i%i%i%i%i%i%r$/$/$j%j%j%j%j%j%j%j%j%O$($_$_$:$:$`.z.A.", 3602 "C%D%E%F%G%H%I%J%K%H%I%J%K%H%I%J%K%H%I%J%L%M%N%O%P%Q%R%S%T%A%B%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$U%U%r$r$i%i%/$/$r$r$/$/$/$/$r$r$i%i%i%i%i%i%i%i%i%i%i%i%i%i%j%i%j%j%j%j%j%j%j%j%j%j%j%j%j%O$($_$_$:$:$p+z.Y ", 3603 "/$/$/$/$V%V%W%X%W%Y%Y%Z%W%W%Y%Z%W%W%W%`%`% &B%.&+&@&#&$&%&A%B%r$r$r$U%U%U%U%r$U%U%U%U%U%U%U%U%U%U%i%i%i%i%i%i%i%i%/$/$/$i%i%i%i%i%i%i%i%i%j%j%j%j%i%i%i%i%i%j%j%j%i%i%j%j%j%j%j%j%j%j%O$($_$_$:$:$`.z.A.", 3604 "&&*&=&-&=&;&>&,&=&;&>&,&=&;&>&,&=&;&>&'&)&!&~&{&]&^&/&(&_&:&<&U%U%U%U%U%U%U%U%U%U%U%U%U%i%i%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$($_$_$:$:$p+z.Y ", 3605 "U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%[&}&|&1&2&3&4&5&_&6&U%7&U%U%U%U%U%U%U%U%i%i%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$O$_$_$:$:$`.z.A.", 3606 "U%U%U%U%U%U%[&8&U%9&[&0&U%9&[&0&U%9&[&a&:&b&c&d&e&f&g&h&i&<&j&U%U%U%U%U%U%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$O$_$_$:$:$p+z.Y ", 3607 "k&l&m&7&7&n&o&p&7&n&q&r&s&s&q&r&s&n&o&p&t&u&u&g&v&w&x&q&n&m&y&7&7&U%U%7&z&7&z&U%A&B&i%i%B&B&i%i%B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&i%B&O$O$_$_$:$:$`.z.A.", 3608 "C&D&E&z&z&E&F&G&z&E&F&G&z&E&F&G&z&E&F&G&H&I&J&K&L&M&N&O&P&Q&z&z&z&z&z&z&z&z&z&z&z&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&O$O$_$_$:$:$p+z.Y ", 3609 "z&z&z&z&R&S&T&U&R&S&T&U&R&S&T&U&R&S&T&U&V&V&W&X&Y&Z&`&C&R&z&z&z&z&z&z&z&z&z&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&O$O$_$_$:$:$^+z.A.", 3610 "z& *.*+*@*#*$*%*@*#*$*%*@*#*$*%*@*#*$*%*&***=*-*;*>*k&P&+*z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&B&B&B&B&z&z&z&B&B&B&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&/$O$O$@@_$,*:$/ ^+z.Y ", 3611 "'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*)*'*!*~*{*]*^*^*^*/*/*/*/*/*/*/*^*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*^*/*/*/*/*/*h h ^*h h ^*^*h h ^*^*^*^*h ^*^*^*^*h ^*^*^*(*_*_*_*_*_$:*:$<*`.z.} ", 3612 "'*'*'*'*'*[*}*|*'*[*}*|*'*[*}*|*'*[*}*|*1*1*2*}*}*2*[*)*3*4*5*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*h h h h h h h h h h h h h h h h 6*7*_*_*_*_*^*:*:$: 8*z.Y } ", 3613 "9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*( <*8*^+z.Y } 1 ", 3614 "a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*8*b*8*b*8*b*8*b*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*8*8*8*b*8*`.z.A.Y | | ", 3615 "c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*p+`.p+`.p+`.p+`.`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+^+`.^+^+z.z.Y Y | | 1 ", 3616 "d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*A.Y A.Y A.Y A.Y Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y } } | | | | 1 1 ", 3617 "e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*} | } | } | } | | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | | | | 1 | | | 1 1 1 "}; 3618 3619 3620 static char * tabmiddle_xpm[] = { 3621 "33 42 32 1", 3622 " c None", 3623 ". c #CECFEF", 3624 "+ c #CECBE7", 3625 "@ c #C6C7E7", 3626 "# c #C6CBE7", 3627 "$ c #BDBEDE", 3628 "% c #BDC3DE", 3629 "& c #CECBEF", 3630 "* c #B5B6D6", 3631 "= c #ADAECE", 3632 "- c #ADB2CE", 3633 "; c #BDBAD6", 3634 "> c #B5BAD6", 3635 ", c #C6C3DE", 3636 "' c #ADAAC6", 3637 ") c #B5B2CE", 3638 "! c #B5B6CE", 3639 "~ c #A5A2BD", 3640 "{ c #A5A6BD", 3641 "] c #9C9EB5", 3642 "^ c #9CA2BD", 3643 "/ c #ADAEC6", 3644 "( c #C6C3E7", 3645 "_ c #9C9AB5", 3646 ": c #A5A6C6", 3647 "< c #949AAD", 3648 "[ c #A5AAC6", 3649 "} c #9496AD", 3650 "| c #BDBADE", 3651 "1 c #BDBED6", 3652 "2 c #9CA2B5", 3653 "3 c #A5AABD", 3654 "..........................+@.#.#.", 3655 "........................$@%&#.#..", 3656 "......................**$$@@&#.#.", 3657 ".....................=-;>,%+@.#..", 3658 "....................'')!$$@@&#.#.", 3659 "...................~{=)$$@@&#.#..", 3660 "..................]^'/;;(%&#.#...", 3661 "................._]:/*>,%&@.#.#..", 3662 ".................<{[)!$%+@.#.#...", 3663 "................}~{=!$%@@.#......", 3664 "................]^/-|$@@.#.......", 3665 "................]'/*;@@&#........", 3666 "...............<~[)>,%&#.#.......", 3667 "...............]~=)$%+#.#........", 3668 "...............]'/;1@@.#.........", 3669 "...............~{)*,%&#..........", 3670 "...............2/-$$@#...........", 3671 "...............~[*>(@&#..........", 3672 "...............^=)$%+#...........", 3673 "...............{'*>(@.#..........", 3674 "...............^=)$%+#...........", 3675 "...............{'*>(@.#..........", 3676 "...............^=)$%+#...........", 3677 "...............{'*>(@.#..........", 3678 "...............^=)$%+#...........", 3679 "...............{'*>(@.#..........", 3680 "...............^=)$%+#...........", 3681 "...............{'*>@@.#..........", 3682 "...............^=!$%&#...........", 3683 "...............{/*;@@.#..........", 3684 "...............{)!$%&#...........", 3685 "..............]'/;1@@.#..........", 3686 "..............23)>,%&#...........", 3687 "..............~=-$$@@.#..........", 3688 ".............]{/*;@@.#...........", 3689 "............<^[)>,%&#............", 3690 "............]{/!$%@@.#...........", 3691 "..........]^[-!$%@@.#............", 3692 ".........]^3/!>$@@.#.............", 3693 ".......<]^3/!>$@@&#..............", 3694 ".....<]2{[/!>$%@&#.#.............", 3695 "}<<_]2{3/-!>$%@&#.#.............."}; 3696 3697 3698 static char * tabselectedbeginn_xpm[] = { 3699 "33 39 28 1", 3700 " c None", 3701 ". c #CECFEF", 3702 "+ c #EFF3EF", 3703 "@ c #FFFBFF", 3704 "# c #F7FBF7", 3705 "$ c #FFFFFF", 3706 "% c #EFEFEF", 3707 "& c #F7F7F7", 3708 "* c #DEDFDE", 3709 "= c #E7E7E7", 3710 "- c #D6D3D6", 3711 "; c #DEE3DE", 3712 "> c #EFEBEF", 3713 ", c #F7F3F7", 3714 "' c #CECBCE", 3715 ") c #CECFCE", 3716 "! c #D6D7D6", 3717 "~ c #DEDBDE", 3718 "{ c #E7EBE7", 3719 "] c #C6C7C6", 3720 "^ c #E7E3E7", 3721 "/ c #BDC3BD", 3722 "( c #CED3CE", 3723 "_ c #BDBABD", 3724 ": c #C6C3C6", 3725 "< c #C6CBC6", 3726 "[ c #D6DBD6", 3727 "} c #BDBEBD", 3728 "..........................+@#$#$$", 3729 "........................%%&&@#$#$", 3730 "......................*==%%&&@#$$", 3731 "....................--*;>%,&@#$#$", 3732 "...................')!~={,+@#$#$$", 3733 "...................]-!^=%%&&@#$#$", 3734 "................../'(~;>%&&@#$#$$", 3735 "................._])!*={,&@#$#$$$", 3736 "................_])~*>%&&$#$$$$$$", 3737 "................:<!^{,&@#$$$$$$$$$$", 3757 "..............])~;%+@#$$$$$$$$$$$", 3758 "..............]-[={&&$#$$$$$$$$$$", 3759 ".............])!^=,&@#$$$$$$$$$$$", 3760 "............:'-*^%+@#$$$$$$$$$$$$", 3761 "............])~*>%&&$#$$$$$$$$$$$", 3762 "...........:'!*={,&@#$$$$$$$$$$$$", 3763 "..........:'-~^=,+@#$$$$$$$$$$$$$", 3764 ".......}]'-~^=%,&@#$$$$$$$$$$$$$$", 3765 ".....}:])-~^=%,+@#$#$$$$$$$$$$$$$", 3766 "}}}:]')-!*^=%,&@#$#$$$$$$$$$$$$$$"}; 3767 3768 3769 static char * tabselectedend_xpm[] = { 3770 "33 42 33 1", 3771 " c None", 3772 ". c #FFFFFF", 3773 "+ c #CECBE7", 3774 "@ c #C6C7E7", 3775 "# c #CECFEF", 3776 "$ c #C6CBE7", 3777 "% c #BDBEDE", 3778 "& c #BDC3DE", 3779 "* c #CECBEF", 3780 "= c #B5B6D6", 3781 "- c #ADAECE", 3782 "; c #ADB2CE", 3783 "> c #BDBAD6", 3784 ", c #B5BAD6", 3785 "' c #C6C3DE", 3786 ") c #ADAAC6", 3787 "! c #B5B2CE", 3788 "~ c #B5B6CE", 3789 "{ c #A5A2BD", 3790 "] c #A5A6BD", 3791 "^ c #9C9EB5", 3792 "/ c #9CA2BD", 3793 "( c #ADAEC6", 3794 "_ c #C6C3E7", 3795 ": c #9C9AB5", 3796 "< c #A5A6C6", 3797 "[ c #949AAD", 3798 "} c #A5AAC6", 3799 "| c #9496AD", 3800 "1 c #BDBADE", 3801 "2 c #BDBED6", 3802 "3 c #9CA2B5", 3803 "4 c #A5AABD", 3804 "..........................+@#$#$#", 3805 "........................%@&*$#$##", 3806 "......................==%%@@*$#$#", 3807 ".....................-;>,'&+@#$##", 3808 "....................))!~%%@@*$#$#", 3809 "...................{]-!%%@@*$#$##", 3810 "..................^/)(>>_&*$#$###", 3811 ".................:^<(=,'&*@#$#$##", 3812 ".................[]}!~%&+@#$#$###", 3813 "................|{]-~%&@@#$######", 3814 "................^/(;1%@@#$#######", 3815 "................^)(=>@@*$########", 3816 "...............[{}!,'&*$#$#######", 3817 "...............^{-!%&+$#$########", 3818 "...............^)(>2@@#$#########", 3819 "...............{]!='&*$##########", 3820 "...............3(;%%@$###########", 3821 "...............{}=,_@*$##########", 3822 ".............../-!%&+$###########", 3823 "...............])=,_@#$##########", 3824 ".............../-!%&+$###########", 3825 "...............])=,_@#$##########", 3826 ".............../-!%&+$###########", 3827 "...............])=,_@#$##########", 3828 ".............../-!%&+$###########", 3829 "...............])=,_@#$##########", 3830 ".............../-!%&+$###########", 3831 "...............])=,@@#$##########", 3832 ".............../-~%&*$###########", 3833 "...............](=>@@#$##########", 3834 "...............]!~%&*$###########", 3835 "..............^)(>2@@#$##########", 3836 "..............34!,'&*$###########", 3837 "..............{-;%%@@#$##########", 3838 ".............^](=>@@#$###########", 3839 "............[/}!,'&*$############", 3840 "............^](~%&@@#$###########", 3841 "..........^/};~%&@@#$############", 3842 ".........^/4(~,%@@#$#############", 3843 ".......[^/4(~,%@@*$##############", 3844 ".....[^3]}(~,%&@*$#$#############", 3845 "|[[:^3]4(;~,%&@*$#$##############"}; 3846 3847 3848 static char * tabend_xpm[] = { 3849 "33 42 3 1", 3850 " c None", 3851 ". c #CECFEF", 3852 "+ c #FFFFFF", 3853 "..........................+++++++", 3854 "........................+++++++++", 3855 "......................+++++++++++", 3856 ".....................++++++++++++", 3857 "....................+++++++++++++", 3858 "...................++++++++++++++", 3859 "..................+++++++++++++++", 3860 ".................++++++++++++++++", 3861 ".................++++++++++++++++", 3862 "................+++++++++++++++++", 3863 "................+++++++++++++++++", 3864 "................+++++++++++++++++", 3865 "...............++++++++++++++++++", 3866 "...............++++++++++++++++++", 3867 "...............++++++++++++++++++", 3868 "...............++++++++++++++++++", 3869 "...............++++++++++++++++++", 3870 "...............++++++++++++++++++", 3871 "...............++++++++++++++++++", 3872 "...............++++++++++++++++++", 3873 "...............++++++++++++++++++", 3874 "...............++++++++++++++++++", 3875 "...............++++++++++++++++++", 3876 "...............++++++++++++++++++", 3877 "...............++++++++++++++++++", 3878 "...............++++++++++++++++++", 3879 "...............++++++++++++++++++", 3880 "...............++++++++++++++++++", 3881 "...............++++++++++++++++++", 3882 "...............++++++++++++++++++", 3883 "...............++++++++++++++++++", 3884 "..............+++++++++++++++++++", 3885 "..............+++++++++++++++++++", 3886 "..............+++++++++++++++++++", 3887 ".............++++++++++++++++++++", 3888 "............+++++++++++++++++++++", 3889 "............+++++++++++++++++++++", 3890 "..........+++++++++++++++++++++++", 3891 ".........++++++++++++++++++++++++", 3892 ".......++++++++++++++++++++++++++", 3893 ".....++++++++++++++++++++++++++++", 3894 "+++++++++++++++++++++++++++++++++"}; 3895 3896 3897 3898 3899 QColor fromHsl(QColor c) 3900 { 3901 const qreal h = c.hueF(); 3902 const qreal s = c.saturationF(); 3903 const qreal l = c.valueF(); 3904 3905 qreal ca[3] = {0, 0, 0}; 3906 3907 if (s == 0 || h == 1) { 3908 // achromatic case 3909 ca[0] = ca[1] = ca[2] = l; 3910 } else { 3911 // chromatic case 3912 qreal temp2; 3913 if (l < qreal(0.5)) 3914 temp2 = l * (qreal(1.0) + s); 3915 else 3916 temp2 = l + s - (l * s); 3917 3918 const qreal temp1 = (qreal(2.0) * l) - temp2; 3919 qreal temp3[3] = { h + (qreal(1.0) / qreal(3.0)), 3920 h, 3921 h - (qreal(1.0) / qreal(3.0)) }; 3922 3923 for (int i = 0; i != 3; ++i) { 3924 if (temp3[i] < qreal(0.0)) 3925 temp3[i] += qreal(1.0); 3926 else if (temp3[i] > qreal(1.0)) 3927 temp3[i] -= qreal(1.0); 3928 3929 const qreal sixtemp3 = temp3[i] * qreal(6.0); 3930 3931 if (sixtemp3 < qreal(1.0)) 3932 ca[i] = ((temp1 + (temp2 - temp1) * sixtemp3)); 3933 else if ((temp3[i] * qreal(2.0)) < qreal(1.0)) 3934 ca[i] = (temp2); 3935 else if ((temp3[i] * qreal(3.0)) < qreal(2.0)) 3936 ca[i] = temp1 + (temp2 -temp1) * (qreal(2.0) /qreal(3.0) - temp3[i]) * qreal(6.0); 3937 else ca[i] = temp1; 3938 } 3939 } 3940 3941 return QColor::fromRgbF(ca[0], ca[1], ca[2]); 3942 } 3943 3944 #define Q_MAX_3(a, b, c) ( ( a > b && a > c) ? a : (b > c ? b : c) ) 3945 #define Q_MIN_3(a, b, c) ( ( a < b && a < c) ? a : (b < c ? b : c) ) 3946 3947 QColor toHsl(QColor c) 3948 { 3949 QColor color; 3950 qreal h; 3951 qreal s; 3952 qreal l; 3953 3954 const qreal r = c.redF(); 3955 const qreal g = c.greenF(); 3956 const qreal b = c.blueF(); 3957 const qreal max = Q_MAX_3(r, g, b); 3958 const qreal min = Q_MIN_3(r, g, b); 3959 const qreal delta = max - min; 3960 const qreal delta2 = max + min; 3961 const qreal lightness = qreal(0.5) * delta2; 3962 l = (lightness); 3963 if (qFuzzyIsNull(delta)) { 3964 // achromatic case, hue is undefined 3965 h = 0; 3966 s = 0; 3967 } else { 3968 // chromatic case 3969 qreal hue = 0; 3970 if (lightness < qreal(0.5)) 3971 s = ((delta / delta2)); 3972 else 3973 s = ((delta / (qreal(2.0) - delta2))); 3974 if (qFuzzyCompare(r, max)) { 3975 hue = ((g - b) /delta); 3976 } else if (qFuzzyCompare(g, max)) { 3977 hue = (2.0 + (b - r) / delta); 3978 } else if (qFuzzyCompare(b, max)) { 3979 hue = (4.0 + (r - g) / delta); 3980 } else { 3981 Q_ASSERT_X(false, "QColor::toHsv", "internal error"); 3982 } 3983 hue *= 60.0; 3984 if (hue < 0.0) 3985 hue += 360.0; 3986 h = (hue * 100); 3987 } 3988 3989 h = h / 36000; 3990 3991 return QColor::fromHsvF(h, s, l); 3992 } 3993 3994 void tintColor(QColor &color, QColor tintColor, qreal _saturation) 3995 { 3996 tintColor = toHsl(tintColor); 3997 color = toHsl(color); 3998 qreal hue = tintColor.hueF(); 3999 4000 qreal saturation = color.saturationF(); 4001 if (_saturation) 4002 saturation = _saturation; 4003 qreal lightness = color.valueF(); 4004 color.setHsvF(hue, saturation, lightness); 4005 4006 color = fromHsl(color); 4007 color.toRgb(); 4008 } 4009 4010 void tintImagePal(QImage *image, QColor color, qreal saturation) 4011 { 4012 QVector<QRgb> colorTable = image->colorTable(); 4013 for (int i=2;i< colorTable.size();i++) { 4014 QColor c(toHsl(colorTable.at(i))); 4015 tintColor(c, color, saturation); 4016 colorTable[i] = c.rgb(); 4017 } 4018 image->setColorTable(colorTable); 4019 } 4020 4021 4022 void tintImage(QImage *image, QColor color, qreal saturation) 4023 { 4024 *image = image->convertToFormat(QImage::Format_RGB32); 4025 4026 for (int x = 0; x < image->width(); x++) 4027 for (int y = 0; y < image->height(); y++) { 4028 QColor c(image->pixel(x,y)); 4029 tintColor(c, color, saturation); 4030 image->setPixel(x, y, c.rgb()); 4031 } 4032 } 4033 4034 #endif //Q_WS_WINCE_WM 672 4035 673 4036 674 4037 enum QSliderDirection { SliderUp, SliderDown, SliderLeft, SliderRight }; 4038 4039 #ifdef Q_WS_WINCE_WM 4040 4041 void QWindowsMobileStylePrivate::tintImagesButton(QColor color) 4042 { 4043 if (currentTintButton == color) 4044 return; 4045 4046 imageTabEnd = QImage(tabend_xpm); 4047 imageTabSelectedEnd = QImage(tabselectedend_xpm); 4048 imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); 4049 imageTabMiddle = QImage(tabmiddle_xpm); 4050 tintImage(&imageTabEnd, color, 0.0); 4051 tintImage(&imageTabSelectedEnd, color, 0.0); 4052 tintImage(&imageTabSelectedBegin, color, 0.0); 4053 tintImage(&imageTabMiddle, color, 0.0); 4054 4055 if (!doubleControls) { 4056 int height = imageTabMiddle.height() / 2 + 1; 4057 imageTabEnd = imageTabEnd.scaledToHeight(height); 4058 imageTabMiddle = imageTabMiddle.scaledToHeight(height); 4059 imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); 4060 imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); 4061 } 4062 } 4063 4064 void QWindowsMobileStylePrivate::tintImagesHigh(QColor color) 4065 { 4066 if (currentTintHigh == color) 4067 return; 4068 currentTintHigh = color; 4069 tintListViewHighlight(color); 4070 imageScrollbarHandleUpHigh = imageScrollbarHandleUp; 4071 imageScrollbarHandleDownHigh = imageScrollbarHandleDown; 4072 tintImagePal(&imageScrollbarHandleDownHigh, color, qreal(0.8)); 4073 tintImagePal(&imageScrollbarHandleUpHigh, color, qreal(0.8)); 4074 } 4075 4076 void QWindowsMobileStylePrivate::tintListViewHighlight(QColor color) 4077 { 4078 imageListViewHighlightCornerRight = QImage(listviewhighcornerright_xpm); 4079 tintImage(&imageListViewHighlightCornerRight, color, qreal(0.0)); 4080 4081 imageListViewHighlightCornerLeft = QImage(listviewhighcornerleft_xpm); 4082 tintImage(&imageListViewHighlightCornerLeft, color, qreal(0.0)); 4083 4084 imageListViewHighlightMiddle = QImage(listviewhighmiddle_xpm); 4085 tintImage(&imageListViewHighlightMiddle, color, qreal(0.0)); 4086 4087 int height = imageListViewHighlightMiddle.height(); 4088 if (!doubleControls) { 4089 height = height / 2; 4090 imageListViewHighlightCornerRight = imageListViewHighlightCornerRight.scaledToHeight(height); 4091 imageListViewHighlightCornerLeft = imageListViewHighlightCornerLeft.scaledToHeight(height); 4092 imageListViewHighlightMiddle = imageListViewHighlightMiddle.scaledToHeight(height); 4093 } 4094 } 4095 4096 #endif //Q_WS_WINCE_WM 4097 4098 void QWindowsMobileStylePrivate::setupWindowsMobileStyle65() 4099 { 4100 #ifdef Q_WS_WINCE_WM 4101 wm65 = qt_wince_is_windows_mobile_65(); 4102 if (wm65) { 4103 imageScrollbarHandleUp = QImage(sbhandleup_xpm); 4104 imageScrollbarHandleDown = QImage(sbhandledown_xpm); 4105 imageScrollbarGripUp = QImage(sbgripup_xpm); 4106 imageScrollbarGripDown = QImage(sbgripdown_xpm); 4107 imageScrollbarGripMiddle = QImage(sbgripmiddle_xpm); 4108 4109 if (!doubleControls) { 4110 imageScrollbarHandleUp = imageScrollbarHandleUp.scaledToHeight(imageScrollbarHandleUp.height() / 2); 4111 imageScrollbarHandleDown = imageScrollbarHandleDown.scaledToHeight(imageScrollbarHandleDown.height() / 2); 4112 imageScrollbarGripMiddle = imageScrollbarGripMiddle.scaledToHeight(imageScrollbarGripMiddle.height() / 2); 4113 imageScrollbarGripUp = imageScrollbarGripUp.scaledToHeight(imageScrollbarGripUp.height() / 2); 4114 imageScrollbarGripDown = imageScrollbarGripDown.scaledToHeight(imageScrollbarGripDown.height() / 2); 4115 } else { 4116 } 4117 tintImagesHigh(Qt::blue); 4118 } 4119 #endif //Q_WS_WINCE_WM 4120 } 4121 4122 void QWindowsMobileStylePrivate::drawTabBarTab(QPainter *painter, const QStyleOptionTab *tab) 4123 { 4124 #ifndef QT_NO_TABBAR 4125 #ifdef Q_WS_WINCE_WM 4126 if (wm65) { 4127 tintImagesButton(tab->palette.button().color()); 4128 QRect r; 4129 r.setTopLeft(tab->rect.topRight() - QPoint(imageTabMiddle.width(), 0)); 4130 r.setBottomRight(tab->rect.bottomRight()); 4131 if (tab->state & QStyle::State_Selected) { 4132 painter->fillRect(tab->rect, tab->palette.window()); 4133 } else { 4134 painter->fillRect(tab->rect, QColor(imageTabMiddle.pixel(0,0))); 4135 } 4136 if (tab->selectedPosition == QStyleOptionTab::NextIsSelected) { 4137 painter->drawImage(r, imageTabSelectedBegin); 4138 } else if (tab->position == QStyleOptionTab::End || 4139 tab->position == QStyleOptionTab::OnlyOneTab) { 4140 if (!(tab->state & QStyle::State_Selected)) { 4141 painter->drawImage(r, imageTabEnd); 4142 } 4143 } else if (tab->state & QStyle::State_Selected) { 4144 painter->drawImage(r, imageTabSelectedEnd); 4145 } else { 4146 painter->drawImage(r, imageTabMiddle); 4147 } 4148 if (tab->position == QStyleOptionTab::Beginning && ! (tab->state & QStyle::State_Selected)) { 4149 painter->drawImage(tab->rect.topLeft() - QPoint(imageTabMiddle.width() * 0.60, 0), imageTabSelectedEnd); 4150 } 4151 //imageTabBarBig 4152 return; 4153 } 4154 #endif //Q_WS_WINCE_WM 4155 painter->save(); 4156 painter->setPen(tab->palette.shadow().color()); 4157 if (doubleControls) { 4158 QPen pen = painter->pen(); 4159 pen.setWidth(2); 4160 pen.setCapStyle(Qt::FlatCap); 4161 painter->setPen(pen); 4162 } 4163 if(tab->shape == QTabBar::RoundedNorth) { 4164 if (tab->state & QStyle::State_Selected) { 4165 painter->fillRect(tab->rect, tab->palette.light()); 4166 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 4167 } 4168 else { 4169 painter->fillRect(tab->rect, tab->palette.button()); 4170 painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); 4171 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 4172 } 4173 } 4174 else if(tab->shape == QTabBar::RoundedSouth) { 4175 if (tab->state & QStyle::State_Selected) { 4176 painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); 4177 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 4178 } 4179 else { 4180 painter->fillRect(tab->rect, tab->palette.button()); 4181 if (doubleControls) 4182 painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); 4183 else 4184 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 4185 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 4186 } 4187 } 4188 else if(tab->shape == QTabBar::RoundedEast) { 4189 if (tab->state & QStyle::State_Selected) { 4190 painter->fillRect(tab->rect, tab->palette.light()); 4191 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 4192 } 4193 else { 4194 painter->fillRect(tab->rect, tab->palette.button()); 4195 painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); 4196 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 4197 } 4198 } 4199 else if(tab->shape == QTabBar::RoundedWest) { 4200 if (tab->state & QStyle::State_Selected) { 4201 painter->fillRect(tab->rect, tab->palette.light()); 4202 painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); 4203 } 4204 else { 4205 painter->fillRect(tab->rect, tab->palette.button()); 4206 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 4207 painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); 4208 } 4209 } 4210 painter->restore(); 4211 #endif //QT_NO_TABBAR 4212 } 4213 4214 void QWindowsMobileStylePrivate::drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect) 4215 { 4216 #ifdef Q_WS_WINCE_WM 4217 if (wm65) { 4218 QRect r; 4219 if (rect.isValid()) 4220 r = rect; 4221 else 4222 r = option->rect; 4223 tintImagesHigh(option->palette.highlight().color()); 4224 4225 painter->setPen(QColor(Qt::lightGray)); 4226 4227 if (option->viewItemPosition == QStyleOptionViewItemV4::Middle) { 4228 painter->drawImage(r, imageListViewHighlightMiddle); 4229 } else if (option->viewItemPosition == QStyleOptionViewItemV4::Beginning) { 4230 painter->drawImage(r.adjusted(10, 0, 0, 0), imageListViewHighlightMiddle); 4231 } else if (option->viewItemPosition == QStyleOptionViewItemV4::End) { 4232 painter->drawImage(r.adjusted(0, 0, -10, 0), imageListViewHighlightMiddle); 4233 } else { 4234 painter->drawImage(r.adjusted(10, 0, -10, 0), imageListViewHighlightMiddle); 4235 } 4236 4237 QImage cornerLeft = imageListViewHighlightCornerLeft; 4238 QImage cornerRight = imageListViewHighlightCornerRight; 4239 4240 int width = r.width() > cornerRight.width() ? r.width() : cornerRight.width(); 4241 4242 if ((width * 2) > r.width()) { 4243 width = (r.width() - 5) / 2; 4244 } 4245 4246 cornerLeft = cornerLeft.scaled(width, r.height()); 4247 cornerRight = cornerRight.scaled(width, r.height()); 4248 4249 if ((option->viewItemPosition == QStyleOptionViewItemV4::Beginning) || (option->viewItemPosition == QStyleOptionViewItemV4::OnlyOne) || !option->viewItemPosition) { 4250 painter->drawImage(r.topLeft(), cornerLeft); 4251 } 4252 if ((option->viewItemPosition == QStyleOptionViewItemV4::End) || (option->viewItemPosition == QStyleOptionViewItemV4::OnlyOne) || !option->viewItemPosition) { 4253 painter->drawImage(r.topRight() - QPoint(cornerRight.width(),0), cornerRight); 4254 } 4255 return; 4256 } 4257 #endif //Q_WS_WINCE_WM 4258 QPalette::ColorGroup cg = option->state & QStyle::State_Enabled 4259 ? QPalette::Normal : QPalette::Disabled; 4260 4261 if (rect.isValid()) 4262 painter->fillRect(rect, option->palette.brush(cg, QPalette::Highlight)); 4263 else 4264 painter->fillRect(option->rect, option->palette.brush(cg, QPalette::Highlight)); 4265 } 4266 4267 void QWindowsMobileStylePrivate::drawScrollbarGrip(QPainter *p, QStyleOptionSlider *newScrollbar, const QStyleOptionComplex *option, bool drawCompleteFrame) 4268 { 4269 #ifdef Q_WS_WINCE_WM 4270 if (wm65) { 4271 if (newScrollbar->orientation == Qt::Horizontal) { 4272 QTransform transform; 4273 transform.rotate(-90); 4274 QRect r = newScrollbar->rect; 4275 p->drawImage(r.adjusted(10, 0, -10, 0), imageScrollbarGripMiddle.transformed(transform)); 4276 p->drawImage(r.topLeft(), imageScrollbarGripUp.transformed(transform)); 4277 p->drawImage(r.topRight() - QPoint(imageScrollbarGripDown.height() - 1, 0), imageScrollbarGripDown.transformed(transform)); 4278 } else { 4279 QRect r = newScrollbar->rect; 4280 p->drawImage(r.adjusted(0, 10, 0, -10), imageScrollbarGripMiddle); 4281 p->drawImage(r.topLeft(), imageScrollbarGripUp); 4282 p->drawImage(r.bottomLeft() - QPoint(0, imageScrollbarGripDown.height() - 1), imageScrollbarGripDown); 4283 } 4284 return ; 4285 } 4286 #endif 4287 if (newScrollbar->orientation == Qt::Horizontal) { 4288 p->fillRect(newScrollbar->rect,option->palette.button()); 4289 QRect r = newScrollbar->rect; 4290 p->drawLine(r.topLeft(), r.bottomLeft()); 4291 p->drawLine(r.topRight(), r.bottomRight()); 4292 if (smartphone) { 4293 p->drawLine(r.topLeft(), r.topRight()); 4294 p->drawLine(r.bottomLeft(), r.bottomRight()); 4295 } 4296 } 4297 else { 4298 p->fillRect(newScrollbar->rect,option->palette.button()); 4299 QRect r = newScrollbar->rect; 4300 p->drawLine(r.topLeft(), r.topRight()); 4301 p->drawLine(r.bottomLeft(), r.bottomRight()); 4302 if (smartphone) { 4303 p->drawLine(r.topLeft(), r.bottomLeft()); 4304 p->drawLine(r.topRight(), r.bottomRight()); 4305 } 4306 } 4307 if (newScrollbar->state & QStyle::State_HasFocus) { 4308 QStyleOptionFocusRect fropt; 4309 fropt.QStyleOption::operator=(*newScrollbar); 4310 fropt.rect.setRect(newScrollbar->rect.x() + 2, newScrollbar->rect.y() + 2, 4311 newScrollbar->rect.width() - 5, 4312 newScrollbar->rect.height() - 5); 4313 } 4314 int gripMargin = doubleControls ? 4 : 2; 4315 int doubleLines = doubleControls ? 2 : 1; 4316 //If there is a frame around the scrollbar (abstractScrollArea), 4317 //then the margin is different, because of the missing frame 4318 int gripMarginFrame = doubleControls ? 3 : 1; 4319 if (drawCompleteFrame) 4320 gripMarginFrame = 0; 4321 //draw grips 4322 if (!smartphone) 4323 if (newScrollbar->orientation == Qt::Horizontal) { 4324 for (int i = -3; i < 3; i += 2) { 4325 p->drawLine( 4326 QPoint(newScrollbar->rect.center().x() + i * doubleLines + 1, 4327 newScrollbar->rect.top() + gripMargin +gripMarginFrame), 4328 QPoint(newScrollbar->rect.center().x() + i * doubleLines + 1, 4329 newScrollbar->rect.bottom() - gripMargin)); 4330 } 4331 } else { 4332 for (int i = -2; i < 4 ; i += 2) { 4333 p->drawLine( 4334 QPoint(newScrollbar->rect.left() + gripMargin + gripMarginFrame , 4335 newScrollbar->rect.center().y() + 1 + i * doubleLines - 1), 4336 QPoint(newScrollbar->rect.right() - gripMargin, 4337 newScrollbar->rect.center().y() + 1 + i * doubleLines - 1)); 4338 } 4339 } 4340 if (!smartphone) { 4341 QRect r; 4342 if (doubleControls) 4343 r = option->rect.adjusted(1, 1, -1, 0); 4344 else 4345 r = option->rect.adjusted(0, 0, -1, 0); 4346 if (drawCompleteFrame && doubleControls) 4347 r.adjust(0, 0, 0, -1); 4348 //Check if the scrollbar is part of an abstractItemView and draw the frame according 4349 if (drawCompleteFrame) 4350 p->drawRect(r); 4351 else 4352 if (newScrollbar->orientation == Qt::Horizontal) 4353 p->drawLine(r.topLeft(), r.topRight()); 4354 else 4355 p->drawLine(r.topLeft(), r.bottomLeft()); 4356 } 4357 } 4358 4359 void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOptionSlider *opt, bool completeFrame, bool ) 4360 { 4361 #ifdef Q_WS_WINCE_WM 4362 if (wm65) { 4363 tintImagesHigh(opt->palette.highlight().color()); 4364 QRect r = opt->rect; 4365 if (opt->orientation == Qt::Horizontal) { 4366 QTransform transform; 4367 transform.rotate(-90); 4368 if (opt->state & QStyle::State_Sunken) 4369 p->drawImage(r.topLeft(), imageScrollbarHandleUpHigh.transformed(transform)); 4370 else 4371 p->drawImage(r.topLeft(), imageScrollbarHandleUp.transformed(transform)); 4372 } else { 4373 if (opt->state & QStyle::State_Sunken) 4374 p->drawImage(r.topLeft(), imageScrollbarHandleUpHigh); 4375 else 4376 p->drawImage(r.topLeft(), imageScrollbarHandleUp); 4377 } 4378 return ; 4379 } 4380 #endif //Q_WS_WINCE_WM 4381 4382 QBrush fill = opt->palette.button(); 4383 if (opt->state & QStyle::State_Sunken) 4384 fill = opt->palette.shadow(); 4385 4386 QStyleOption arrowOpt = *opt; 4387 if (doubleControls) 4388 arrowOpt.rect = opt->rect.adjusted(4, 6, -5, -3); 4389 else 4390 arrowOpt.rect = opt->rect.adjusted(5, 6, -4, -3); 4391 4392 bool horizontal = (opt->orientation == Qt::Horizontal); 4393 4394 if (horizontal) { 4395 p->fillRect(opt->rect,fill); 4396 QRect r = opt->rect.adjusted(0,0,1,0); 4397 p->drawLine(r.topRight(), r.bottomRight()); 4398 if (doubleControls) 4399 arrowOpt.rect.adjust(0, -2 ,0, -2); 4400 q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowLeft, &arrowOpt, p, 0); 4401 } else { 4402 p->fillRect(opt->rect,fill); 4403 QRect r = opt->rect.adjusted(0, 0, 0, 1); 4404 p->drawLine(r.bottomLeft(), r.bottomRight()); 4405 if (completeFrame) 4406 arrowOpt.rect.adjust(-2, 0, -2, 0); 4407 if (doubleControls) 4408 arrowOpt.rect.adjust(0, -4 , 0, -4); 4409 if (completeFrame && doubleControls) 4410 arrowOpt.rect.adjust(2, 0, 2, 0); 4411 q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowUp, &arrowOpt, p, 0); 4412 } 4413 } 4414 4415 void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOptionSlider *opt, bool completeFrame, bool secondScrollBar) 4416 { 4417 #ifndef QT_NO_SCROLLBAR 4418 #ifdef Q_WS_WINCE_WM 4419 if (wm65) { 4420 tintImagesHigh(opt->palette.highlight().color()); 4421 QRect r = opt->rect; 4422 if (opt->orientation == Qt::Horizontal) { 4423 QTransform transform; 4424 transform.rotate(-90); 4425 if (opt->state & QStyle::State_Sunken) 4426 p->drawImage(r.topLeft(), imageScrollbarHandleDownHigh.transformed(transform)); 4427 else 4428 p->drawImage(r.topLeft(), imageScrollbarHandleDown.transformed(transform)); 4429 } else { 4430 if (opt->state & QStyle::State_Sunken) 4431 p->drawImage(r.topLeft(), imageScrollbarHandleDownHigh); 4432 else 4433 p->drawImage(r.topLeft(), imageScrollbarHandleDown); 4434 } 4435 return ; 4436 } 4437 #endif //Q_WS_WINCE_WM 4438 4439 QBrush fill = opt->palette.button(); 4440 if (opt->state & QStyle::State_Sunken) 4441 fill = opt->palette.shadow(); 4442 4443 QStyleOption arrowOpt = *opt; 4444 if (doubleControls) 4445 arrowOpt.rect = opt->rect.adjusted(4, 0, -5, 3); 4446 else 4447 arrowOpt.rect = opt->rect.adjusted(5, 6, -4, -3); 4448 4449 bool horizontal = (opt->orientation == Qt::Horizontal); 4450 4451 if (horizontal) { 4452 p->fillRect(opt->rect,fill); 4453 QRect r = opt->rect.adjusted(0, 0, 0, 0); 4454 p->drawLine(r.topLeft(), r.bottomLeft()); 4455 if (secondScrollBar) 4456 p->drawLine(r.topRight(), r.bottomRight()); 4457 if (doubleControls) 4458 arrowOpt.rect.adjust(0, 4, 0, 4 ); 4459 q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowRight, &arrowOpt, p, 0); 4460 } else { 4461 p->fillRect(opt->rect,fill); 4462 QRect r = opt->rect.adjusted(0, -1, 0, -1); 4463 p->drawLine(r.topLeft(), r.topRight()); 4464 if (secondScrollBar) 4465 p->drawLine(r.bottomLeft() + QPoint(0,1), r.bottomRight() + QPoint(0, 1)); 4466 if (completeFrame) 4467 arrowOpt.rect.adjust(-2, 0, -2, 0); 4468 if (doubleControls) 4469 arrowOpt.rect.adjust(1, 0, 1, 0 ); 4470 if (completeFrame && doubleControls) 4471 arrowOpt.rect.adjust(1, 0, 1, 0); 4472 q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, p, 0); 4473 } 4474 #endif //QT_NO_SCROLLBAR 4475 } 4476 4477 void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOptionSlider *opt) 4478 { 4479 #ifndef QT_NO_SCROLLBAR 4480 #ifdef Q_OS_WINCE_WM 4481 if (wm65) { 4482 p->fillRect(opt->rect, QColor(231, 231, 231)); 4483 return ; 4484 } 4485 #endif 4486 QBrush fill; 4487 if (smartphone) { 4488 fill = opt->palette.light(); 4489 p->fillRect(opt->rect, fill); 4490 fill = opt->palette.button(); 4491 QImage image; 4492 #ifndef QT_NO_IMAGEFORMAT_XPM 4493 if (opt->orientation == Qt::Horizontal) 4494 image = QImage(vertlines_xpm); 4495 else 4496 image = QImage(horlines_xpm); 4497 #endif 4498 image.setColor(1, opt->palette.button().color().rgb()); 4499 fill.setTextureImage(image); 4500 } 4501 else { 4502 fill = opt->palette.light(); 4503 } 4504 p->fillRect(opt->rect, fill); 4505 #endif //QT_NO_SCROLLBAR 4506 } 675 4507 676 4508 QWindowsMobileStyle::QWindowsMobileStyle(QWindowsMobileStylePrivate &dd) : QWindowsStyle(dd) { … … 686 4518 QWindowsMobileStylePrivate::QWindowsMobileStylePrivate() :QWindowsStylePrivate() { 687 4519 688 #ifdef Q_ OS_WINCE4520 #ifdef Q_WS_WINCE 689 4521 doubleControls = qt_wince_is_high_dpi(); 690 4522 smartphone = qt_wince_is_smartphone(); … … 692 4524 doubleControls = false; 693 4525 smartphone = false; 694 #endif //Q_ OS_WINCE4526 #endif //Q_WS_WINCE 695 4527 696 4528 #ifndef QT_NO_IMAGEFORMAT_XPM … … 721 4553 imageNormalize = QImage(normal_small_xpm); 722 4554 } 4555 4556 setupWindowsMobileStyle65(); 4557 723 4558 724 4559 imageArrowDownBig = QImage(arrowdown_big_xpm); … … 1157 4992 case PE_IndicatorSpinMinus: { 1158 4993 QRect r = option->rect; 1159 int fw = p ixelMetric(PM_DefaultFrameWidth, option, widget)+2;4994 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget)+2; 1160 4995 QRect br = r.adjusted(fw, fw, -fw, -fw); 1161 4996 int offset = (option->state & State_Sunken) ? 1 : 0; … … 1194 5029 } 1195 5030 if (option->state & State_Sunken) 1196 painter->translate(p ixelMetric(PM_ButtonShiftHorizontal),1197 p ixelMetric(PM_ButtonShiftVertical));5031 painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal), 5032 proxy()->pixelMetric(PM_ButtonShiftVertical)); 1198 5033 if (option->state & State_Enabled) { 1199 5034 painter->translate(option->rect.x() + option->rect.width() / 2, … … 1374 5209 switch (tab->shape) { 1375 5210 case QTabBar::RoundedNorth: 5211 #ifdef Q_WS_WINCE_WM 5212 if (!d->wm65) 5213 #endif 5214 { 1376 5215 if (d->doubleControls) 1377 painter->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1));5216 painter->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1)); 1378 5217 else 1379 5218 painter->drawLine(rect.topLeft(), rect.topRight()); 5219 } 1380 5220 break; 1381 5221 case QTabBar::RoundedSouth: 5222 #ifdef Q_WS_WINCE_WM 5223 if (!d->wm65) 5224 #endif 5225 { 1382 5226 if (d->doubleControls) 1383 5227 painter->drawLine(rect.bottomLeft(), rect.bottomRight()); 1384 5228 else 1385 5229 painter->drawLine(rect.bottomLeft(), rect.bottomRight()); 5230 } 1386 5231 break; 1387 5232 case QTabBar::RoundedEast: 5233 #ifdef Q_WS_WINCE_WM 5234 if (!d->wm65) 5235 #endif 1388 5236 painter->drawLine(rect.topRight(), rect.bottomRight()); 1389 5237 break; 1390 5238 case QTabBar::RoundedWest: 5239 #ifdef Q_WS_WINCE_WM 5240 if (!d->wm65) 5241 #endif 1391 5242 painter->drawLine(rect.topLeft(), rect.bottomLeft()); 1392 5243 break; … … 1407 5258 break; 1408 5259 #endif //QT_NO_TABBAR 5260 #ifndef QT_NO_ITEMVIEWS 5261 case PE_PanelItemViewRow: 5262 if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) { 5263 QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled 5264 ? QPalette::Normal : QPalette::Disabled; 5265 if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) 5266 cg = QPalette::Inactive; 5267 5268 if ((vopt->state & QStyle::State_Selected) && proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, option, widget)) 5269 d->drawPanelItemViewSelected(painter, vopt); 5270 else if (vopt->features & QStyleOptionViewItemV2::Alternate) 5271 painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase)); 5272 else if (!(vopt->state & QStyle::State_Enabled)) 5273 painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Base)); 5274 } 5275 break; 5276 case PE_PanelItemViewItem: 5277 if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) { 5278 QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled 5279 ? QPalette::Normal : QPalette::Disabled; 5280 if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) 5281 cg = QPalette::Inactive; 5282 5283 if (vopt->showDecorationSelected && (vopt->state & QStyle::State_Selected)) { 5284 d->drawPanelItemViewSelected(painter, vopt); 5285 } else { 5286 if (vopt->backgroundBrush.style() != Qt::NoBrush) { 5287 QPointF oldBO = painter->brushOrigin(); 5288 painter->setBrushOrigin(vopt->rect.topLeft()); 5289 painter->fillRect(vopt->rect, vopt->backgroundBrush); 5290 painter->setBrushOrigin(oldBO); 5291 } 5292 5293 if (vopt->state & QStyle::State_Selected) { 5294 QRect textRect = proxy()->subElementRect(QStyle::SE_ItemViewItemText, option, widget); 5295 d->drawPanelItemViewSelected(painter, vopt, textRect); 5296 } 5297 } 5298 } 5299 break; 5300 #endif //QT_NO_ITEMVIEWS 1409 5301 1410 5302 case PE_FrameWindow: { … … 1461 5353 break; } 1462 5354 case PE_Frame: 1463 if (d->doubleControls) 1464 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(),2,&option->palette.light()); 1465 else 1466 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(),1,&option->palette.light()); 5355 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), 5356 d->doubleControls ? 2 : 1, &option->palette.background()); 1467 5357 break; 1468 5358 case PE_FrameLineEdit: … … 1502 5392 if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { 1503 5393 QRect br = button->rect; 1504 int dbi = p ixelMetric(PM_ButtonDefaultIndicator, button, widget);5394 int dbi = proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); 1505 5395 1506 5396 if (button->features & QStyleOptionButton::AutoDefaultButton) … … 1508 5398 QStyleOptionButton tmpBtn = *button; 1509 5399 tmpBtn.rect = br; 1510 drawPrimitive(PE_PanelButtonCommand, &tmpBtn, painter, widget);5400 proxy()->drawPrimitive(PE_PanelButtonCommand, &tmpBtn, painter, widget); 1511 5401 if (button->features & QStyleOptionButton::HasMenu) { 1512 int mbi = p ixelMetric(PM_MenuButtonIndicator, button, widget);5402 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget); 1513 5403 QRect ir = button->rect; 1514 5404 QStyleOptionButton newButton = *button; … … 1517 5407 else 1518 5408 newButton.rect = QRect(ir.right() - mbi, ir.height() - 20, mbi, ir.height() - 4); 1519 drawPrimitive(PE_IndicatorArrowDown, &newButton, painter, widget);5409 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newButton, painter, widget); 1520 5410 } 1521 5411 if (button->features & QStyleOptionButton::DefaultButton) 1522 drawPrimitive(PE_FrameDefaultButton, option, painter, widget);5412 proxy()->drawPrimitive(PE_FrameDefaultButton, option, painter, widget); 1523 5413 } 1524 5414 break; … … 1528 5418 bool isRadio = (element == CE_RadioButton); 1529 5419 QStyleOptionButton subopt = *button; 1530 subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator5420 subopt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonIndicator 1531 5421 : SE_CheckBoxIndicator, button, widget); 1532 drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox,5422 proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, 1533 5423 &subopt, painter, widget); 1534 subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents5424 subopt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonContents 1535 5425 : SE_CheckBoxContents, button, widget); 1536 drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget);5426 proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); 1537 5427 if (button->state & State_HasFocus) { 1538 5428 QStyleOptionFocusRect fropt; 1539 5429 fropt.QStyleOption::operator=(*button); 1540 fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect5430 fropt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonFocusRect 1541 5431 : SE_CheckBoxFocusRect, button, widget); 1542 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);5432 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 1543 5433 } 1544 5434 } … … 1554 5444 if (!button->icon.isNull()) { 1555 5445 pix = button->icon.pixmap(button->iconSize, button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled); 1556 drawItemPixmap(painter, button->rect, alignment, pix);5446 proxy()->drawItemPixmap(painter, button->rect, alignment, pix); 1557 5447 if (button->direction == Qt::RightToLeft) 1558 5448 textRect.setRight(textRect.right() - button->iconSize.width() - 4); … … 1562 5452 if (!button->text.isEmpty()){ 1563 5453 if (button->state & State_Enabled) 1564 drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic,5454 proxy()->drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, 1565 5455 button->palette, false, button->text, QPalette::WindowText); 1566 5456 else 1567 drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic,5457 proxy()->drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, 1568 5458 button->palette, false, button->text, QPalette::Mid); 1569 5459 } … … 1581 5471 case CE_TabBarTab: 1582 5472 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { 1583 drawControl(CE_TabBarTabShape, tab, painter, widget);1584 drawControl(CE_TabBarTabLabel, tab, painter, widget);5473 proxy()->drawControl(CE_TabBarTabShape, tab, painter, widget); 5474 proxy()->drawControl(CE_TabBarTabLabel, tab, painter, widget); 1585 5475 } 1586 5476 break; 1587 5477 case CE_TabBarTabShape: 1588 5478 if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { 5479 1589 5480 if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast || 1590 5481 tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) { 1591 1592 painter->save(); 1593 painter->setPen(tab->palette.shadow().color()); 1594 if (d->doubleControls) { 1595 QPen pen = painter->pen(); 1596 pen.setWidth(2); 1597 pen.setCapStyle(Qt::FlatCap); 1598 painter->setPen(pen); 1599 } 1600 if(tab->shape == QTabBar::RoundedNorth) { 1601 if (tab->state & State_Selected) { 1602 painter->fillRect(tab->rect, tab->palette.light()); 1603 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 1604 } 1605 else { 1606 painter->fillRect(tab->rect, tab->palette.button()); 1607 painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); 1608 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 1609 } 1610 } 1611 else if(tab->shape == QTabBar::RoundedSouth) { 1612 1613 if (tab->state & State_Selected) { 1614 painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); 1615 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 1616 } 1617 else { 1618 painter->fillRect(tab->rect, tab->palette.button()); 1619 if (d->doubleControls) 1620 painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); 1621 else 1622 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 1623 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 1624 } 1625 } 1626 else if(tab->shape == QTabBar::RoundedEast) { 1627 if (tab->state & State_Selected) { 1628 painter->fillRect(tab->rect, tab->palette.light()); 1629 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 1630 } 1631 else { 1632 painter->fillRect(tab->rect, tab->palette.button()); 1633 painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); 1634 painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); 1635 } 1636 } 1637 else if(tab->shape == QTabBar::RoundedWest) { 1638 if (tab->state & State_Selected) { 1639 painter->fillRect(tab->rect, tab->palette.light()); 1640 painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); 1641 } 1642 else { 1643 painter->fillRect(tab->rect, tab->palette.button()); 1644 painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); 1645 painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); 1646 } 1647 } 1648 1649 painter->restore(); 5482 d->drawTabBarTab(painter, tab); 1650 5483 } else { 1651 5484 QCommonStyle::drawControl(element, option, painter, widget); … … 1678 5511 QRegion clipRegion = painter->clipRegion(); 1679 5512 painter->setClipRect(option->rect); 1680 drawControl(CE_HeaderSection, header, painter, widget);5513 proxy()->drawControl(CE_HeaderSection, header, painter, widget); 1681 5514 QStyleOptionHeader subopt = *header; 1682 subopt.rect = subElementRect(SE_HeaderLabel, header, widget);5515 subopt.rect = proxy()->subElementRect(SE_HeaderLabel, header, widget); 1683 5516 if (header->state & State_Sunken) 1684 5517 subopt.palette.setColor(QPalette::ButtonText, header->palette.brightText().color()); 1685 5518 subopt.state |= QStyle::State_On; 1686 5519 if (subopt.rect.isValid()) 1687 drawControl(CE_HeaderLabel, &subopt, painter, widget);5520 proxy()->drawControl(CE_HeaderLabel, &subopt, painter, widget); 1688 5521 if (header->sortIndicator != QStyleOptionHeader::None) { 1689 subopt.rect = subElementRect(SE_HeaderArrow, option, widget);1690 drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget);5522 subopt.rect = proxy()->subElementRect(SE_HeaderArrow, option, widget); 5523 proxy()->drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget); 1691 5524 } 1692 5525 painter->setClipRegion(clipRegion); … … 1763 5596 } 1764 5597 #endif // QT_NO_SCROLLAREA 1765 break; } 1766 5598 break; 5599 } 5600 #ifndef QT_NO_COMBOBOX 5601 case CE_ComboBoxLabel: 5602 // This is copied from qcommonstyle.cpp with the difference, that 5603 // the editRect isn't adjusted when calling drawItemText. 5604 if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { 5605 QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); 5606 painter->save(); 5607 painter->setClipRect(editRect); 5608 if (!cb->currentIcon.isNull()) { 5609 QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal 5610 : QIcon::Disabled; 5611 QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); 5612 QRect iconRect(editRect); 5613 iconRect.setWidth(cb->iconSize.width() + 4); 5614 iconRect = alignedRect(cb->direction, 5615 Qt::AlignLeft | Qt::AlignVCenter, 5616 iconRect.size(), editRect); 5617 if (cb->editable) 5618 painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); 5619 proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); 5620 5621 if (cb->direction == Qt::RightToLeft) 5622 editRect.translate(-4 - cb->iconSize.width(), 0); 5623 else 5624 editRect.translate(cb->iconSize.width() + 4, 0); 5625 } 5626 if (!cb->currentText.isEmpty() && !cb->editable) { 5627 proxy()->drawItemText(painter, editRect, 5628 visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), 5629 cb->palette, cb->state & State_Enabled, cb->currentText); 5630 } 5631 painter->restore(); 5632 } 5633 break; 5634 #endif // QT_NO_COMBOBOX 1767 5635 #ifndef QT_NO_DOCKWIDGET 1768 5636 case CE_DockWidgetTitle: … … 1833 5701 QPalette palette = dwOpt->palette; 1834 5702 palette.setColor(QPalette::Window, inactiveCaptionTextColor); 1835 QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget);5703 QRect titleRect = proxy()->subElementRect(SE_DockWidgetTitleBarText, option, widget); 1836 5704 if (verticalTitleBar) { 1837 5705 titleRect = QRect(r.left() + rect.bottom() … … 1840 5708 titleRect.height(), titleRect.width()); 1841 5709 } 1842 drawItemText(painter, titleRect,5710 proxy()->drawItemText(painter, titleRect, 1843 5711 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, palette, 1844 5712 dwOpt->state & State_Enabled, dwOpt->title, … … 1890 5758 1891 5759 if ((button->state & (State_On | State_Sunken)) && button->direction == Qt::RightToLeft) 1892 point.rx() -= p ixelMetric(PM_ButtonShiftHorizontal, option, widget) * 2;5760 point.rx() -= proxy()->pixelMetric(PM_ButtonShiftHorizontal, option, widget) * 2; 1893 5761 1894 5762 painter->drawPixmap(visualPos(button->direction, button->rect, point), pixmap); … … 1906 5774 } 1907 5775 if (button->state & State_Enabled) 1908 drawItemText(painter, ir, tf, button->palette, true, button->text, colorRole);5776 proxy()->drawItemText(painter, ir, tf, button->palette, true, button->text, colorRole); 1909 5777 else 1910 drawItemText(painter, ir, tf, button->palette, true, button->text, QPalette::Mid);5778 proxy()->drawItemText(painter, ir, tf, button->palette, true, button->text, QPalette::Mid); 1911 5779 painter->restore(); 1912 5780 } … … 1928 5796 case CC_Slider: 1929 5797 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 1930 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);1931 int len = p ixelMetric(PM_SliderLength, slider, widget);5798 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 5799 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 1932 5800 int ticks = slider->tickPosition; 1933 QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, widget);1934 QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, widget);5801 QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget); 5802 QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget); 1935 5803 1936 5804 if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { … … 1983 5851 QStyleOptionFocusRect fropt; 1984 5852 fropt.QStyleOption::operator=(*slider); 1985 fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget);1986 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);5853 fropt.rect = proxy()->subElementRect(SE_SliderFocusRect, slider, widget); 5854 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 1987 5855 } 1988 5856 if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) { … … 2119 5987 } 2120 5988 if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 5989 d->drawScrollbarGroove(painter, scrollbar); 2121 5990 // Make a copy here and reset it for each primitive. 2122 QBrush fill;2123 if (d->smartphone) {2124 fill = option->palette.light();2125 painter->fillRect(option->rect,fill);2126 fill = option->palette.button();2127 QImage image;2128 #ifndef QT_NO_IMAGEFORMAT_XPM2129 if (scrollbar->orientation == Qt::Horizontal)2130 image = QImage(vertlines_xpm);2131 else2132 image = QImage(horlines_xpm);2133 #endif2134 image.setColor(1, option->palette.button().color().rgb());2135 fill.setTextureImage(image);2136 }2137 else {2138 fill = option->palette.light();2139 }2140 painter->fillRect(option->rect,fill);2141 5991 QStyleOptionSlider newScrollbar = *scrollbar; 2142 5992 State saveFlags = scrollbar->state; … … 2160 6010 if (scrollbar->subControls & SC_ScrollBarSubLine) { 2161 6011 newScrollbar.state = saveFlags; 2162 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSubLine, widget);6012 newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarSubLine, widget); 2163 6013 if (newScrollbar.rect.isValid()) { 2164 6014 if (!(scrollbar->activeSubControls & SC_ScrollBarSubLine)) 2165 6015 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2166 QStyleOption arrowOpt = newScrollbar; 2167 if (d->doubleControls) 2168 arrowOpt.rect = newScrollbar.rect.adjusted(4, 6, -5, -3); 2169 else 2170 arrowOpt.rect = newScrollbar.rect.adjusted(5, 6, -4, -3); 2171 QBrush fill = option->palette.button(); 2172 if (newScrollbar.state & State_Sunken) 2173 fill = option->palette.shadow(); 2174 if (scrollbar->orientation == Qt::Horizontal) { 2175 painter->fillRect(newScrollbar.rect,fill); 2176 QRect r = newScrollbar.rect.adjusted(0,0,1,0); 2177 painter->drawLine(r.topRight(), r.bottomRight()); 2178 if (d->doubleControls) 2179 arrowOpt.rect.adjust(0, -2 ,0, -2); 2180 drawPrimitive(PE_IndicatorArrowLeft, &arrowOpt, painter, widget); 2181 } 2182 else { 2183 painter->fillRect(newScrollbar.rect,fill); 2184 QRect r = newScrollbar.rect.adjusted(0, 0, 0, 1); 2185 painter->drawLine(r.bottomLeft(), r.bottomRight()); 2186 if (drawCompleteFrame) 2187 arrowOpt.rect.adjust(-2, 0, -2, 0); 2188 if (d->doubleControls) 2189 arrowOpt.rect.adjust(0, -4 , 0, -4); 2190 if (drawCompleteFrame && d->doubleControls) 2191 arrowOpt.rect.adjust(2, 0, 2, 0); 2192 drawPrimitive(PE_IndicatorArrowUp, &arrowOpt, painter, widget); 2193 } 6016 d->drawScrollbarHandleUp(painter, &newScrollbar, drawCompleteFrame, secondScrollBar); 2194 6017 } 2195 6018 } … … 2197 6020 newScrollbar.rect = scrollbar->rect; 2198 6021 newScrollbar.state = saveFlags; 2199 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarAddLine, widget);6022 newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarAddLine, widget); 2200 6023 if (newScrollbar.rect.isValid()) { 2201 6024 if (!(scrollbar->activeSubControls & SC_ScrollBarAddLine)) 2202 6025 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2203 QStyleOption arrowOpt = newScrollbar; 2204 if (d->doubleControls) 2205 arrowOpt.rect = newScrollbar.rect.adjusted(4, 0, -5, 3); 2206 else 2207 arrowOpt.rect = newScrollbar.rect.adjusted(5, 6, -4, -3); 2208 QBrush fill = option->palette.button(); 2209 if (newScrollbar.state & State_Sunken) 2210 fill = option->palette.shadow(); 2211 if (scrollbar->orientation == Qt::Horizontal) { 2212 painter->fillRect(newScrollbar.rect,fill); 2213 QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); 2214 painter->drawLine(r.topLeft(), r.bottomLeft()); 2215 if (secondScrollBar) 2216 painter->drawLine(r.topRight(), r.bottomRight()); 2217 if (d->doubleControls) 2218 arrowOpt.rect.adjust(0, 4, 0, 4 ); 2219 drawPrimitive(PE_IndicatorArrowRight, &arrowOpt, painter, widget); 2220 } 2221 else { 2222 painter->fillRect(newScrollbar.rect,fill); 2223 QRect r = newScrollbar.rect.adjusted(0, -1, 0, -1); 2224 painter->drawLine(r.topLeft(), r.topRight()); 2225 if (secondScrollBar) 2226 painter->drawLine(r.bottomLeft() + QPoint(0,1), r.bottomRight() + QPoint(0, 1)); 2227 if (drawCompleteFrame) 2228 arrowOpt.rect.adjust(-2, 0, -2, 0); 2229 if (d->doubleControls) 2230 arrowOpt.rect.adjust(1, 0, 1, 0 ); 2231 if (drawCompleteFrame && d->doubleControls) 2232 arrowOpt.rect.adjust(1, 0, 1, 0); 2233 drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); 2234 } 2235 } 2236 } 2237 if (scrollbar->subControls & SC_ScrollBarSubPage) { 2238 newScrollbar.rect = scrollbar->rect; 2239 newScrollbar.state = saveFlags; 2240 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSubPage, widget); 2241 if (newScrollbar.rect.isValid()) { 2242 if (!(scrollbar->activeSubControls & SC_ScrollBarSubPage)) 2243 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2244 if (scrollbar->orientation == Qt::Horizontal) { 2245 QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); 2246 } 2247 else{ 2248 QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); 2249 } 2250 } 2251 } 2252 if (scrollbar->subControls & SC_ScrollBarAddPage) { 2253 newScrollbar.rect = scrollbar->rect; 2254 newScrollbar.state = saveFlags; 2255 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarAddPage, widget); 2256 if (newScrollbar.rect.isValid()) { 2257 if (!(scrollbar->activeSubControls & SC_ScrollBarAddPage)) 2258 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2259 if (scrollbar->orientation == Qt::Horizontal) { 2260 QRect r = newScrollbar.rect.adjusted(0, 0, 0, -1); 2261 } 2262 else { 2263 QRect r = newScrollbar.rect.adjusted(0, 0,- 1, 0); 2264 } 2265 } 2266 } 2267 if (scrollbar->subControls & SC_ScrollBarFirst) { 2268 newScrollbar.rect = scrollbar->rect; 2269 newScrollbar.state = saveFlags; 2270 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarFirst, widget); 2271 if (newScrollbar.rect.isValid()) { 2272 if (!(scrollbar->activeSubControls & SC_ScrollBarFirst)) 2273 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2274 QRect r = newScrollbar.rect; 2275 } 2276 } 2277 if (scrollbar->subControls & SC_ScrollBarLast) { 2278 newScrollbar.rect = scrollbar->rect; 2279 newScrollbar.state = saveFlags; 2280 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarLast, widget); 2281 if (newScrollbar.rect.isValid()) { 2282 if (!(scrollbar->activeSubControls & SC_ScrollBarLast)) 2283 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2284 QRect r = newScrollbar.rect; 6026 d->drawScrollbarHandleDown(painter, &newScrollbar, drawCompleteFrame, secondScrollBar); 2285 6027 } 2286 6028 } 2287 6029 if (scrollbar->subControls & SC_ScrollBarSlider) { 2288 newScrollbar.rect = scrollbar->rect; 2289 newScrollbar.state = saveFlags; 2290 newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); 2291 if (newScrollbar.rect.isValid()) { 2292 if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) 2293 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 2294 if (scrollbar->orientation == Qt::Horizontal) { 2295 painter->fillRect(newScrollbar.rect,option->palette.button()); 2296 QRect r = newScrollbar.rect; 2297 painter->drawLine(r.topLeft(), r.bottomLeft()); 2298 painter->drawLine(r.topRight(), r.bottomRight()); 2299 if (d->smartphone) { 2300 painter->drawLine(r.topLeft(), r.topRight()); 2301 painter->drawLine(r.bottomLeft(), r.bottomRight()); 2302 } 2303 } 2304 else { 2305 painter->fillRect(newScrollbar.rect,option->palette.button()); 2306 QRect r = newScrollbar.rect; 2307 painter->drawLine(r.topLeft(), r.topRight()); 2308 painter->drawLine(r.bottomLeft(), r.bottomRight()); 2309 if (d->smartphone) { 2310 painter->drawLine(r.topLeft(), r.bottomLeft()); 2311 painter->drawLine(r.topRight(), r.bottomRight()); 2312 } 2313 } 2314 if (scrollbar->state & State_HasFocus) { 2315 QStyleOptionFocusRect fropt; 2316 fropt.QStyleOption::operator=(newScrollbar); 2317 fropt.rect.setRect(newScrollbar.rect.x() + 2, newScrollbar.rect.y() + 2, 2318 newScrollbar.rect.width() - 5, 2319 newScrollbar.rect.height() - 5); 2320 } 2321 } 6030 6031 newScrollbar.rect = scrollbar->rect; 6032 newScrollbar.state = saveFlags; 6033 newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); 6034 6035 if (newScrollbar.rect.isValid()) { 6036 if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) 6037 newScrollbar.state &= ~(State_Sunken | State_MouseOver); 6038 d->drawScrollbarGrip(painter, &newScrollbar, option, drawCompleteFrame); 6039 } 2322 6040 } 2323 int gripMargin = d->doubleControls ? 4 : 2;2324 int doubleLines = d->doubleControls ? 2 : 1;2325 //If there is a frame around the scrollbar (abstractScrollArea),2326 //then the margin is different, because of the missing frame2327 int gripMarginFrame = d->doubleControls ? 3 : 1;2328 if (drawCompleteFrame)2329 gripMarginFrame = 0;2330 //draw grips2331 if (!d->smartphone)2332 if (scrollbar->orientation == Qt::Horizontal) {2333 for (int i = -3; i < 3; i += 2) {2334 painter->drawLine(2335 QPoint(newScrollbar.rect.center().x() + i * doubleLines + 1,2336 newScrollbar.rect.top() + gripMargin +gripMarginFrame),2337 QPoint(newScrollbar.rect.center().x() + i * doubleLines + 1,2338 newScrollbar.rect.bottom() - gripMargin));2339 }2340 } else {2341 for (int i = -2; i < 4 ; i += 2) {2342 painter->drawLine(2343 QPoint(newScrollbar.rect.left() + gripMargin + gripMarginFrame ,2344 newScrollbar.rect.center().y() + 1 + i * doubleLines - 1),2345 QPoint(newScrollbar.rect.right() - gripMargin,2346 newScrollbar.rect.center().y() + 1 + i * doubleLines - 1));2347 }2348 }2349 if (!d->smartphone) {2350 QRect r;2351 if (d->doubleControls)2352 r = option->rect.adjusted(1, 1, -1, 0);2353 else2354 r = option->rect.adjusted(0, 0, -1, 0);2355 if (drawCompleteFrame && d->doubleControls)2356 r.adjust(0, 0, 0, -1);2357 //Check if the scrollbar is part of an abstractItemView and draw the frame according2358 if (drawCompleteFrame)2359 painter->drawRect(r);2360 else2361 if (scrollbar->orientation == Qt::Horizontal)2362 painter->drawLine(r.topLeft(), r.topRight());2363 else2364 painter->drawLine(r.topLeft(), r.bottomLeft());2365 }2366 6041 } 2367 6042 painter->restore(); 2368 6043 break; 2369 #endif // QT_NO_S LIDER6044 #endif // QT_NO_SCROLLBAR 2370 6045 case CC_ToolButton: 2371 6046 if (const QStyleOptionToolButton *toolbutton … … 2379 6054 #endif //QT_NO_TABWIDGET 2380 6055 2381 button = subControlRect(control, toolbutton, SC_ToolButton, widget);2382 menuarea = subControlRect(control, toolbutton, SC_ToolButtonMenu, widget);6056 button = proxy()->subControlRect(control, toolbutton, SC_ToolButton, widget); 6057 menuarea = proxy()->subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); 2383 6058 State buttonFlags = toolbutton->state; 2384 6059 if (buttonFlags & State_AutoRaise) { … … 2397 6072 tool.rect = button; 2398 6073 tool.state = buttonFlags; 2399 drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);6074 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); 2400 6075 } 2401 6076 if (toolbutton->subControls & SC_ToolButtonMenu) { … … 2406 6081 toolMenu.state = menuFlags; 2407 6082 if (buttonFlags & State_Sunken) 2408 drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget);6083 proxy()->drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget); 2409 6084 QStyleOption arrowOpt(0); 2410 6085 arrowOpt.rect = tool.rect; … … 2418 6093 } 2419 6094 arrowOpt.state = flags; 2420 drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget);6095 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); 2421 6096 } 2422 6097 if (toolbutton->state & State_HasFocus) { … … 2425 6100 focusRect.rect.adjust(3, 3, -3, -3); 2426 6101 if (toolbutton->features & QStyleOptionToolButton::Menu) 2427 focusRect.rect.adjust(0, 0, -p ixelMetric(QStyle::PM_MenuButtonIndicator,6102 focusRect.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, 2428 6103 toolbutton, widget), 0); 2429 drawPrimitive(PE_FrameFocusRect, &focusRect, painter, widget);6104 proxy()->drawPrimitive(PE_FrameFocusRect, &focusRect, painter, widget); 2430 6105 } 2431 6106 QStyleOptionToolButton label = *toolbutton; … … 2434 6109 else 2435 6110 label.state = toolbutton->state & State_Enabled; 2436 int fw = p ixelMetric(PM_DefaultFrameWidth, option, widget);6111 int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); 2437 6112 label.rect = button.adjusted(fw, fw, -fw, -fw); 2438 drawControl(CE_ToolButtonLabel, &label, painter, widget);6113 proxy()->drawControl(CE_ToolButtonLabel, &label, painter, widget); 2439 6114 } 2440 6115 break; … … 2450 6125 QStyleOptionGroupBox groupBoxFont = *groupBox; 2451 6126 groupBoxFont.fontMetrics = QFontMetrics(font); 2452 QRect textRect = subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget);2453 QRect checkBoxRect = subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget).adjusted(0,0,0,0);6127 QRect textRect = proxy()->subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget); 6128 QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget).adjusted(0,0,0,0); 2454 6129 if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { 2455 6130 QStyleOptionFrameV2 frame; … … 2458 6133 frame.lineWidth = groupBox->lineWidth; 2459 6134 frame.midLineWidth = groupBox->midLineWidth; 2460 frame.rect = subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget);6135 frame.rect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); 2461 6136 painter->save(); 2462 6137 QRegion region(groupBox->rect); … … 2468 6143 region -= finalRect; 2469 6144 } 2470 drawPrimitive(PE_FrameGroupBox, &frame, painter, widget);6145 proxy()->drawPrimitive(PE_FrameGroupBox, &frame, painter, widget); 2471 6146 painter->restore(); 2472 6147 } … … 2476 6151 box.QStyleOption::operator=(*groupBox); 2477 6152 box.rect = checkBoxRect; 2478 drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget);6153 proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); 2479 6154 } 2480 6155 // Draw title … … 2492 6167 2493 6168 if (groupBox->state & State_Enabled) 2494 drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment,6169 proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, 2495 6170 groupBox->palette, true, groupBox->text, 2496 6171 textColor.isValid() ? QPalette::NoRole : QPalette::Link); 2497 6172 else 2498 drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment,6173 proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, 2499 6174 groupBox->palette, true, groupBox->text, QPalette::Mid); 2500 6175 if (groupBox->state & State_HasFocus) { … … 2502 6177 fropt.QStyleOption::operator=(*groupBox); 2503 6178 fropt.rect = textRect; 2504 drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);6179 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); 2505 6180 } 2506 6181 } … … 2515 6190 QBrush editBrush = cmb->palette.brush(QPalette::Base); 2516 6191 if ((cmb->subControls & SC_ComboBoxFrame) && cmb->frame) 2517 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), p ixelMetric(PM_ComboBoxFrameWidth, option, widget), &editBrush);6192 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_ComboBoxFrameWidth, option, widget), &editBrush); 2518 6193 else 2519 6194 painter->fillRect(option->rect, editBrush); 2520 2521 QRect ar =subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget);2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 6195 State flags = State_None; 6196 QRect ar = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); 6197 if ((option->state & State_On)) { 6198 painter->fillRect(ar.adjusted(0, 0, 1, 1),cmb->palette.brush(QPalette::Shadow)); 6199 } 6200 if (d->doubleControls) 6201 ar.adjust(5, 0, 5, 0); 6202 else 6203 ar.adjust(2, 0, -2, 0); 6204 if (option->state & State_Enabled) 6205 flags |= State_Enabled; 6206 if (option->state & State_On) 6207 flags |= State_Sunken; 6208 QStyleOption arrowOpt(0); 6209 arrowOpt.rect = ar; 6210 arrowOpt.palette = cmb->palette; 6211 arrowOpt.state = flags; 6212 proxy()->drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget); 2538 6213 if (cmb->subControls & SC_ComboBoxEditField) { 2539 QRect re = subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget);6214 QRect re = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); 2540 6215 if (cmb->state & State_HasFocus && !cmb->editable) 2541 6216 painter->fillRect(re.x(), re.y(), re.width(), re.height(), … … 2551 6226 QStyleOptionFocusRect focus; 2552 6227 focus.QStyleOption::operator=(*cmb); 2553 focus.rect = subElementRect(SE_ComboBoxFocusRect, cmb, widget);6228 focus.rect = proxy()->subElementRect(SE_ComboBoxFocusRect, cmb, widget); 2554 6229 focus.state |= State_FocusAtBorder; 2555 6230 focus.backgroundColor = cmb->palette.highlight().color(); 2556 6231 if ((option->state & State_On)) 2557 drawPrimitive(PE_FrameFocusRect, &focus, painter, widget);6232 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, painter, widget); 2558 6233 } 2559 6234 } … … 2571 6246 2572 6247 if (spinBox->frame && (spinBox->subControls & SC_SpinBoxFrame)) { 2573 QRect r = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxFrame, widget);2574 qDrawPlainRect(painter, r, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget),0);6248 QRect r = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxFrame, widget); 6249 qDrawPlainRect(painter, r, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget),0); 2575 6250 } 2576 6251 QPalette shadePal(option->palette); … … 2594 6269 primitiveElement = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorArrowUpBig 2595 6270 : PE_IndicatorArrowUpBig); 2596 copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget);6271 copy.rect = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget); 2597 6272 if (copy.state & (State_Sunken | State_On)) 2598 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow));6273 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); 2599 6274 else 2600 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base));2601 copy.rect.adjust(p ixelMetric(PM_SpinBoxFrameWidth, option, widget), 0, -pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0);2602 drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget);6275 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); 6276 copy.rect.adjust(proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0, -pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0); 6277 proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); 2603 6278 } 2604 6279 if (spinBox->subControls & SC_SpinBoxDown) { … … 2620 6295 primitiveElement = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorArrowDownBig 2621 6296 : PE_IndicatorArrowDownBig); 2622 copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget);2623 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base));6297 copy.rect = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget); 6298 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); 2624 6299 if (copy.state & (State_Sunken | State_On)) 2625 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow));6300 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); 2626 6301 else 2627 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base));6302 qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); 2628 6303 copy.rect.adjust(3, 0, -4, 0); 2629 6304 if (primitiveElement == PE_IndicatorArrowUp || primitiveElement == PE_IndicatorArrowDown) { 2630 int frameWidth = p ixelMetric(PM_SpinBoxFrameWidth, option, widget);6305 int frameWidth = proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget); 2631 6306 copy.rect = copy.rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth); 2632 drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget);6307 proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); 2633 6308 } 2634 6309 else { 2635 drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget);6310 proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); 2636 6311 } 2637 6312 if (spinBox->frame && (spinBox->subControls & SC_SpinBoxFrame)) { 2638 QRect r = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget);6313 QRect r = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget); 2639 6314 } 2640 6315 } … … 2656 6331 case CT_PushButton: 2657 6332 if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { 2658 newSize = Q WindowsStyle::sizeFromContents(type, option, size, widget);6333 newSize = QCommonStyle::sizeFromContents(type, option, size, widget); 2659 6334 int w = newSize.width(), 2660 6335 h = newSize.height(); 2661 6336 int defwidth = 0; 2662 6337 if (button->features & QStyleOptionButton::AutoDefaultButton) 2663 defwidth = 2 * pixelMetric(PM_ButtonDefaultIndicator, button, widget); 2664 if (w < 75 + defwidth && button->icon.isNull()) 2665 w = 75 + defwidth; 2666 if (h < 23 + defwidth) 2667 h = 23 + defwidth; 6338 defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); 6339 6340 int minwidth = int(QStyleHelper::dpiScaled(55.0f)); 6341 int minheight = int(QStyleHelper::dpiScaled(19.0f)); 6342 6343 if (w < minwidth + defwidth && button->icon.isNull()) 6344 w = minwidth + defwidth; 6345 if (h < minheight + defwidth) 6346 h = minheight + defwidth; 2668 6347 newSize = QSize(w + 4, h + 4); 2669 6348 } … … 2684 6363 bool isRadio = (type == CT_RadioButton); 2685 6364 QRect irect = visualRect(button->direction, button->rect, 2686 subElementRect(isRadio ? SE_RadioButtonIndicator6365 proxy()->subElementRect(isRadio ? SE_RadioButtonIndicator 2687 6366 : SE_CheckBoxIndicator, button, widget)); 2688 int h = p ixelMetric(isRadio ? PM_ExclusiveIndicatorHeight6367 int h = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight 2689 6368 : PM_IndicatorHeight, button, widget); 2690 6369 int margins = (!button->icon.isNull() && button->text.isEmpty()) ? 0 : 10; … … 2698 6377 case CT_ComboBox: 2699 6378 if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { 2700 int fw = comboBox->frame ? p ixelMetric(PM_ComboBoxFrameWidth, option, widget) * 2 : 0;2701 newSize = QSize(newSize.width() + fw + 9, newSize.height() + fw -4); //Nine is a magic Number - See CommonStyle for real magic (23)6379 int fw = comboBox->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, option, widget) * 2 : 0; 6380 newSize = QSize(newSize.width() + fw + 9, newSize.height() + fw); //Nine is a magic Number - See CommonStyle for real magic (23) 2702 6381 } 2703 6382 break; … … 2706 6385 case CT_SpinBox: 2707 6386 if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { 2708 int fw = spinBox->frame ? p ixelMetric(PM_SpinBoxFrameWidth, option, widget) * 2 : 0;6387 int fw = spinBox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget) * 2 : 0; 2709 6388 newSize = QSize(newSize.width() + fw-5, newSize.height() + fw-6); 2710 6389 } … … 2720 6399 break; 2721 6400 case CT_TabBarTab: 2722 newSize += QSize(0,0); 6401 if (d_func()->doubleControls) 6402 newSize = QSize(newSize.width(), 42); 6403 else 6404 newSize = QSize(newSize.width(), 21); 2723 6405 break; 2724 6406 case CT_HeaderSection: 2725 6407 newSize += QSize(4, 2); 2726 6408 break; 6409 #ifndef QT_NO_ITEMVIEWS 6410 #ifdef Q_WS_WINCE_WM 6411 case CT_ItemViewItem: 6412 if (d_func()->wm65) 6413 if (d_func()->doubleControls) 6414 newSize.setHeight(46); 6415 else 6416 newSize.setHeight(23); 6417 break; 6418 #endif //Q_WS_WINCE_WM 6419 #endif //QT_NO_ITEMVIEWS 2727 6420 default: 2728 6421 break; … … 2752 6445 default: 2753 6446 break; 2754 6447 #ifndef QT_NO_SLIDER 2755 6448 case SE_SliderFocusRect: 2756 6449 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { … … 2763 6456 break; 2764 6457 #endif // QT_NO_SLIDER 6458 #ifndef QT_NO_ITEMVIEWS 6459 case SE_ItemViewItemFocusRect: 6460 #ifdef Q_WS_WINCE_WM 6461 if (d->wm65) 6462 rect = QRect(); 6463 #endif 6464 break; 6465 #endif //QT_NO_ITEMVIEWS 2765 6466 } 2766 6467 return rect; … … 2778 6479 case CC_ScrollBar: 2779 6480 if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 2780 int sliderButtonExtent = pixelMetric(PM_ScrollBarExtent, scrollbar, widget); 2781 int sliderlen; 6481 int sliderButtonExtent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollbar, widget); 2782 6482 float stretchFactor = 1.4f; 2783 6483 int sliderButtonExtentDir = int (sliderButtonExtent * stretchFactor); 6484 6485 #ifdef Q_WS_WINCE_WM 6486 if (d->wm65) 6487 { 6488 sliderButtonExtent = d->imageScrollbarHandleUp.width(); 6489 sliderButtonExtentDir = d->imageScrollbarHandleUp.height(); 6490 } 6491 #endif //Q_WS_WINCE_WM 6492 6493 int sliderlen; 2784 6494 int maxlen = ((scrollbar->orientation == Qt::Horizontal) ? 2785 6495 scrollbar->rect.width() : scrollbar->rect.height()) - (sliderButtonExtentDir * 2); … … 2789 6499 sliderlen = (qint64(scrollbar->pageStep) * maxlen) / (range + scrollbar->pageStep); 2790 6500 2791 int slidermin = p ixelMetric(PM_ScrollBarSliderMin, scrollbar, widget);6501 int slidermin = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); 2792 6502 if (sliderlen < slidermin || range > INT_MAX / 2) 2793 6503 sliderlen = slidermin; … … 2884 6594 case CC_ToolButton: 2885 6595 if (const QStyleOptionToolButton *toolButton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { 2886 int mbi = p ixelMetric(PM_MenuButtonIndicator, toolButton, widget);6596 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolButton, widget); 2887 6597 rect = toolButton->rect; 2888 6598 switch (subControl) { … … 2910 6620 case CC_Slider: 2911 6621 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) { 2912 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, slider, widget);2913 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);6622 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); 6623 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 2914 6624 switch (subControl) { 2915 6625 case SC_SliderHandle: { 2916 6626 int sliderPos = 0; 2917 int len = p ixelMetric(PM_SliderLength, slider, widget);6627 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 2918 6628 bool horizontal = slider->orientation == Qt::Horizontal; 2919 6629 sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, … … 2951 6661 case SC_ComboBoxArrow: 2952 6662 rect.setRect(xpos, y + bmarg, he - 2*bmarg, he - 2*bmarg); 2953 rect.setRect(xpos, y + bmarg, int((he - 2*bmarg)), he - 2*bmarg);2954 6663 break; 2955 case SC_ComboBoxEditField: 2956 rect.setRect(x + margin+4, y + margin+2, wi - 4 * margin - int((he - 2*bmarg) * 0.84f) -2, he - 2 * margin-4); 2957 break; 2958 case SC_ComboBoxFrame: 2959 rect = comboBox->rect; 2960 break; 6664 case SC_ComboBoxEditField: 6665 rect.setRect(x + margin, y + margin, wi - 2 * margin - int((he - 2*bmarg) * 0.84f), he - 2 * margin); 6666 if (d->doubleControls) { 6667 if (comboBox->editable) 6668 rect.adjust(2, 0, 0, 0); 6669 else 6670 rect.adjust(4, 2, 0, -2); 6671 } else if (!comboBox->editable) { 6672 rect.adjust(2, 1, 0, -1); 6673 } 6674 break; 6675 case SC_ComboBoxFrame: 6676 rect = comboBox->rect; 6677 break; 2961 6678 default: 2962 6679 break; … … 2968 6685 if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) { 2969 6686 QSize bs; 2970 int fw = spinBox->frame ? p ixelMetric(PM_SpinBoxFrameWidth, spinBox, widget) : 0;6687 int fw = spinBox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinBox, widget) : 0; 2971 6688 bs.setHeight(qMax(d->doubleControls ? 28 : 14, (spinBox->rect.height()))); 2972 6689 // 1.6 -approximate golden mean … … 2979 6696 switch (subControl) { 2980 6697 case SC_SpinBoxUp: 2981 rect = QRect(x +pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0 , bs.width(), bs.height());6698 rect = QRect(x + proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0 , bs.width(), bs.height()); 2982 6699 break; 2983 6700 case SC_SpinBoxDown: … … 2985 6702 break; 2986 6703 case SC_SpinBoxEditField: 6704 if (spinBox->buttonSymbols == QAbstractSpinBox::NoButtons) { 6705 rect = QRect(lx, fw, spinBox->rect.width() - 2*fw - 2, spinBox->rect.height() - 2*fw); 6706 } else { 2987 6707 rect = QRect(lx, fw, rx-2, spinBox->rect.height() - 2*fw); 6708 } 2988 6709 break; 2989 6710 case SC_SpinBoxFrame: … … 3025 6746 int frameWidth = 0; 3026 6747 if (groupBox->text.size()) { 3027 frameWidth = p ixelMetric(PM_DefaultFrameWidth, groupBox, widget);6748 frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); 3028 6749 rect = frameRect.adjusted(frameWidth, frameWidth + topHeight + labelMargin, -frameWidth, -frameWidth); 3029 6750 } … … 3046 6767 else 3047 6768 rect.setHeight(0); 3048 int indicatorWidth = p ixelMetric(PM_IndicatorWidth, option, widget);3049 int indicatorSpace = p ixelMetric(PM_CheckBoxLabelSpacing, option, widget) - 1;6769 int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); 6770 int indicatorSpace = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, option, widget) - 1; 3050 6771 bool hasCheckBox = groupBox->subControls & QStyle::SC_GroupBoxCheckBox; 3051 6772 int checkBoxSize = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0; … … 3061 6782 // Adjust for check box 3062 6783 if (subControl == SC_GroupBoxCheckBox) { 3063 int indicatorHeight = p ixelMetric(PM_IndicatorHeight, option, widget);6784 int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); 3064 6785 left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth); 3065 6786 int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2; … … 3127 6848 #endif //QT_NO_TOOLBAR 3128 6849 3129 #ifndef QT_NO_PROPERTIES 3130 if (QAbstractButton *pushButton = qobject_cast<QAbstractButton*>(widget)) { 3131 QVariant oldFont = widget->property("_q_styleWindowsMobileFont"); 3132 if (!oldFont.isValid()) { 3133 QFont f = pushButton->font(); 3134 widget->setProperty("_q_styleWindowsMobileFont", f); 3135 f.setBold(true); 3136 int p = f.pointSize(); 3137 if (p > 2) 3138 f.setPointSize(p-1); 3139 pushButton->setFont(f); 3140 } 3141 } 3142 #endif 3143 QWindowsStyle::polish(widget); 6850 QWindowsStyle::polish(widget); 3144 6851 } 3145 6852 3146 6853 void QWindowsMobileStyle::unpolish(QWidget *widget) 3147 6854 { 3148 #ifndef QT_NO_PROPERTIES3149 if (QAbstractButton *pushButton = qobject_cast<QAbstractButton*>(widget)) {3150 QVariant oldFont = widget->property("_q_styleWindowsMobileFont");3151 if (oldFont.isValid()) {3152 widget->setFont(qVariantValue<QFont>(oldFont));3153 widget->setProperty("_q_styleWindowsMobileFont", QVariant());3154 }3155 }3156 #endif3157 6855 QWindowsStyle::unpolish(widget); 3158 6856 } … … 3256 6954 case PM_RadioButtonLabelSpacing: 3257 6955 ret = d->doubleControls ? 6 * 2 : 6; 3258 break;3259 6956 break; 3260 6957 // Returns the number of pixels to use for the business part of the … … 3276 6973 int thick = 8; 3277 6974 if (ticks != QSlider::TicksBothSides && ticks != QSlider::NoTicks) 3278 thick += p ixelMetric(PM_SliderLength, sl, widget) / 4;6975 thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4; 3279 6976 3280 6977 space -= thick; … … 3298 6995 break; 3299 6996 case PM_IconViewIconSize: 3300 ret = p ixelMetric(PM_LargeIconSize, opt, widget);6997 ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); 3301 6998 break; 3302 6999 case PM_ToolBarIconSize: … … 3319 7016 break; 3320 7017 case PM_ScrollBarSliderMin: 3321 d->doubleControls ? ret = 36 : ret = 18; 3322 break; 7018 #ifdef Q_WS_WINCE_WM 7019 if (d->wm65) 7020 #else 7021 if (false) 7022 #endif 7023 { 7024 d->doubleControls ? ret = 68 : ret = 34; 7025 } else { 7026 d->doubleControls ? ret = 36 : ret = 18; 7027 } 7028 break; 3323 7029 case PM_ScrollBarExtent: { 3324 //Check if the scrollbar is part of an abstractItemView and set size according7030 3325 7031 if (d->smartphone) 3326 7032 ret = 9; 3327 7033 else 3328 7034 d->doubleControls ? ret = 25 : ret = 13; 7035 7036 #ifdef Q_WS_WINCE_WM 7037 if (d->wm65) 7038 #else 7039 if (false) 7040 #endif 7041 { 7042 d->doubleControls ? ret = 26 : ret = 13; 7043 break; 7044 } 7045 3329 7046 #ifndef QT_NO_SCROLLAREA 7047 //Check if the scrollbar is part of an abstractItemView and set size according 3330 7048 if (widget) 3331 7049 if (QWidget *parent = widget->parentWidget()) … … 3364 7082 case PM_TextCursorWidth: 3365 7083 ret = 2; 3366 break; 7084 break; 3367 7085 case PM_TabBar_ScrollButtonOverlap: 3368 7086 ret = 0; … … 3398 7116 case SH_ToolBar_Movable: 3399 7117 ret = false; 3400 break; 7118 break; 3401 7119 case SH_ScrollBar_ContextMenu: 3402 7120 ret = false; 7121 break; 7122 case SH_MenuBar_AltKeyNavigation: 7123 ret = false; 7124 break; 7125 case SH_RequestSoftwareInputPanel: 7126 ret = RSIP_OnMouseClick; 3403 7127 break; 3404 7128 default: … … 3464 7188 switch (iconMode) { 3465 7189 case QIcon::Selected: { 7190 #ifdef Q_WS_WINCE_WM 7191 if (d_func()->wm65) 7192 return pixmap; 7193 #endif //Q_WS_WINCE_WM 3466 7194 QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); 3467 7195 int imgh = img.height(); -
trunk/src/gui/styles/qwindowsmobilestyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowsmobilestyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 61 61 #ifndef QT_NO_STYLE_WINDOWSMOBILE 62 62 63 class QStyleOptionTab; 64 class QStyleOptionSlider; 65 class QStyleOptionViewItemV4; 66 63 67 class QWindowsMobileStylePrivate : public QWindowsStylePrivate 64 68 { … … 68 72 bool doubleControls; 69 73 bool smartphone; 74 #ifdef Q_WS_WINCE_WM 75 bool wm65; 76 #endif 70 77 71 78 QImage imageRadioButton; … … 86 93 QImage imageNormalize; 87 94 QImage imageMinimize; 95 96 void setupWindowsMobileStyle65(); 97 98 #ifdef Q_WS_WINCE_WM 99 //Windows Mobile 6.5 images 100 QImage imageScrollbarHandleUp; 101 QImage imageScrollbarHandleDown; 102 QImage imageScrollbarHandleUpHigh; 103 QImage imageScrollbarHandleDownHigh; 104 QImage imageScrollbarGripUp; 105 QImage imageScrollbarGripDown; 106 QImage imageScrollbarGripMiddle; 107 QImage imageListViewHighlightCornerLeft; 108 QImage imageListViewHighlightCornerRight; 109 QImage imageListViewHighlightMiddle; 110 QImage imageTabEnd; 111 QImage imageTabSelectedEnd; 112 QImage imageTabSelectedBegin; 113 QImage imageTabMiddle; 114 115 QColor currentTintHigh; 116 QColor currentTintButton; 117 118 void tintImagesHigh(QColor color); 119 void tintImagesButton(QColor color); 120 void tintListViewHighlight(QColor color); 121 122 #endif //Q_WS_WINCE_WM 123 124 void drawScrollbarHandleUp(QPainter *p, QStyleOptionSlider *opt, bool completeFrame = false, bool secondScrollBar = false); 125 void drawScrollbarHandleDown(QPainter *p, QStyleOptionSlider *opt, bool completeFrame = false, bool secondScrollBar = false); 126 void drawScrollbarGroove(QPainter *p, const QStyleOptionSlider *opt); 127 void drawScrollbarGrip(QPainter *p, QStyleOptionSlider *newScrollbar, const QStyleOptionComplex *option, bool drawCompleteFrame); 128 void drawTabBarTab(QPainter *p, const QStyleOptionTab *tab); 129 void drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect = QRect()); 130 88 131 }; 89 132 -
trunk/src/gui/styles/qwindowsstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 42 42 #include "qwindowsstyle.h" 43 43 #include "qwindowsstyle_p.h" 44 #include <private/q pixmapdata_p.h>44 #include <private/qstylehelper_p.h> 45 45 46 46 #if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) … … 68 68 #include "qwizard.h" 69 69 #include "qlistview.h" 70 #include <private/qmath_p.h> 71 #include <qmath.h> 72 70 73 71 74 #ifdef Q_WS_X11 … … 112 115 #include <limits.h> 113 116 QT_END_INCLUDE_NAMESPACE 114 115 static const int windowsItemFrame = 2; // menu item frame width116 static const int windowsSepHeight = 9; // separator item height117 static const int windowsItemHMargin = 3; // menu item hor text margin118 static const int windowsItemVMargin = 2; // menu item ver text margin119 static const int windowsArrowHMargin = 6; // arrow horizontal margin120 static const int windowsTabSpacing = 12; // space between text and tab121 static const int windowsCheckMarkHMargin = 2; // horiz. margins of check mark122 static const int windowsRightBorder = 15; // right border on windows123 static const int windowsCheckMarkWidth = 12; // checkmarks width on windows124 125 static bool use2000style = true;126 117 127 118 enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; … … 223 214 case QEvent::Show: 224 215 if (QProgressBar *bar = qobject_cast<QProgressBar *>(o)) { 225 d->bars << bar; 226 if (d->bars.size() == 1) { 227 Q_ASSERT(d->animationFps> 0); 228 d->animateTimer = startTimer(1000 / d->animationFps); 216 if (!d->bars.contains(bar)) { 217 d->bars << bar; 218 if (d->bars.size() == 1) { 219 Q_ASSERT(d->animationFps> 0); 220 d->animateTimer = startTimer(1000 / d->animationFps); 221 } 229 222 } 230 223 } … … 266 259 QWindowsStyle::QWindowsStyle() : QCommonStyle(*new QWindowsStylePrivate) 267 260 { 268 #if defined(Q_OS_WIN32)269 use2000style = QSysInfo::WindowsVersion != QSysInfo::WV_NT && QSysInfo::WindowsVersion != QSysInfo::WV_95;270 #endif271 261 } 272 262 … … 278 268 QWindowsStyle::QWindowsStyle(QWindowsStylePrivate &dd) : QCommonStyle(dd) 279 269 { 280 #if defined(Q_OS_WIN32)281 use2000style = QSysInfo::WindowsVersion != QSysInfo::WV_NT && QSysInfo::WindowsVersion != QSysInfo::WV_95;282 #endif283 270 } 284 271 … … 302 289 QWindowsStylePrivate *d = const_cast<QWindowsStylePrivate*>(d_func()); 303 290 // We only need the overhead when shortcuts are sometimes hidden 304 if (! styleHint(SH_UnderlineShortcut, 0) && app)291 if (!proxy()->styleHint(SH_UnderlineShortcut, 0) && app) 305 292 app->installEventFilter(this); 306 293 … … 403 390 #ifndef QT_NO_SLIDER 404 391 case PM_SliderLength: 405 ret = 11;392 ret = int(QStyleHelper::dpiScaled(11.)); 406 393 break; 407 394 … … 425 412 int thick = 6; // Magic constant to get 5 + 16 + 5 426 413 if (ticks != QSlider::TicksBothSides && ticks != QSlider::NoTicks) 427 thick += p ixelMetric(PM_SliderLength, sl, widget) / 4;414 thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4; 428 415 429 416 space -= thick; … … 451 438 452 439 case PM_SmallIconSize: 453 ret = 16;440 ret = int(QStyleHelper::dpiScaled(16.)); 454 441 break; 455 442 456 443 case PM_LargeIconSize: 457 ret = 32;444 ret = int(QStyleHelper::dpiScaled(32.)); 458 445 break; 459 446 460 447 case PM_IconViewIconSize: 461 ret = pixelMetric(PM_LargeIconSize, opt, widget); 462 break; 463 464 case PM_ToolBarIconSize: 465 ret = 24; 466 break; 448 ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); 449 break; 450 467 451 case PM_DockWidgetTitleMargin: 468 ret = 2;452 ret = int(QStyleHelper::dpiScaled(2.)); 469 453 break; 470 454 case PM_DockWidgetTitleBarButtonMargin: 471 ret = 4;455 ret = int(QStyleHelper::dpiScaled(4.)); 472 456 break; 473 457 #if defined(Q_WS_WIN) … … 551 535 break; 552 536 case PM_ToolBarHandleExtent: 553 ret = 10;537 ret = int(QStyleHelper::dpiScaled(10.)); 554 538 break; 555 539 default: … … 934 918 #endif //QT_NO_IMAGEFORMAT_XPM 935 919 920 #ifdef Q_OS_WIN 921 static QPixmap loadIconFromShell32( int resourceId, int size ) 922 { 923 #ifdef Q_OS_WINCE 924 HMODULE hmod = LoadLibrary(L"ceshell.dll"); 925 #else 926 HMODULE hmod = LoadLibrary(L"shell32.dll"); 927 #endif 928 if( hmod ) { 929 HICON iconHandle = (HICON)LoadImage(hmod, MAKEINTRESOURCE(resourceId), IMAGE_ICON, size, size, 0); 930 if( iconHandle ) { 931 QPixmap iconpixmap = QPixmap::fromWinHICON( iconHandle ); 932 DestroyIcon(iconHandle); 933 return iconpixmap; 934 } 935 } 936 return QPixmap(); 937 } 938 #endif 939 936 940 /*! 937 941 \reimp … … 1023 1027 { 1024 1028 HICON iconHandle = LoadIcon(NULL, IDI_INFORMATION); 1025 desktopIcon = convertHIconToPixmap( iconHandle );1029 desktopIcon = QPixmap::fromWinHICON( iconHandle ); 1026 1030 DestroyIcon(iconHandle); 1027 1031 break; … … 1030 1034 { 1031 1035 HICON iconHandle = LoadIcon(NULL, IDI_WARNING); 1032 desktopIcon = convertHIconToPixmap( iconHandle );1036 desktopIcon = QPixmap::fromWinHICON( iconHandle ); 1033 1037 DestroyIcon(iconHandle); 1034 1038 break; … … 1037 1041 { 1038 1042 HICON iconHandle = LoadIcon(NULL, IDI_ERROR); 1039 desktopIcon = convertHIconToPixmap( iconHandle );1043 desktopIcon = QPixmap::fromWinHICON( iconHandle ); 1040 1044 DestroyIcon(iconHandle); 1041 1045 break; … … 1044 1048 { 1045 1049 HICON iconHandle = LoadIcon(NULL, IDI_QUESTION); 1046 desktopIcon = convertHIconToPixmap( iconHandle );1050 desktopIcon = QPixmap::fromWinHICON( iconHandle ); 1047 1051 DestroyIcon(iconHandle); 1048 1052 break; … … 1059 1063 iconInfo.cbSize = sizeof(iconInfo); 1060 1064 if (pSHGetStockIconInfo(_SIID_SHIELD, _SHGFI_ICON | _SHGFI_SMALLICON, &iconInfo) == S_OK) { 1061 pixmap = convertHIconToPixmap(iconInfo.hIcon);1065 pixmap = QPixmap::fromWinHICON(iconInfo.hIcon); 1062 1066 DestroyIcon(iconInfo.hIcon); 1063 1067 return pixmap; … … 1065 1069 } 1066 1070 } 1071 break; 1072 default: 1067 1073 break; 1068 1074 } … … 1134 1140 break; 1135 1141 case SH_ItemView_ChangeHighlightOnFocus: 1136 #if defined(Q_WS_WIN) 1137 if (QSysInfo::WindowsVersion != QSysInfo::WV_95 && QSysInfo::WindowsVersion != QSysInfo::WV_NT) 1138 ret = 1; 1139 else 1140 #endif 1141 ret = 0; 1142 ret = 1; 1142 1143 break; 1143 1144 case SH_ToolBox_SelectedPageTitleBold: … … 1147 1148 #if defined(Q_WS_WIN) 1148 1149 case SH_UnderlineShortcut: 1150 { 1149 1151 ret = 1; 1150 if (QSysInfo::WindowsVersion != QSysInfo::WV_95 1151 && QSysInfo::WindowsVersion != QSysInfo::WV_98 1152 && QSysInfo::WindowsVersion != QSysInfo::WV_NT) { 1153 BOOL cues; 1154 SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &cues, 0); 1155 ret = int(cues); 1156 // Do nothing if we always paint underlines 1157 Q_D(const QWindowsStyle); 1158 if (!ret && widget && d) { 1152 BOOL cues = false; 1153 SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &cues, 0); 1154 ret = int(cues); 1155 // Do nothing if we always paint underlines 1156 Q_D(const QWindowsStyle); 1157 if (!ret && widget && d) { 1159 1158 #ifndef QT_NO_MENUBAR 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1159 const QMenuBar *menuBar = qobject_cast<const QMenuBar *>(widget); 1160 if (!menuBar && qobject_cast<const QMenu *>(widget)) { 1161 QWidget *w = QApplication::activeWindow(); 1162 if (w && w != widget) 1163 menuBar = qFindChild<QMenuBar *>(w); 1164 } 1165 // If we paint a menu bar draw underlines if is in the keyboardState 1166 if (menuBar) { 1167 if (menuBar->d_func()->keyboardState || d->altDown()) 1168 ret = 1; 1169 // Otherwise draw underlines if the toplevel widget has seen an alt-press 1170 } else 1172 1171 #endif // QT_NO_MENUBAR 1173 1174 1175 1176 1177 }1178 break;1172 if (d->hasSeenAlt(widget)) { 1173 ret = 1; 1174 } 1175 } 1176 break; 1177 } 1179 1178 #endif 1180 1179 #ifndef QT_NO_RUBBERBAND … … 1217 1216 case SH_ItemView_ArrowKeysNavigateIntoChildren: 1218 1217 ret = true; 1218 break; 1219 case SH_DialogButtonBox_ButtonsHaveIcons: 1220 ret = 0; 1219 1221 break; 1220 1222 default: … … 1273 1275 if (opt->state & State_Horizontal) { 1274 1276 int x = opt->rect.width() / 2 - 4; 1275 if ( QApplication::layoutDirection()== Qt::RightToLeft)1277 if (opt->direction == Qt::RightToLeft) 1276 1278 x -= 2; 1277 1279 if (opt->rect.height() > 4) { … … 1314 1316 && (!(opt->state & State_Enabled) 1315 1317 || !(opt->state & State_MouseOver && opt->state & State_AutoRaise)) 1316 && (opt->state & State_On) && use2000style) {1318 && (opt->state & State_On)) { 1317 1319 fill = QBrush(opt->palette.light().color(), Qt::Dense4Pattern); 1318 1320 stippled = true; … … 1387 1389 int size = qMin(r.height(), r.width()); 1388 1390 QPixmap pixmap; 1389 QString pixmapName; 1390 pixmapName.sprintf("%s-%s-%d-%d-%d-%lld", 1391 "$qt_ia", metaObject()->className(), 1392 uint(opt->state), pe, 1393 size, opt->palette.cacheKey()); 1391 QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-") + QLatin1String(metaObject()->className()), opt, QSize(size, size)) 1392 + QLatin1Char('-') + QString::number(pe); 1394 1393 if (!QPixmapCache::find(pixmapName, pixmap)) { 1395 1394 int border = size/5; … … 1421 1420 1422 1421 if (opt->state & State_Sunken) { 1423 bsx = p ixelMetric(PM_ButtonShiftHorizontal, opt, w);1424 bsy = p ixelMetric(PM_ButtonShiftVertical, opt, w);1422 bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal, opt, w); 1423 bsy = proxy()->pixelMetric(PM_ButtonShiftVertical, opt, w); 1425 1424 } 1426 1425 … … 1511 1510 if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) { 1512 1511 //### check for d->alt_down 1513 if (!(fropt->state & State_KeyboardFocusChange) && ! styleHint(SH_UnderlineShortcut, opt))1512 if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt)) 1514 1513 return; 1515 1514 QRect r = opt->rect; … … 1578 1577 int xOffset = 0; 1579 1578 int yOffset = 0; 1580 int indicatorWidth = p ixelMetric(PM_ExclusiveIndicatorWidth);1581 int indicatorHeight = p ixelMetric(PM_ExclusiveIndicatorWidth);1579 int indicatorWidth = proxy()->pixelMetric(PM_ExclusiveIndicatorWidth); 1580 int indicatorHeight = proxy()->pixelMetric(PM_ExclusiveIndicatorWidth); 1582 1581 if (ir.width() > indicatorWidth) 1583 1582 xOffset += (ir.width() - indicatorWidth)/2; … … 1628 1627 popupPal.setColor(QPalette::Midlight, frame->palette.light().color()); 1629 1628 } 1630 if ( use2000style &&pe == PE_Frame && (frame->state & State_Raised))1629 if (pe == PE_Frame && (frame->state & State_Raised)) 1631 1630 qDrawWinButton(p, frame->rect, popupPal, frame->state & State_Sunken); 1632 else if ( use2000style &&pe == PE_Frame && (frame->state & State_Sunken))1631 else if (pe == PE_Frame && (frame->state & State_Sunken)) 1633 1632 { 1634 1633 popupPal.setColor(QPalette::Midlight, frame->palette.background().color()); … … 1736 1735 case PE_FrameDockWidget: 1737 1736 if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) { 1738 drawPrimitive(QStyle::PE_FrameWindow, opt, p, w);1737 proxy()->drawPrimitive(QStyle::PE_FrameWindow, opt, p, w); 1739 1738 } 1740 1739 break; … … 1755 1754 1756 1755 int space = 2; 1757 int chunksize = p ixelMetric(PM_ProgressBarChunkWidth, opt, w) - space;1756 int chunksize = proxy()->pixelMetric(PM_ProgressBarChunkWidth, opt, w) - space; 1758 1757 if (!vertical) { 1759 1758 if (opt->rect.width() <= chunksize) … … 1781 1780 #endif // QT_NO_PROGRESSBAR 1782 1781 1783 case PE_FrameTabWidget: 1784 if (use2000style) { 1785 QRect rect = opt->rect; 1786 QPalette pal = opt->palette; 1787 qDrawWinButton(p, opt->rect, opt->palette, false, 0); 1788 break; 1789 } 1782 case PE_FrameTabWidget: { 1783 qDrawWinButton(p, opt->rect, opt->palette, false, 0); 1784 break; 1785 } 1790 1786 default: 1791 1787 QCommonStyle::drawPrimitive(pe, opt, p, w); … … 1814 1810 QRect r = opt->rect; 1815 1811 QStyleHintReturnMask mask; 1816 if ( styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask))1812 if (proxy()->styleHint(QStyle::SH_RubberBand_Mask, opt, widget, &mask)) 1817 1813 p->setClipRegion(mask.region); 1818 1814 p->drawTiledPixmap(r.x(), r.y(), r.width(), r.height(), tiledPixmap); … … 1846 1842 1847 1843 // windows always has a check column, regardless whether we have an icon or not 1848 int checkcol = qMax (menuitem->maxIconWidth,windowsCheckMarkWidth);1844 int checkcol = qMax<int>(menuitem->maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth); 1849 1845 1850 1846 QBrush fill = menuitem->palette.brush(act ? QPalette::Highlight : QPalette::Button); … … 1883 1879 QPixmap pixmap; 1884 1880 if (checked) 1885 pixmap = menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On);1881 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode, QIcon::On); 1886 1882 else 1887 pixmap = menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, opt, widget), mode);1883 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode); 1888 1884 int pixw = pixmap.width(); 1889 1885 int pixh = pixmap.height(); … … 1902 1898 if (act) 1903 1899 newMi.state |= State_On; 1904 newMi.rect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x() + windowsItemFrame, menuitem->rect.y() + windowsItemFrame, 1905 checkcol - 2 * windowsItemFrame, menuitem->rect.height() - 2*windowsItemFrame)); 1906 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget); 1900 newMi.rect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x() + QWindowsStylePrivate::windowsItemFrame, 1901 menuitem->rect.y() + QWindowsStylePrivate::windowsItemFrame, 1902 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame, 1903 menuitem->rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame)); 1904 proxy()->drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget); 1907 1905 } 1908 1906 p->setPen(act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color()); … … 1914 1912 } 1915 1913 1916 int xm = windowsItemFrame + checkcol +windowsItemHMargin;1914 int xm = QWindowsStylePrivate::windowsItemFrame + checkcol + QWindowsStylePrivate::windowsItemHMargin; 1917 1915 int xpos = menuitem->rect.x() + xm; 1918 QRect textRect(xpos, y + windowsItemVMargin, w - xm - windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin); 1916 QRect textRect(xpos, y + QWindowsStylePrivate::windowsItemVMargin, 1917 w - xm - QWindowsStylePrivate::windowsRightBorder - tab + 1, h - 2 * QWindowsStylePrivate::windowsItemVMargin); 1919 1918 QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); 1920 1919 QString s = menuitem->text; … … 1923 1922 int t = s.indexOf(QLatin1Char('\t')); 1924 1923 int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 1925 if (! styleHint(SH_UnderlineShortcut, menuitem, widget))1924 if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) 1926 1925 text_flags |= Qt::TextHideMnemonic; 1927 1926 text_flags |= Qt::AlignLeft; … … 1929 1928 QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, 1930 1929 QRect(textRect.topRight(), QPoint(menuitem->rect.right(), textRect.bottom()))); 1931 if (dis && !act && styleHint(SH_EtchDisabledText, opt, widget)) {1930 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, opt, widget)) { 1932 1931 p->setPen(menuitem->palette.light().color()); 1933 1932 p->drawText(vShortcutRect.adjusted(1,1,1,1), text_flags, s.mid(t + 1)); … … 1941 1940 font.setBold(true); 1942 1941 p->setFont(font); 1943 if (dis && !act && styleHint(SH_EtchDisabledText, opt, widget)) {1942 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, opt, widget)) { 1944 1943 p->setPen(menuitem->palette.light().color()); 1945 1944 p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t)); … … 1950 1949 } 1951 1950 if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow 1952 int dim = (h - 2 * windowsItemFrame) / 2;1951 int dim = (h - 2 * QWindowsStylePrivate::windowsItemFrame) / 2; 1953 1952 PrimitiveElement arrow; 1954 1953 arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight; 1955 xpos = x + w - windowsArrowHMargin -windowsItemFrame - dim;1954 xpos = x + w - QWindowsStylePrivate::windowsArrowHMargin - QWindowsStylePrivate::windowsItemFrame - dim; 1956 1955 QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect, QRect(xpos, y + h / 2 - dim / 2, dim, dim)); 1957 1956 QStyleOptionMenuItem newMI = *menuitem; … … 1961 1960 newMI.palette.setColor(QPalette::ButtonText, 1962 1961 newMI.palette.highlightedText().color()); 1963 drawPrimitive(arrow, &newMI, p, widget);1962 proxy()->drawPrimitive(arrow, &newMI, p, widget); 1964 1963 } 1965 1964 … … 1983 1982 mbi->rect.height(), mbi->palette, active && down, 1, 0, &b); 1984 1983 if (active && down) { 1985 newMbi.rect.translate(p ixelMetric(PM_ButtonShiftHorizontal, mbi, widget),1986 p ixelMetric(PM_ButtonShiftVertical, mbi, widget));1984 newMbi.rect.translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal, mbi, widget), 1985 proxy()->pixelMetric(PM_ButtonShiftVertical, mbi, widget)); 1987 1986 p->setBrushOrigin(p->brushOrigin() - QPoint(1, 1)); 1988 1987 } … … 2018 2017 && tab->selectedPosition 2019 2018 == QStyleOptionTab::PreviousIsSelected)); 2020 int tabBarAlignment = styleHint(SH_TabBar_Alignment, tab, widget);2019 int tabBarAlignment = proxy()->styleHint(SH_TabBar_Alignment, tab, widget); 2021 2020 bool leftAligned = (!rtlHorTabs && tabBarAlignment == Qt::AlignLeft) 2022 2021 || (rtlHorTabs … … 2032 2031 QColor shadow = tab->palette.shadow().color(); 2033 2032 QColor background = tab->palette.background().color(); 2034 int borderThinkness = p ixelMetric(PM_TabBarBaseOverlap, tab, widget);2033 int borderThinkness = proxy()->pixelMetric(PM_TabBarBaseOverlap, tab, widget); 2035 2034 if (selected) 2036 2035 borderThinkness /= 2; … … 2063 2062 p->drawLine(x1, y1 + 2, x1, y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); 2064 2063 p->drawPoint(x1 + 1, y1 + 1); 2065 if (!use2000style) {2066 p->setPen(midlight);2067 p->drawLine(x1 + 1, y1 + 2, x1 + 1, y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));2068 }2069 2064 } 2070 2065 // Top … … 2074 2069 p->setPen(light); 2075 2070 p->drawLine(beg, y1, end, y1); 2076 if (!use2000style) {2077 p->setPen(midlight);2078 p->drawLine(beg, y1 + 1, end, y1 + 1);2079 }2080 2071 } 2081 2072 // Right … … 2107 2098 p->drawLine(x1, y2 - 2, x1, y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness)); 2108 2099 p->drawPoint(x1 + 1, y2 - 1); 2109 if (!use2000style) {2110 p->setPen(midlight);2111 p->drawLine(x1 + 1, y2 - 2, x1 + 1, y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));2112 }2113 2100 } 2114 2101 // Bottom … … 2149 2136 p->drawLine(x1 + 2, y1, x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); 2150 2137 p->drawPoint(x1 + 1, y1 + 1); 2151 if (!use2000style) {2152 p->setPen(midlight);2153 p->drawLine(x1 + 2, y1 + 1, x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1 + 1);2154 }2155 2138 } 2156 2139 // Left … … 2160 2143 p->setPen(light); 2161 2144 p->drawLine(x1, beg, x1, end); 2162 if (!use2000style) {2163 p->setPen(midlight);2164 p->drawLine(x1 + 1, beg, x1 + 1, end);2165 }2166 2145 } 2167 2146 // Bottom … … 2195 2174 p->drawLine(x2 - 2, y1, x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1); 2196 2175 p->drawPoint(x2 - 1, y1 + 1); 2197 if (!use2000style) {2198 p->setPen(midlight);2199 p->drawLine(x2 - 3, y1 + 1, x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1 + 1);2200 p->drawPoint(x2 - 1, y1);2201 }2202 2176 } 2203 2177 // Right … … 2236 2210 case CE_ScrollBarSubLine: 2237 2211 case CE_ScrollBarAddLine: { 2238 if ( use2000style &&(opt->state & State_Sunken)) {2212 if ((opt->state & State_Sunken)) { 2239 2213 p->setPen(opt->palette.dark().color()); 2240 2214 p->setBrush(opt->palette.brush(QPalette::Button)); … … 2264 2238 QStyleOption arrowOpt = *opt; 2265 2239 arrowOpt.rect = opt->rect.adjusted(4, 4, -4, -4); 2266 drawPrimitive(arrow, &arrowOpt, p, widget);2240 proxy()->drawPrimitive(arrow, &arrowOpt, p, widget); 2267 2241 break; } 2268 2242 case CE_ScrollBarAddPage: … … 2353 2327 break; 2354 2328 } 2355 if( QApplication::layoutDirection()== Qt::RightToLeft){ //reverse layout changes the order of Beginning/end2329 if(opt->direction == Qt::RightToLeft){ //reverse layout changes the order of Beginning/end 2356 2330 bool tmp = paintLeftBorder; 2357 2331 paintRightBorder=paintLeftBorder; … … 2450 2424 if (pb->minimum == 0 && pb->maximum == 0) { 2451 2425 Q_D(const QWindowsStyle); 2452 const int unit_width = p ixelMetric(PM_ProgressBarChunkWidth, pb, widget);2426 const int unit_width = proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb, widget); 2453 2427 QStyleOptionProgressBarV2 pbBits = *pb; 2454 2428 Q_ASSERT(unit_width >0); … … 2474 2448 pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); 2475 2449 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); 2476 drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget);2450 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); 2477 2451 x += reverse ? -unit_width : unit_width; 2478 2452 } … … 2485 2459 pbBits.rect.setRect(x0 + x, myY, unit_width, myHeight); 2486 2460 pbBits.rect = m.mapRect(QRectF(pbBits.rect)).toRect(); 2487 drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget);2461 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits, p, widget); 2488 2462 x += reverse ? -unit_width : unit_width; 2489 2463 } … … 2524 2498 bool floating = false; 2525 2499 bool active = dwOpt->state & State_Active; 2526 int menuOffset = 0; //used to center text when floated2527 2500 QColor inactiveCaptionTextColor = d->inactiveCaptionText; 2528 2501 if (dwOpt->movable) { … … 2539 2512 right = d->inactiveGradientCaptionColor; 2540 2513 } 2541 menuOffset = 2;2542 2514 QBrush fillBrush(left); 2543 2515 if (left != right) { … … 2573 2545 titleRect.height(), titleRect.width()); 2574 2546 } 2575 drawItemText(p, titleRect,2547 proxy()->drawItemText(p, titleRect, 2576 2548 Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, palette, 2577 2549 dwOpt->state & State_Enabled, dwOpt->title, … … 2603 2575 = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt); 2604 2576 bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar; 2605 int m = p ixelMetric(PM_DockWidgetTitleMargin, opt, w);2577 int m = proxy()->pixelMetric(PM_DockWidgetTitleMargin, opt, w); 2606 2578 if (verticalTitleBar) { 2607 2579 r.adjust(0, 0, 0, -m); 2608 2580 } else { 2609 if ( QApplication::layoutDirection()== Qt::LeftToRight)2581 if (opt->direction == Qt::LeftToRight) 2610 2582 r.adjust(m, 0, 0, 0); 2611 2583 else … … 2637 2609 case CC_Slider: 2638 2610 if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) { 2639 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);2640 int len = p ixelMetric(PM_SliderLength, slider, widget);2611 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 2612 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 2641 2613 int ticks = slider->tickPosition; 2642 QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, widget);2643 QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, widget);2614 QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget); 2615 QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget); 2644 2616 2645 2617 if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { … … 2712 2684 fropt.QStyleOption::operator=(*slider); 2713 2685 fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); 2714 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);2686 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 2715 2687 } 2716 2688 … … 3024 2996 if (cmb->frame) { 3025 2997 QPalette shadePal = opt->palette; 3026 if (use2000style) 3027 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); 2998 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); 3028 2999 qDrawWinPanel(p, opt->rect, shadePal, true, &editBrush); 3029 3000 } … … 3035 3006 State flags = State_None; 3036 3007 3037 QRect ar = subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget);3008 QRect ar = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); 3038 3009 bool sunkenArrow = cmb->activeSubControls == SC_ComboBoxArrow 3039 3010 && cmb->state & State_Sunken; … … 3054 3025 if (opt->state & State_Enabled) 3055 3026 flags |= State_Enabled; 3027 if (opt->state & State_HasFocus) 3028 flags |= State_HasFocus; 3056 3029 3057 3030 if (sunkenArrow) … … 3061 3034 arrowOpt.palette = cmb->palette; 3062 3035 arrowOpt.state = flags; 3063 drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);3036 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); 3064 3037 } 3065 3038 3066 3039 if (cmb->subControls & SC_ComboBoxEditField) { 3067 QRect re = subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget);3040 QRect re = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); 3068 3041 if (cmb->state & State_HasFocus && !cmb->editable) 3069 3042 p->fillRect(re.x(), re.y(), re.width(), re.height(), … … 3085 3058 focus.state |= State_FocusAtBorder; 3086 3059 focus.backgroundColor = cmb->palette.highlight().color(); 3087 drawPrimitive(PE_FrameFocusRect, &focus, p, widget);3060 proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); 3088 3061 } 3089 3062 } … … 3099 3072 if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) { 3100 3073 QBrush editBrush = sb->palette.brush(QPalette::Base); 3101 QRect r = subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget);3074 QRect r = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxFrame, widget); 3102 3075 QPalette shadePal = sb->palette; 3103 if (use2000style) 3104 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); 3076 shadePal.setColor(QPalette::Midlight, shadePal.button().color()); 3105 3077 qDrawWinPanel(p, r, shadePal, true, &editBrush); 3106 3078 } … … 3130 3102 : PE_IndicatorSpinUp); 3131 3103 3132 copy.rect = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget);3104 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); 3133 3105 qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), 3134 3106 ©.palette.brush(QPalette::Button)); … … 3138 3110 lightCopy.rect.adjust(1, 1, 1, 1); 3139 3111 lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); 3140 drawPrimitive(pe, &lightCopy, p, widget);3141 } 3142 drawPrimitive(pe, ©, p, widget);3112 proxy()->drawPrimitive(pe, &lightCopy, p, widget); 3113 } 3114 proxy()->drawPrimitive(pe, ©, p, widget); 3143 3115 } 3144 3116 … … 3163 3135 : PE_IndicatorSpinDown); 3164 3136 3165 copy.rect = subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget);3137 copy.rect = proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); 3166 3138 qDrawWinButton(p, copy.rect, shadePal, copy.state & (State_Sunken | State_On), 3167 3139 ©.palette.brush(QPalette::Button)); … … 3171 3143 lightCopy.rect.adjust(1, 1, 1, 1); 3172 3144 lightCopy.palette.setBrush(QPalette::ButtonText, copy.palette.light()); 3173 drawPrimitive(pe, &lightCopy, p, widget);3174 } 3175 drawPrimitive(pe, ©, p, widget);3145 proxy()->drawPrimitive(pe, &lightCopy, p, widget); 3146 } 3147 proxy()->drawPrimitive(pe, ©, p, widget); 3176 3148 } 3177 3149 } 3178 3150 break; 3179 3151 #endif // QT_NO_SPINBOX 3152 3180 3153 default: 3181 3154 QCommonStyle::drawComplexControl(cc, opt, p, widget); … … 3196 3169 int defwidth = 0; 3197 3170 if (btn->features & QStyleOptionButton::AutoDefaultButton) 3198 defwidth = 2 * pixelMetric(PM_ButtonDefaultIndicator, btn, widget); 3171 defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget); 3172 int minwidth = int(QStyleHelper::dpiScaled(75.)); 3173 int minheight = int(QStyleHelper::dpiScaled(23.)); 3174 3199 3175 #ifndef QT_QWS_SMALL_PUSHBUTTON 3200 if (w < 75+ defwidth && !btn->text.isEmpty())3201 w = 75+ defwidth;3202 if (h < 23+ defwidth)3203 h = 23+ defwidth;3176 if (w < minwidth + defwidth && !btn->text.isEmpty()) 3177 w = minwidth + defwidth; 3178 if (h < minheight + defwidth) 3179 h = minheight + defwidth; 3204 3180 #endif 3205 3181 sz = QSize(w, h); … … 3213 3189 3214 3190 if (mi->menuItemType == QStyleOptionMenuItem::Separator) { 3215 sz = QSize(10, windowsSepHeight);3191 sz = QSize(10, QWindowsStylePrivate::windowsSepHeight); 3216 3192 } 3217 3193 else if (mi->icon.isNull()) { … … 3221 3197 3222 3198 if (mi->menuItemType != QStyleOptionMenuItem::Separator && !mi->icon.isNull()) { 3223 int iconExtent = p ixelMetric(PM_SmallIconSize, opt, widget);3199 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); 3224 3200 sz.setHeight(qMax(sz.height(), 3225 3201 mi->icon.actualSize(QSize(iconExtent, iconExtent)).height() 3226 + 2 * windowsItemFrame));3202 + 2 * QWindowsStylePrivate::windowsItemFrame)); 3227 3203 } 3228 3204 int maxpmw = mi->maxIconWidth; 3229 int tabSpacing = use2000style ? 20 :windowsTabSpacing;3205 int tabSpacing = 20; 3230 3206 if (mi->text.contains(QLatin1Char('\t'))) 3231 3207 w += tabSpacing; 3232 3208 else if (mi->menuItemType == QStyleOptionMenuItem::SubMenu) 3233 w += 2 * windowsArrowHMargin;3209 w += 2 * QWindowsStylePrivate::windowsArrowHMargin; 3234 3210 else if (mi->menuItemType == QStyleOptionMenuItem::DefaultItem) { 3235 3211 // adjust the font and add the difference in size. … … 3242 3218 } 3243 3219 3244 int checkcol = qMax (maxpmw,windowsCheckMarkWidth); // Windows always shows a check column3220 int checkcol = qMax<int>(maxpmw, QWindowsStylePrivate::windowsCheckMarkWidth); // Windows always shows a check column 3245 3221 w += checkcol; 3246 w += windowsRightBorder + 10;3222 w += QWindowsStylePrivate::windowsRightBorder + 10; 3247 3223 sz.setWidth(w); 3248 3224 } … … 3252 3228 case CT_MenuBarItem: 3253 3229 if (!sz.isEmpty()) 3254 sz += QSize( windowsItemHMargin * 4,windowsItemVMargin * 2);3230 sz += QSize(QWindowsStylePrivate::windowsItemHMargin * 4, QWindowsStylePrivate::windowsItemVMargin * 2); 3255 3231 break; 3256 3232 #endif … … 3381 3357 && pSHGetStockIconInfo) 3382 3358 { 3383 icon.addPixmap( standardPixmap(SP_VistaShield, option, widget)); //fetches small icon3359 icon.addPixmap(proxy()->standardPixmap(SP_VistaShield, option, widget)); //fetches small icon 3384 3360 QSHSTOCKICONINFO iconInfo; //append large icon 3385 3361 memset(&iconInfo, 0, sizeof(iconInfo)); 3386 3362 iconInfo.cbSize = sizeof(iconInfo); 3387 3363 if (pSHGetStockIconInfo(_SIID_SHIELD, _SHGFI_ICON | _SHGFI_LARGEICON, &iconInfo) == S_OK) { 3388 icon.addPixmap( convertHIconToPixmap(iconInfo.hIcon));3364 icon.addPixmap(QPixmap::fromWinHICON(iconInfo.hIcon)); 3389 3365 DestroyIcon(iconInfo.hIcon); 3390 3366 } -
trunk/src/gui/styles/qwindowsstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowsstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 88 88 QColor inactiveCaptionColor; 89 89 QColor inactiveGradientCaptionColor; 90 91 enum { 92 windowsItemFrame = 2, // menu item frame width 93 windowsSepHeight = 9, // separator item height 94 windowsItemHMargin = 3, // menu item hor text margin 95 windowsItemVMargin = 2, // menu item ver text margin 96 windowsArrowHMargin = 6, // arrow horizontal margin 97 windowsRightBorder = 15, // right border on windows 98 windowsCheckMarkWidth = 12 // checkmarks width on windows 90 99 }; 100 }; 91 101 92 102 QT_END_NAMESPACE -
trunk/src/gui/styles/qwindowsvistastyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 42 42 #include "qwindowsvistastyle.h" 43 43 #include "qwindowsvistastyle_p.h" 44 #include <private/qstylehelper_p.h> 44 45 45 46 #if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN) … … 159 160 160 161 //convert Qt state flags to uxtheme button states 161 int buttonStateId(int flags, int partId)162 static int buttonStateId(int flags, int partId) 162 163 { 163 164 int stateId = 0; … … 190 191 } 191 192 192 void Animation::paint(QPainter *painter, const QStyleOption *option)193 void QWindowsVistaAnimation::paint(QPainter *painter, const QStyleOption *option) 193 194 { 194 195 Q_UNUSED(option); … … 196 197 } 197 198 198 /* 199 * ! \internal 200 * 201 * Helperfunction to paint the current transition state 202 * between two animation frames. 203 * 204 * The result is a blended image consisting of 205 * ((alpha)*_primaryImage) + ((1-alpha)*_secondaryImage) 206 * 199 /*! \internal 200 201 Helperfunction to paint the current transition state between two 202 animation frames. 203 204 The result is a blended image consisting of ((alpha)*_primaryImage) 205 + ((1-alpha)*_secondaryImage) 206 207 207 */ 208 209 void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) { 208 void QWindowsVistaAnimation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) { 210 209 if (_secondaryImage.isNull() || _primaryImage.isNull()) 211 210 return; … … 248 247 } 249 248 250 /* 251 * ! \internal 252 * 253 * Paints a transition state. The result will be a mix between the 254 * initial and final state of the transition, depending on the 255 * time difference between _startTime and current time. 249 /*! \internal 250 Paints a transition state. The result will be a mix between the 251 initial and final state of the transition, depending on the time 252 difference between _startTime and current time. 256 253 */ 257 258 void Transition::paint(QPainter *painter, const QStyleOption *option) 254 void QWindowsVistaTransition::paint(QPainter *painter, const QStyleOption *option) 259 255 { 260 256 float alpha = 1.0; … … 278 274 } 279 275 280 /* 281 * ! \internal 282 * 283 * Paints a pulse. The result will be a mix between the 284 * primary and secondary pulse images depending on the 285 * time difference between _startTime and current time. 276 /*! \internal 277 Paints a pulse. The result will be a mix between the primary and 278 secondary pulse images depending on the time difference between 279 _startTime and current time. 286 280 */ 287 288 289 void Pulse::paint(QPainter *painter, const QStyleOption *option) 281 void QWindowsVistaPulse::paint(QPainter *painter, const QStyleOption *option) 290 282 { 291 283 float alpha = 1.0; … … 308 300 309 301 /*! 310 \reimp 311 * 312 * Animations are used for some state transitions on specific widgets. 313 * 314 * Only one running animation can exist for a widget at any specific time. 315 * Animations can be added through QWindowsVistaStylePrivate::startAnimation(Animation *) 316 * and any existing animation on a widget can be retrieved with 317 * QWindowsVistaStylePrivate::widgetAnimation(Widget *). 318 * 319 * Once an animation has been started, QWindowsVistaStylePrivate::timerEvent(QTimerEvent *) 320 * will continuously call update() on the widget until it is stopped, meaning that drawPrimitive 321 * will be called many times until the transition has completed. During this time, the result 322 * will be retrieved by the Animation::paint(...) function and not by the style itself. 323 * 324 * To determine if a transition should occur, the style needs to know the previous state of the 325 * widget as well as the current one. This is solved by updating dynamic properties on the widget 326 * every time the function is called. 327 * 328 * Transitions interrupting existing transitions should always be smooth, so whenever a hover-transition 329 * is started on a pulsating button, it uses the current frame of the pulse-animation as the 330 * starting image for the hover transition. 331 * 302 \internal 303 304 Animations are used for some state transitions on specific widgets. 305 306 Only one running animation can exist for a widget at any specific 307 time. Animations can be added through 308 QWindowsVistaStylePrivate::startAnimation(Animation *) and any 309 existing animation on a widget can be retrieved with 310 QWindowsVistaStylePrivate::widgetAnimation(Widget *). 311 312 Once an animation has been started, 313 QWindowsVistaStylePrivate::timerEvent(QTimerEvent *) will 314 continuously call update() on the widget until it is stopped, 315 meaning that drawPrimitive will be called many times until the 316 transition has completed. During this time, the result will be 317 retrieved by the Animation::paint(...) function and not by the style 318 itself. 319 320 To determine if a transition should occur, the style needs to know 321 the previous state of the widget as well as the current one. This is 322 solved by updating dynamic properties on the widget every time the 323 function is called. 324 325 Transitions interrupting existing transitions should always be 326 smooth, so whenever a hover-transition is started on a pulsating 327 button, it uses the current frame of the pulse-animation as the 328 starting image for the hover transition. 329 332 330 */ 333 331 void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, 334 QPainter *painter, const QWidget *widget) const332 QPainter *painter, const QWidget *widget) const 335 333 { 336 334 QWindowsVistaStylePrivate *d = const_cast<QWindowsVistaStylePrivate*>(d_func()); … … 367 365 w->setProperty("_q_stylerect", w->rect()); 368 366 369 bool doTransition = ((state & State_Sunken) != (oldState & State_Sunken) || 367 bool doTransition = oldState && 368 ((state & State_Sunken) != (oldState & State_Sunken) || 370 369 (state & State_On) != (oldState & State_On) || 371 370 (state & State_MouseOver) != (oldState & State_MouseOver)); … … 395 394 QPainter startPainter(&startImage); 396 395 397 Animation *anim = d->widgetAnimation(widget);398 Transition *t = newTransition;396 QWindowsVistaAnimation *anim = d->widgetAnimation(widget); 397 QWindowsVistaTransition *t = new QWindowsVistaTransition; 399 398 t->setWidget(w); 400 399 … … 404 403 405 404 if (!anim) 406 drawPrimitive(element, &opt, &startPainter, 0); // Note that the widget pointer is intentionally 0405 proxy()->drawPrimitive(element, &opt, &startPainter, 0); // Note that the widget pointer is intentionally 0 407 406 else // this ensures that we do not recurse in the animation logic above 408 407 anim->paint(&startPainter, &opt); … … 418 417 QStyleOption opt2 = opt; 419 418 opt2.state = option->state; 420 drawPrimitive(element, &opt2, &endPainter, 0); // Note that the widget pointer is intentionally 0419 proxy()->drawPrimitive(element, &opt2, &endPainter, 0); // Note that the widget pointer is intentionally 0 421 420 // this ensures that we do not recurse in the animation logic above 422 421 t->setEndImage(endImage); … … 488 487 { 489 488 XPThemeData theme(d->treeViewHelper(), painter, QLatin1String("TREEVIEW")); 490 static const int decoration_size = 16; 489 static int decoration_size = 0; 490 if (theme.isValid() && !decoration_size) { 491 SIZE size; 492 pGetThemePartSize(theme.handle(), 0, TVP_HOTGLYPH, GLPS_OPENED, 0, TS_TRUE, &size); 493 decoration_size = qMax(size.cx, size.cy); 494 } 491 495 int mid_h = option->rect.x() + option->rect.width() / 2; 492 496 int mid_v = option->rect.y() + option->rect.height() / 2; … … 528 532 case PE_IndicatorRadioButton: 529 533 { 530 if ( Animation *a = d->widgetAnimation(widget)) {534 if (QWindowsVistaAnimation *a = d->widgetAnimation(widget)) { 531 535 a->paint(painter, option); 532 536 } else { 533 537 QWindowsXPStyle::drawPrimitive(element, option, painter, widget); 534 538 } 535 }536 break;537 538 case PE_IndicatorToolBarHandle:539 {540 XPThemeData theme;541 if (option->state & State_Horizontal)542 theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPER, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));543 else544 theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPERVERT, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2));545 d->drawBackground(theme);546 539 } 547 540 break; … … 646 639 } 647 640 if (panel->lineWidth > 0) 648 drawPrimitive(PE_FrameLineEdit, panel, painter, widget);641 proxy()->drawPrimitive(PE_FrameLineEdit, panel, painter, widget); 649 642 return; 650 643 } … … 652 645 653 646 case PE_FrameLineEdit: 654 if ( Animation *anim = d->widgetAnimation(widget)) {647 if (QWindowsVistaAnimation *anim = d->widgetAnimation(widget)) { 655 648 anim->paint(painter, option); 656 649 } else { … … 695 688 break; 696 689 690 case PE_IndicatorToolBarHandle: 691 { 692 XPThemeData theme; 693 QRect rect; 694 if (option->state & State_Horizontal) { 695 theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPER, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2)); 696 rect = option->rect.adjusted(0, 1, 0, -2); 697 rect.setWidth(4); 698 } else { 699 theme = XPThemeData(widget, painter, QLatin1String("REBAR"), RP_GRIPPERVERT, ETS_NORMAL, option->rect.adjusted(0, 1, -2, -2)); 700 rect = option->rect.adjusted(1, 0, -1, 0); 701 rect.setHeight(4); 702 } 703 theme.rect = rect; 704 d->drawBackground(theme); 705 } 706 break; 707 697 708 case PE_IndicatorToolBarSeparator: 698 709 { … … 721 732 const QStyleOptionViewItemV4 *vopt; 722 733 const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(widget); 723 bool newStyle = false; 724 725 if (const QListView *listview = qobject_cast<const QListView *>(widget)) { 726 if (listview->viewMode() == QListView::IconMode) 727 newStyle = true; 728 } else if (const QTreeView* treeview = qobject_cast<const QTreeView *>(widget)) { 729 newStyle = true; 730 } 734 bool newStyle = true; 735 736 if (qobject_cast<const QTableView*>(widget)) 737 newStyle = false; 738 731 739 if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) { 732 740 bool selected = vopt->state & QStyle::State_Selected; … … 865 873 866 874 /*! 867 868 \reimp 875 \internal 869 876 870 877 see drawPrimitive for comments on the animation support 871 872 878 */ 873 879 void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption *option, … … 924 930 QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); 925 931 QImage endImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); 926 Animation *anim = d->widgetAnimation(widget);932 QWindowsVistaAnimation *anim = d->widgetAnimation(widget); 927 933 928 934 QStyleOptionButton opt = *button; … … 930 936 931 937 startImage.fill(0); 932 Transition *t = newTransition;938 QWindowsVistaTransition *t = new QWindowsVistaTransition; 933 939 t->setWidget(w); 934 940 QPainter startPainter(&startImage); 935 941 936 942 if (!anim) { 937 drawControl(element, &opt, &startPainter, 0 /* Intentional */);943 proxy()->drawControl(element, &opt, &startPainter, 0 /* Intentional */); 938 944 } else { 939 945 anim->paint(&startPainter, &opt); … … 946 952 endImage.fill(0); 947 953 QPainter endPainter(&endImage); 948 drawControl(element, option, &endPainter, 0 /* Intentional */);954 proxy()->drawControl(element, option, &endPainter, 0 /* Intentional */); 949 955 t->setEndImage(endImage); 950 956 int duration = 0; … … 967 973 { 968 974 969 if ( Animation *anim = d->widgetAnimation(widget)) {975 if (QWindowsVistaAnimation *anim = d->widgetAnimation(widget)) { 970 976 anim->paint(painter, option); 971 977 } else { … … 994 1000 (state & State_Enabled) && (state & State_Active)) 995 1001 { 996 Animation *anim = d->widgetAnimation(widget);1002 QWindowsVistaAnimation *anim = d->widgetAnimation(widget); 997 1003 if (!anim && widget) { 998 1004 QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); … … 1001 1007 alternateImage.fill(0); 1002 1008 1003 Pulse *pulse = newPulse;1009 QWindowsVistaPulse *pulse = new QWindowsVistaPulse; 1004 1010 pulse->setWidget(const_cast<QWidget*>(widget)); 1005 1011 … … 1048 1054 QStyleOptionButton newBtn = *btn; 1049 1055 newBtn.rect = QStyle::visualRect(option->direction, option->rect, 1050 QRect(ir.right() - mbiw - 2, (option->rect.height()/2) - (mbih/2), 1056 QRect(ir.right() - mbiw - 2, 1057 option->rect.top() + (option->rect.height()/2) - (mbih/2), 1051 1058 mbiw + 1, mbih + 1)); 1052 drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget);1059 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); 1053 1060 } 1054 1061 return; … … 1073 1080 if (((progressbar->value() > 0 && d->transitionsEnabled()) || isIndeterminate)) { 1074 1081 if (!d->widgetAnimation(progressbar) && progressbar->value() < progressbar->maximum()) { 1075 Animation *a = newAnimation;1082 QWindowsVistaAnimation *a = new QWindowsVistaAnimation; 1076 1083 a->setWidget(const_cast<QWidget*>(widget)); 1077 1084 a->setStartTime(QTime::currentTime()); … … 1085 1092 XPThemeData theme(widget, painter, QLatin1String("PROGRESS"), vertical ? PP_FILLVERT : PP_FILL); 1086 1093 theme.rect = option->rect; 1087 bool reverse = bar->direction == Qt::LeftToRight && inverted || bar->direction == Qt::RightToLeft && !inverted;1094 bool reverse = (bar->direction == Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted); 1088 1095 QTime current = QTime::currentTime(); 1089 1096 1090 1097 if (isIndeterminate) { 1091 if ( Animation *a = d->widgetAnimation(widget)) {1098 if (QWindowsVistaAnimation *a = d->widgetAnimation(widget)) { 1092 1099 int glowSize = 120; 1093 1100 int animationWidth = glowSize * 2 + (vertical ? theme.rect.height() : theme.rect.width()); … … 1159 1166 d->drawBackground(theme); 1160 1167 1161 if ( Animation *a = d->widgetAnimation(widget)) {1168 if (QWindowsVistaAnimation *a = d->widgetAnimation(widget)) { 1162 1169 int glowSize = 140; 1163 1170 int animationWidth = glowSize * 2 + (vertical ? theme.rect.height() : theme.rect.width()); … … 1198 1205 1199 1206 QPalette::ColorRole textRole = disabled ? QPalette::Text : QPalette::ButtonText; 1200 QPixmap pix = mbi->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal);1207 QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal); 1201 1208 1202 1209 uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 1203 if (! styleHint(SH_UnderlineShortcut, mbi, widget))1210 if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) 1204 1211 alignment |= Qt::TextHideMnemonic; 1205 1212 1206 1213 //The rect adjustment is a workaround for the menu not really filling its background. 1207 XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 1, 2, 1));1214 XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_BARBACKGROUND, 0, option->rect.adjusted(-1, 0, 2, 1)); 1208 1215 d->drawBackground(theme); 1209 1216 … … 1230 1237 if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { 1231 1238 // windows always has a check column, regardless whether we have an icon or not 1232 int checkcol = qMax(menuitem->maxIconWidth, 28); 1239 int checkcol = 28; 1240 { 1241 SIZE size; 1242 MARGINS margins; 1243 XPThemeData theme(widget, 0, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND, MBI_HOT); 1244 pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size); 1245 pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins); 1246 checkcol = qMax(menuitem->maxIconWidth, int(6 + size.cx + margins.cxLeftWidth + margins.cxRightWidth)); 1247 } 1233 1248 QColor darkLine = option->palette.background().color().darker(108); 1234 1249 QColor lightLine = option->palette.background().color().lighter(107); … … 1255 1270 QPoint p1 = QPoint(x + checkcol, yoff); 1256 1271 QPoint p2 = QPoint(x + w + 6 , yoff); 1257 int stateId =stateId = MBI_HOT;1272 stateId = MBI_HOT; 1258 1273 QRect subRect(p1.x(), p1.y(), p2.x() - p1.x(), 6); 1259 1274 subRect = QStyle::visualRect(option->direction, option->rect, subRect ); … … 1267 1282 1268 1283 if (act) { 1269 int stateId =stateId = MBI_HOT;1284 stateId = MBI_HOT; 1270 1285 XPThemeData theme2(widget, painter, QLatin1String("MENU"), MENU_POPUPITEM, stateId, option->rect); 1271 1286 d->drawBackground(theme2); … … 1275 1290 XPThemeData theme(widget, painter, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND, 1276 1291 menuitem->icon.isNull() ? MBI_HOT : MBI_PUSHED, vCheckRect); 1292 SIZE size; 1293 MARGINS margins; 1294 pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size); 1295 pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, 1296 TMT_CONTENTMARGINS, NULL, &margins); 1297 QRect checkRect(0, 0, size.cx + margins.cxLeftWidth + margins.cxRightWidth , 1298 size.cy + margins.cyBottomHeight + margins.cyTopHeight); 1299 checkRect.moveCenter(vCheckRect.center()); 1300 theme.rect = checkRect; 1301 1277 1302 d->drawBackground(theme); 1303 1278 1304 if (menuitem->icon.isNull()) { 1305 checkRect = QRect(0, 0, size.cx, size.cy); 1306 checkRect.moveCenter(theme.rect.center()); 1307 theme.rect = checkRect; 1308 1279 1309 theme.partId = MENU_POPUPCHECK; 1280 1310 bool bullet = menuitem->checkType & QStyleOptionMenuItem::Exclusive; … … 1293 1323 QPixmap pixmap; 1294 1324 if (checked) 1295 pixmap = menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On);1325 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On); 1296 1326 else 1297 pixmap = menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), mode);1327 pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode); 1298 1328 int pixw = pixmap.width(); 1299 1329 int pixh = pixmap.height(); … … 1321 1351 int t = s.indexOf(QLatin1Char('\t')); 1322 1352 int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 1323 if (! styleHint(SH_UnderlineShortcut, menuitem, widget))1353 if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) 1324 1354 text_flags |= Qt::TextHideMnemonic; 1325 1355 text_flags |= Qt::AlignLeft; … … 1347 1377 newMI.rect = vSubMenuRect; 1348 1378 newMI.state = dis ? State_None : State_Enabled; 1349 drawPrimitive(arrow, &newMI, painter, widget);1379 proxy()->drawPrimitive(arrow, &newMI, painter, widget); 1350 1380 } 1351 1381 } … … 1372 1402 case CE_MenuBarEmptyArea: 1373 1403 { 1374 intstateId = MBI_NORMAL;1404 stateId = MBI_NORMAL; 1375 1405 if (!(state & State_Enabled)) 1376 1406 stateId = MBI_DISABLED; … … 1417 1447 1418 1448 int buttonMargin = 4; 1419 int mw = p ixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget);1420 int fw = p ixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget);1449 int mw = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget); 1450 int fw = proxy()->pixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget); 1421 1451 const QDockWidget *dw = qobject_cast<const QDockWidget *>(widget); 1422 1452 bool isFloating = dw != 0 && dw->isFloating(); … … 1437 1467 if (isFloating) { 1438 1468 titleRect.adjust(0, -fw, 0, 0); 1439 if (widget != 0 && widget->windowIcon().cacheKey() != qApp->windowIcon().cacheKey())1469 if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey()) 1440 1470 titleRect.adjust(titleRect.height() + mw, 0, 0, 0); 1441 1471 } else { … … 1464 1494 const QStyleOptionViewItemV4 *vopt; 1465 1495 const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(widget); 1466 bool newStyle = false; 1467 1468 if (const QListView *listview = qobject_cast<const QListView *>(widget)) { 1469 if (listview->viewMode() == QListView::IconMode) 1470 newStyle = true; 1471 } else if (const QTreeView* treeview = qobject_cast<const QTreeView *>(widget)) { 1472 newStyle = true; 1473 } 1496 bool newStyle = true; 1497 1498 if (qobject_cast<const QTableView*>(widget)) 1499 newStyle = false; 1500 1474 1501 if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) { 1475 1502 /* … … 1505 1532 1506 1533 /*! 1507 \ reimp1534 \internal 1508 1535 1509 1536 see drawPrimitive for comments on the animation support … … 1557 1584 if (qstyleoption_cast<const QStyleOptionSlider *>(option)) { 1558 1585 QRect oldSliderPos = w->property("_q_stylesliderpos").toRect(); 1559 QRect currentPos = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);1586 QRect currentPos = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 1560 1587 w->setProperty("_q_stylesliderpos", currentPos); 1561 1588 if (oldSliderPos != currentPos) { … … 1577 1604 QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); 1578 1605 QImage endImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied); 1579 Animation *anim = d->widgetAnimation(widget);1580 Transition *t = newTransition;1606 QWindowsVistaAnimation *anim = d->widgetAnimation(widget); 1607 QWindowsVistaTransition *t = new QWindowsVistaTransition; 1581 1608 t->setWidget(w); 1582 1609 if (!anim) { … … 1588 1615 startCombo.state = (QStyle::State)oldState; 1589 1616 startCombo.activeSubControls = (QStyle::SubControl)oldActiveControls; 1590 drawComplexControl(control, &startCombo, &startPainter, 0 /* Intentional */);1617 proxy()->drawComplexControl(control, &startCombo, &startPainter, 0 /* Intentional */); 1591 1618 t->setStartImage(startImage); 1592 1619 } else if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option)) { … … 1597 1624 startSlider.state = (QStyle::State)oldState; 1598 1625 startSlider.activeSubControls = (QStyle::SubControl)oldActiveControls; 1599 drawComplexControl(control, &startSlider, &startPainter, 0 /* Intentional */);1626 proxy()->drawComplexControl(control, &startSlider, &startPainter, 0 /* Intentional */); 1600 1627 t->setStartImage(startImage); 1601 1628 } else { … … 1615 1642 endImage.fill(0); 1616 1643 QPainter endPainter(&endImage); 1617 drawComplexControl(control, option, &endPainter, 0 /* Intentional */);1644 proxy()->drawComplexControl(control, option, &endPainter, 0 /* Intentional */); 1618 1645 t->setEndImage(endImage); 1619 1646 t->setStartTime(QTime::currentTime()); … … 1625 1652 } 1626 1653 1627 if ( Animation *anim = d->widgetAnimation(widget)) {1654 if (QWindowsVistaAnimation *anim = d->widgetAnimation(widget)) { 1628 1655 anim->paint(painter, option); 1629 1656 return; … … 1654 1681 } 1655 1682 if (sub & SC_ComboBoxArrow) { 1656 QRect subRect = subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);1683 QRect subRect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); 1657 1684 XPThemeData theme(widget, painter, QLatin1String("COMBOBOX")); 1658 theme.rect = sub ControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);1685 theme.rect = subRect; 1659 1686 partId = option->direction == Qt::RightToLeft ? CP_DROPDOWNBUTTONLEFT : CP_DROPDOWNBUTTONRIGHT; 1660 1687 … … 1680 1707 if (sub & SC_ComboBoxArrow) 1681 1708 btn.features = QStyleOptionButton::HasMenu; 1682 drawControl(QStyle::CE_PushButton, &btn, painter, widget);1709 proxy()->drawControl(QStyle::CE_PushButton, &btn, painter, widget); 1683 1710 } 1684 1711 } … … 1697 1724 bool isRTL = option->direction == Qt::RightToLeft; 1698 1725 if (sub & SC_ScrollBarAddLine) { 1699 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget);1726 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget); 1700 1727 partId = SBP_ARROWBTN; 1701 1728 if (!(flags & State_Enabled)) … … 1714 1741 } 1715 1742 if (sub & SC_ScrollBarSubLine) { 1716 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget);1743 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget); 1717 1744 partId = SBP_ARROWBTN; 1718 1745 if (!(flags & State_Enabled)) … … 1731 1758 } 1732 1759 if (maxedOut) { 1733 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);1734 theme.rect = theme.rect.united( subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget));1735 theme.rect = theme.rect.united( subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget));1760 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 1761 theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget)); 1762 theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget)); 1736 1763 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; 1737 1764 stateId = SCRBS_DISABLED; … … 1741 1768 } else { 1742 1769 if (sub & SC_ScrollBarSubPage) { 1743 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget);1770 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget); 1744 1771 partId = flags & State_Horizontal ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT; 1745 1772 if (!(flags & State_Enabled)) … … 1756 1783 } 1757 1784 if (sub & SC_ScrollBarAddPage) { 1758 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget);1785 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget); 1759 1786 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; 1760 1787 if (!(flags & State_Enabled)) … … 1771 1798 } 1772 1799 if (sub & SC_ScrollBarSlider) { 1773 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);1800 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 1774 1801 if (!(flags & State_Enabled)) 1775 1802 stateId = SCRBS_DISABLED; … … 1784 1811 1785 1812 // Draw handle 1786 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);1813 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 1787 1814 theme.partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT; 1788 1815 theme.stateId = stateId; … … 1852 1879 } 1853 1880 if (sub & SC_SpinBoxUp) { 1854 theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget).adjusted(0, 0, 0, 1);1881 theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget).adjusted(0, 0, 0, 1); 1855 1882 partId = SPNP_UP; 1856 1883 if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) || !(flags & State_Enabled)) … … 1867 1894 } 1868 1895 if (sub & SC_SpinBoxDown) { 1869 theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);1896 theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); 1870 1897 partId = SPNP_DOWN; 1871 1898 if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) || !(flags & State_Enabled)) … … 1891 1918 1892 1919 /*! 1893 \ reimp1920 \internal 1894 1921 */ 1895 1922 QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption *option, … … 1926 1953 case CT_MenuItem: 1927 1954 sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget); 1928 sz.rwidth() += 28; 1955 int minimumHeight; 1956 { 1957 SIZE size; 1958 MARGINS margins; 1959 XPThemeData theme(widget, 0, QLatin1String("MENU"), MENU_POPUPCHECKBACKGROUND, MBI_HOT); 1960 pGetThemePartSize(theme.handle(), NULL, MENU_POPUPCHECK, 0, NULL,TS_TRUE, &size); 1961 pGetThemeMargins(theme.handle(), NULL, MENU_POPUPCHECK, 0, TMT_CONTENTMARGINS, NULL, &margins); 1962 minimumHeight = qMax<qint32>(size.cy + margins.cyBottomHeight+ margins.cyTopHeight, sz.height()); 1963 sz.rwidth() += size.cx + margins.cxLeftWidth + margins.cxRightWidth; 1964 } 1965 1929 1966 if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { 1930 int minimumHeight = qMax<qint32>(22, sz.height());1931 1967 if (menuitem->menuItemType != QStyleOptionMenuItem::Separator) 1932 1968 sz.setHeight(minimumHeight); … … 1948 1984 //Spinbox adds frame twice 1949 1985 sz = QWindowsStyle::sizeFromContents(type, option, size, widget); 1950 int border = p ixelMetric(PM_SpinBoxFrameWidth, option, widget);1986 int border = proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget); 1951 1987 sz -= QSize(2*border, 2*border); 1952 1988 } … … 1959 1995 1960 1996 /*! 1961 \ reimp1997 \internal 1962 1998 */ 1963 1999 QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const … … 1974 2010 HTHEME theme = pOpenThemeData(widget ? QWindowsVistaStylePrivate::winId(widget) : 0, L"Button"); 1975 2011 if (theme) { 1976 int stateId ;2012 int stateId = PBS_NORMAL; 1977 2013 if (!(option->state & State_Enabled)) 1978 2014 stateId = PBS_DISABLED; … … 1983 2019 else if (btn->features & QStyleOptionButton::DefaultButton) 1984 2020 stateId = PBS_DEFAULTED; 1985 else 1986 stateId = PBS_NORMAL; 1987 1988 int border = pixelMetric(PM_DefaultFrameWidth, btn, widget); 2021 2022 int border = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget); 1989 2023 rect = option->rect.adjusted(border, border, -border, -border); 1990 2024 … … 2013 2047 int x = option->rect.x(); 2014 2048 int y = option->rect.y(); 2015 int margin = p ixelMetric(QStyle::PM_HeaderMargin, option, widget);2049 int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget); 2016 2050 2017 2051 XPThemeData theme(widget, 0, QLatin1String("HEADER"), HP_HEADERSORTARROW, HSAS_SORTEDDOWN, option->rect); … … 2039 2073 case SE_HeaderLabel: 2040 2074 { 2041 int margin = p ixelMetric(QStyle::PM_HeaderMargin, option, widget);2075 int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget); 2042 2076 QRect r = option->rect; 2043 2077 r.setRect(option->rect.x() + margin, option->rect.y() + margin, … … 2057 2091 break; 2058 2092 case SE_ItemViewItemDecoration: 2059 if ( const QStyleOptionViewItemV4 *vopt =qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))2093 if (qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) 2060 2094 rect.adjust(-2, 0, 2, 0); 2061 2095 break; … … 2130 2164 2131 2165 2132 /*! \ reimp*/2166 /*! \internal */ 2133 2167 int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, 2134 2168 QStyleHintReturn *returnData) const … … 2164 2198 2165 2199 /*! 2166 \ reimp2200 \internal 2167 2201 */ 2168 2202 QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, … … 2184 2218 int margin = cb->frame ? 3 : 0; 2185 2219 int bmarg = cb->frame ? 2 : 0; 2186 xpos += wi - bmarg - 16; 2220 int arrowButtonWidth = bmarg + 16; 2221 xpos += wi - arrowButtonWidth; 2187 2222 2188 2223 switch (subControl) { … … 2191 2226 break; 2192 2227 case SC_ComboBoxArrow: 2193 rect.setRect( cb->editable ? xpos : 0, y , wi - xpos, he);2228 rect.setRect(xpos, y , arrowButtonWidth, he); 2194 2229 break; 2195 2230 case SC_ComboBoxEditField: … … 2215 2250 int buttonWidth = GetSystemMetrics(SM_CXSIZE) - 4; 2216 2251 2217 const int frameWidth = p ixelMetric(PM_MdiSubWindowFrameWidth, option, widget);2252 const int frameWidth = proxy()->pixelMetric(PM_MdiSubWindowFrameWidth, option, widget); 2218 2253 const bool sysmenuHint = (tb->titleBarFlags & Qt::WindowSystemMenuHint) != 0; 2219 2254 const bool minimizeHint = (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) != 0; … … 2252 2287 const int controlTop = 6; 2253 2288 const int controlHeight = height - controlTop - 3; 2254 int iconExtent = p ixelMetric(PM_SmallIconSize);2289 int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); 2255 2290 QSize iconSize = tb->icon.actualSize(QSize(iconExtent, iconExtent)); 2256 2291 if (tb->icon.isNull()) … … 2263 2298 } 2264 2299 break; 2300 default: 2301 break; 2265 2302 } 2266 2303 } … … 2273 2310 2274 2311 /*! 2275 \ reimp2312 \internal 2276 2313 */ 2277 2314 bool QWindowsVistaStyle::event(QEvent *e) … … 2296 2333 2297 2334 /*! 2298 \ reimp2335 \internal 2299 2336 */ 2300 2337 QStyle::SubControl QWindowsVistaStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, … … 2308 2345 2309 2346 /*! 2310 \ reimp2347 \internal 2311 2348 */ 2312 2349 int QWindowsVistaStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const … … 2318 2355 2319 2356 case PM_DockWidgetTitleBarButtonMargin: 2320 return 5;2357 return int(QStyleHelper::dpiScaled(5.)); 2321 2358 case PM_ScrollBarSliderMin: 2322 return 18;2359 return int(QStyleHelper::dpiScaled(18.)); 2323 2360 case PM_MenuHMargin: 2324 2361 case PM_MenuVMargin: … … 2333 2370 2334 2371 /*! 2335 \ reimp2372 \internal 2336 2373 */ 2337 2374 QPalette QWindowsVistaStyle::standardPalette() const … … 2341 2378 2342 2379 /*! 2343 \ reimp2380 \internal 2344 2381 */ 2345 2382 void QWindowsVistaStyle::polish(QApplication *app) … … 2349 2386 2350 2387 /*! 2351 \ reimp2388 \internal 2352 2389 */ 2353 2390 void QWindowsVistaStyle::polish(QWidget *widget) … … 2397 2434 tree->viewport()->setAttribute(Qt::WA_Hover); 2398 2435 } 2436 else if (QListView *list = qobject_cast<QListView *> (widget)) { 2437 list->viewport()->setAttribute(Qt::WA_Hover); 2438 } 2399 2439 } 2400 2440 2401 2441 /*! 2402 \ reimp2442 \internal 2403 2443 */ 2404 2444 void QWindowsVistaStyle::unpolish(QWidget *widget) … … 2433 2473 tree->viewport()->setAttribute(Qt::WA_Hover, false); 2434 2474 } else if (qobject_cast<QCommandLinkButton*>(widget)) { 2435 QFont font = qApp->font("QCommandLinkButton");2475 QFont font = QApplication::font("QCommandLinkButton"); 2436 2476 QFont widgetFont = widget->font(); 2437 2477 widgetFont.setFamily(font.family()); //Only family set by polish … … 2442 2482 2443 2483 /*! 2444 \ reimp2484 \internal 2445 2485 */ 2446 2486 void QWindowsVistaStyle::unpolish(QApplication *app) … … 2450 2490 2451 2491 /*! 2452 \ reimp2492 \internal 2453 2493 */ 2454 2494 void QWindowsVistaStyle::polish(QPalette &pal) … … 2459 2499 2460 2500 /*! 2461 \ reimp2501 \internal 2462 2502 */ 2463 2503 QPixmap QWindowsVistaStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option, … … 2495 2535 !QWindowsVistaStylePrivate::useVista()) 2496 2536 { 2497 Animation *a = animations.takeAt(i);2537 QWindowsVistaAnimation *a = animations.takeAt(i); 2498 2538 delete a; 2499 2539 } … … 2508 2548 for (int i = animations.size() - 1 ; i >= 0 ; --i) { 2509 2549 if (animations[i]->widget() == w) { 2510 Animation *a = animations.takeAt(i);2550 QWindowsVistaAnimation *a = animations.takeAt(i); 2511 2551 delete a; 2512 2552 break; … … 2515 2555 } 2516 2556 2517 void QWindowsVistaStylePrivate::startAnimation( Animation *t)2557 void QWindowsVistaStylePrivate::startAnimation(QWindowsVistaAnimation *t) 2518 2558 { 2519 2559 Q_Q(QWindowsVistaStyle); … … 2528 2568 { 2529 2569 BOOL animEnabled = false; 2530 if (QT_WA_INLINE(SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0), 2531 SystemParametersInfoA(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0) 2532 )) 2570 if (SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0)) 2533 2571 { 2534 2572 if (animEnabled) … … 2539 2577 2540 2578 2541 Animation * QWindowsVistaStylePrivate::widgetAnimation(const QWidget *widget) const2579 QWindowsVistaAnimation * QWindowsVistaStylePrivate::widgetAnimation(const QWidget *widget) const 2542 2580 { 2543 2581 if (!widget) 2544 2582 return 0; 2545 foreach ( Animation *a, animations) {2583 foreach (QWindowsVistaAnimation *a, animations) { 2546 2584 if (a->widget() == widget) 2547 2585 return a; -
trunk/src/gui/styles/qwindowsvistastyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowsvistastyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 77 77 #include <qprogressbar.h> 78 78 #include <qdockwidget.h> 79 #include <qlistview.h> 79 80 #include <qtreeview.h> 80 81 #include <qtextedit.h> … … 84 85 #include <qtreeview.h> 85 86 #include <qlistview.h> 87 #include <qtableview.h> 86 88 #include <qbasictimer.h> 87 89 #include <qcommandlinkbutton.h> … … 135 137 #endif 136 138 137 class Animation139 class QWindowsVistaAnimation 138 140 { 139 141 public : 140 Animation() : _running(true) { }141 virtual ~ Animation() { }142 QWindowsVistaAnimation() : _running(true) { } 143 virtual ~QWindowsVistaAnimation() { } 142 144 QWidget * widget() const { return _widget; } 143 145 bool running() const { return _running; } … … 160 162 161 163 // Handles state transition animations 162 class Transition : publicAnimation164 class QWindowsVistaTransition : public QWindowsVistaAnimation 163 165 { 164 166 public : 165 Transition() :Animation() {}166 virtual ~ Transition() { }167 QWindowsVistaTransition() : QWindowsVistaAnimation() {} 168 virtual ~QWindowsVistaTransition() { } 167 169 void setDuration(int duration) { _duration = duration; } 168 170 void setStartImage(const QImage &image) { _primaryImage = image; } … … 175 177 176 178 // Handles pulse animations (default buttons) 177 class Pulse: publicAnimation179 class QWindowsVistaPulse: public QWindowsVistaAnimation 178 180 { 179 181 public : 180 Pulse() :Animation() {}181 virtual ~ Pulse() { }182 QWindowsVistaPulse() : QWindowsVistaAnimation() {} 183 virtual ~QWindowsVistaPulse() { } 182 184 void setDuration(int duration) { _duration = duration; } 183 185 void setPrimaryImage(const QImage &image) { _primaryImage = image; } … … 198 200 static bool resolveSymbols(); 199 201 static inline bool useVista(); 200 void startAnimation( Animation *);202 void startAnimation(QWindowsVistaAnimation *); 201 203 void stopAnimation(const QWidget *); 202 Animation* widgetAnimation(const QWidget *) const;204 QWindowsVistaAnimation* widgetAnimation(const QWidget *) const; 203 205 void timerEvent(); 204 206 bool transitionsEnabled() const; … … 206 208 207 209 private: 208 QList < Animation*> animations;210 QList <QWindowsVistaAnimation*> animations; 209 211 QBasicTimer animationTimer; 210 212 QWidget *m_treeViewHelper; -
trunk/src/gui/styles/qwindowsxpstyle.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 47 47 #include <private/qpaintengine_raster_p.h> 48 48 #include <private/qapplication_p.h> 49 #include <private/qstylehelper_p.h> 50 #include <private/qwidget_p.h> 49 51 #include <qlibrary.h> 50 52 #include <qpainter.h> … … 125 127 // General const values 126 128 static const int windowsItemFrame = 2; // menu item frame width 127 static const int windowsSepHeight = 9; // separator item height128 129 static const int windowsItemHMargin = 3; // menu item hor text margin 129 130 static const int windowsItemVMargin = 0; // menu item ver text margin 130 131 static const int windowsArrowHMargin = 6; // arrow horizontal margin 131 static const int windowsCheckMarkHMargin = 0; // horiz. margins of check mark132 132 static const int windowsRightBorder = 12; // right border on windows 133 133 134 134 // External function calls 135 135 extern Q_GUI_EXPORT HDC qt_win_display_dc(); 136 extern QRegion qt_region_from_HRGN(HRGN rgn); 136 137 137 138 … … 161 162 162 163 if (!htheme) { 163 htheme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), 164 (TCHAR*)name.utf16()); 164 htheme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), (wchar_t*)name.utf16()); 165 165 if (htheme) { 166 166 if (!QWindowsXPStylePrivate::handleMap) … … 261 261 cleanupHandleMap(); 262 262 if (limboWidget) { 263 if ( qApp->closingDown())263 if (QApplication::closingDown()) 264 264 delete limboWidget; 265 265 else … … 301 301 if (!limboWidget) { 302 302 limboWidget = new QWidget(0); 303 limboWidget->createWinId(); 303 304 limboWidget->setObjectName(QLatin1String("xp_limbo_widget")); 305 // We dont need this internal widget to appear in QApplication::topLevelWidgets() 306 if (QWidgetPrivate::allWidgets) 307 QWidgetPrivate::allWidgets->remove(limboWidget); 304 308 } 305 309 … … 446 450 } 447 451 452 448 453 /*! \internal 449 454 Returns a QRegion of the region of the part … … 457 462 return QRegion(); 458 463 459 QRegion rgn = QRegion(0,0,1,1); 460 const bool success = CombineRgn(rgn.handle(), hRgn, 0, RGN_COPY) != ERROR; 464 HRGN dest = CreateRectRgn(0, 0, 0, 0); 465 const bool success = CombineRgn(dest, hRgn, 0, RGN_COPY) != ERROR; 466 467 QRegion region; 468 469 if (success) 470 region = qt_region_from_HRGN(dest); 471 461 472 DeleteObject(hRgn); 462 if (success)463 return rgn; 464 return QRegion();473 DeleteObject(dest); 474 475 return region; 465 476 } 466 477 … … 581 592 register unsigned int alphaValue = (*buffer) & 0xFF000000; 582 593 if (alphaValue == 0xFF000000) { 583 *buffer &= 0x00FFFFFF;594 *buffer = 0; 584 595 valueChange = true; 585 596 } else if (alphaValue == 0) { … … 608 619 QPainter *painter = themeData.painter; 609 620 Q_ASSERT_X(painter != 0, "QWindowsXPStylePrivate::drawBackground()", "Trying to draw a theme part without a painter"); 610 if (!painter )621 if (!painter || !painter->isActive()) 611 622 return; 612 623 613 624 painter->save(); 614 625 615 QMatrix m = painter->matrix(); 616 bool complexXForm = m.m11() != 1.0 || m.m22() != 1.0 || m.m12() != 0.0 || m.m21() != 0.0; 626 bool complexXForm = painter->deviceTransform().type() > QTransform::TxTranslate; 627 628 bool translucentToplevel = false; 629 QPaintDevice *pdev = painter->device(); 630 if (pdev->devType() == QInternal::Widget) { 631 QWidget *win = ((QWidget *) pdev)->window(); 632 translucentToplevel = win->testAttribute(Qt::WA_TranslucentBackground); 633 } 617 634 618 635 bool useFallback = painter->paintEngine()->getDC() == 0 … … 621 638 || complexXForm 622 639 || themeData.mirrorVertically 623 || (themeData.mirrorHorizontally && pDrawThemeBackgroundEx == 0); 640 || (themeData.mirrorHorizontally && pDrawThemeBackgroundEx == 0) 641 || translucentToplevel; 642 624 643 if (!useFallback) 625 644 drawBackgroundDirectly(themeData); … … 1026 1045 QWindowsStyle, QCommonStyle, and QStyle, but the 1027 1046 QWindowsXPStyle overloads of drawComplexControl(), drawControl(), 1028 drawControlMask(), drawPrimitive(), subControlRect(), and1047 drawControlMask(), drawPrimitive(), proxy()->subControlRect(), and 1029 1048 sizeFromContents(), are documented here. 1030 1049 … … 1193 1212 otherOption.shape = (twfOption->shape == QTabBar::RoundedNorth 1194 1213 ? QTabBar::RoundedEast : QTabBar::RoundedSouth); 1195 int overlap = p ixelMetric(PM_TabBarBaseOverlap, &otherOption, widget);1196 int borderThickness = p ixelMetric(PM_DefaultFrameWidth, option, widget);1214 int overlap = proxy()->pixelMetric(PM_TabBarBaseOverlap, &otherOption, widget); 1215 int borderThickness = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); 1197 1216 rect.adjust(-overlap + borderThickness, 0, -overlap + borderThickness, 0); 1198 1217 } … … 1203 1222 MARGINS borderSize; 1204 1223 if (widget) { 1205 HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button"); 1224 XPThemeData buttontheme(widget, 0, QLatin1String("Button")); 1225 HTHEME theme = buttontheme.handle(); 1206 1226 if (theme) { 1207 1227 int stateId; … … 1217 1237 stateId = PBS_NORMAL; 1218 1238 1219 int border = p ixelMetric(PM_DefaultFrameWidth, btn, widget);1239 int border = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget); 1220 1240 rect = option->rect.adjusted(border, border, -border, -border); 1221 1241 … … 1533 1553 1534 1554 if (panel->lineWidth > 0) 1535 drawPrimitive(PE_FrameLineEdit, panel, p, widget);1555 proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget); 1536 1556 return; 1537 1557 } … … 1547 1567 bool useGradient = true; 1548 1568 const int maxlength = 256; 1549 WCHARthemeFileName[maxlength];1550 WCHARthemeColor[maxlength];1569 wchar_t themeFileName[maxlength]; 1570 wchar_t themeColor[maxlength]; 1551 1571 // Due to a a scaling issue with the XP Silver theme, tab gradients are not used with it 1552 1572 if (pGetCurrentThemeName(themeFileName, maxlength, themeColor, maxlength, NULL, 0) == S_OK) { 1553 WCHAR* offset;1573 wchar_t *offset = 0; 1554 1574 if ((offset = wcsrchr(themeFileName, QChar(QLatin1Char('\\')).unicode())) != NULL) { 1555 1575 offset++; … … 1562 1582 // code, when using the HDC directly.. 1563 1583 if (useGradient) { 1564 QStyleOptionTabWidgetFrame frameOpt = *tab;1584 QStyleOptionTabWidgetFrameV2 frameOpt = *tab; 1565 1585 frameOpt.rect = widget->rect(); 1566 1586 QRect contentsRect = subElementRect(SE_TabWidgetTabContents, &frameOpt, widget); … … 1618 1638 stateId = FS_INACTIVE; 1619 1639 1620 int fwidth = p ixelMetric(PM_DockWidgetFrameWidth, frm, widget);1640 int fwidth = proxy()->pixelMetric(PM_DockWidgetFrameWidth, frm, widget); 1621 1641 1622 1642 XPThemeData theme(widget, p, name, 0, stateId); … … 1792 1812 1793 1813 case PE_IndicatorToolBarSeparator: 1794 1814 if (option->rect.height() < 3) { 1815 // XP style requires a few pixels for the separator 1816 // to be visible. 1817 QWindowsStyle::drawPrimitive(pe, option, p, widget); 1818 return; 1819 } 1795 1820 name = QLatin1String("TOOLBAR"); 1796 1821 partId = TP_SEPARATOR; … … 1821 1846 button.QStyleOption::operator=(*option); 1822 1847 button.state &= ~State_MouseOver; 1823 drawPrimitive(PE_IndicatorCheckBox, &button, p, widget);1848 proxy()->drawPrimitive(PE_IndicatorCheckBox, &button, p, widget); 1824 1849 return; 1825 1850 } … … 1914 1939 name = QLatin1String("BUTTON"); 1915 1940 partId = BP_PUSHBUTTON; 1916 bool justFlat = ( btn->features & QStyleOptionButton::Flat) && !(flags & (State_On|State_Sunken))1917 || ( btn->features & QStyleOptionButton::CommandLinkButton1941 bool justFlat = ((btn->features & QStyleOptionButton::Flat) && !(flags & (State_On|State_Sunken))) 1942 || ((btn->features & QStyleOptionButton::CommandLinkButton) 1918 1943 && !(flags & State_MouseOver) 1919 1944 && !(btn->features & QStyleOptionButton::DefaultButton)); … … 1949 1974 QStyleOptionButton newBtn = *btn; 1950 1975 newBtn.rect = QRect(ir.right() - mbiw - 1, 1 + (ir.height()/2) - (mbih/2), mbiw, mbih); 1951 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);1976 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 1952 1977 } 1953 1978 return; … … 1972 1997 bool firstTab = tab->position == QStyleOptionTab::Beginning; 1973 1998 bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab; 1974 bool leftAligned = styleHint(SH_TabBar_Alignment, tab, widget) == Qt::AlignLeft;1975 bool centerAligned = styleHint(SH_TabBar_Alignment, tab, widget) == Qt::AlignCenter;1976 int borderThickness = p ixelMetric(PM_DefaultFrameWidth, option, widget);1977 int tabOverlap = p ixelMetric(PM_TabBarTabOverlap, option, widget);1999 bool leftAligned = proxy()->styleHint(SH_TabBar_Alignment, tab, widget) == Qt::AlignLeft; 2000 bool centerAligned = proxy()->styleHint(SH_TabBar_Alignment, tab, widget) == Qt::AlignCenter; 2001 int borderThickness = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); 2002 int tabOverlap = proxy()->pixelMetric(PM_TabBarTabOverlap, option, widget); 1978 2003 1979 2004 if (isDisabled) … … 2120 2145 mode = QIcon::Active; 2121 2146 QPixmap pixmap = checked ? 2122 menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On) :2123 menuitem->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), mode);2147 menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode, QIcon::On) : 2148 menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), mode); 2124 2149 int pixw = pixmap.width(); 2125 2150 int pixh = pixmap.height(); … … 2147 2172 menuitem->rect.height() - 2*windowsItemFrame); 2148 2173 newMi.rect = visualRect(option->direction, option->rect, checkMarkRect); 2149 drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget);2174 proxy()->drawPrimitive(PE_IndicatorMenuCheckMark, &newMi, p, widget); 2150 2175 } 2151 2176 … … 2164 2189 int t = s.indexOf(QLatin1Char('\t')); 2165 2190 int text_flags = Qt::AlignVCenter|Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine | Qt::AlignLeft; 2166 if (! styleHint(SH_UnderlineShortcut, menuitem, widget))2191 if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) 2167 2192 text_flags |= Qt::TextHideMnemonic; 2168 2193 // draw tab text ---------------- 2169 2194 if (t >= 0) { 2170 2195 QRect vShortcutRect = visualRect(option->direction, option->rect, QRect(textRect.topRight(), menuitem->rect.bottomRight())); 2171 if (dis && !act && styleHint(SH_EtchDisabledText, option, widget)) {2196 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { 2172 2197 p->setPen(menuitem->palette.light().color()); 2173 2198 p->drawText(vShortcutRect.adjusted(1,1,1,1), text_flags, s.mid(t + 1)); … … 2181 2206 font.setBold(true); 2182 2207 p->setFont(font); 2183 if (dis && !act && styleHint(SH_EtchDisabledText, option, widget)) {2208 if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) { 2184 2209 p->setPen(menuitem->palette.light().color()); 2185 2210 p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t)); … … 2202 2227 if (act) 2203 2228 newMI.palette.setColor(QPalette::ButtonText, newMI.palette.highlightedText().color()); 2204 drawPrimitive(arrow, &newMI, p, widget);2229 proxy()->drawPrimitive(arrow, &newMI, p, widget); 2205 2230 } 2206 2231 } … … 2219 2244 QPalette::ColorRole textRole = dis ? QPalette::Text: 2220 2245 act ? QPalette::HighlightedText : QPalette::ButtonText; 2221 QPixmap pix = mbi->icon.pixmap(p ixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal);2246 QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal); 2222 2247 2223 2248 uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; 2224 if (! styleHint(SH_UnderlineShortcut, mbi, widget))2249 if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)) 2225 2250 alignment |= Qt::TextHideMnemonic; 2226 2251 … … 2237 2262 { 2238 2263 int buttonMargin = 4; 2239 int mw = p ixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget);2240 int fw = p ixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget);2264 int mw = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget); 2265 int fw = proxy()->pixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget); 2241 2266 bool isFloating = widget && widget->isWindow(); 2242 2267 bool isActive = dwOpt->state & State_Active; … … 2259 2284 2260 2285 if (dwOpt->closable) { 2261 QSize sz = standardIcon(QStyle::SP_TitleBarCloseButton, dwOpt, widget).actualSize(QSize(10, 10));2286 QSize sz = proxy()->standardIcon(QStyle::SP_TitleBarCloseButton, dwOpt, widget).actualSize(QSize(10, 10)); 2262 2287 titleRect.adjust(0, 0, -sz.width() - mw - buttonMargin, 0); 2263 2288 } 2264 2289 2265 2290 if (dwOpt->floatable) { 2266 QSize sz = standardIcon(QStyle::SP_TitleBarMaxButton, dwOpt, widget).actualSize(QSize(10, 10));2291 QSize sz = proxy()->standardIcon(QStyle::SP_TitleBarMaxButton, dwOpt, widget).actualSize(QSize(10, 10)); 2267 2292 titleRect.adjust(0, 0, -sz.width() - mw - buttonMargin, 0); 2268 2293 } … … 2270 2295 if (isFloating) { 2271 2296 titleRect.adjust(0, -fw, 0, 0); 2272 if (widget != 0 && widget->windowIcon().cacheKey() != qApp->windowIcon().cacheKey())2297 if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey()) 2273 2298 titleRect.adjust(titleRect.height() + mw, 0, 0, 0); 2274 2299 } else { … … 2317 2342 2318 2343 QIcon ico = widget->windowIcon(); 2319 bool hasIcon = (ico.cacheKey() != qApp->windowIcon().cacheKey());2344 bool hasIcon = (ico.cacheKey() != QApplication::windowIcon().cacheKey()); 2320 2345 if (hasIcon) { 2321 2346 QPixmap pxIco = ico.pixmap(titleHeight); 2322 if (!verticalTitleBar && QApplication::layoutDirection()== Qt::RightToLeft)2347 if (!verticalTitleBar && dwOpt->direction == Qt::RightToLeft) 2323 2348 p->drawPixmap(rect.width() - titleHeight - pxIco.width(), rect.bottom() - titleHeight - 2, pxIco); 2324 2349 else … … 2450 2475 } 2451 2476 if (sub & SC_SpinBoxUp) { 2452 theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget);2477 theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); 2453 2478 partId = SPNP_UP; 2454 2479 if (!(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) || !(flags & State_Enabled)) … … 2465 2490 } 2466 2491 if (sub & SC_SpinBoxDown) { 2467 theme.rect = subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget);2492 theme.rect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); 2468 2493 partId = SPNP_DOWN; 2469 2494 if (!(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) || !(flags & State_Enabled)) … … 2502 2527 } 2503 2528 if (!cmb->editable) { 2504 QRect re = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget);2529 QRect re = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget); 2505 2530 if (option->state & State_HasFocus) { 2506 2531 p->fillRect(re, option->palette.highlight()); … … 2517 2542 if (sub & SC_ComboBoxArrow) { 2518 2543 XPThemeData theme(widget, p, QLatin1String("COMBOBOX")); 2519 theme.rect = subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget);2544 theme.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget); 2520 2545 partId = CP_DROPDOWNBUTTON; 2521 2546 if (!(flags & State_Enabled)) … … 2545 2570 bool isRTL = option->direction == Qt::RightToLeft; 2546 2571 if (sub & SC_ScrollBarAddLine) { 2547 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget);2572 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddLine, widget); 2548 2573 partId = SBP_ARROWBTN; 2549 2574 if (!(flags & State_Enabled)) … … 2560 2585 } 2561 2586 if (sub & SC_ScrollBarSubLine) { 2562 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget);2587 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubLine, widget); 2563 2588 partId = SBP_ARROWBTN; 2564 2589 if (!(flags & State_Enabled)) … … 2575 2600 } 2576 2601 if (maxedOut) { 2577 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);2578 theme.rect = theme.rect.united( subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget));2579 theme.rect = theme.rect.united( subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget));2602 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 2603 theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget)); 2604 theme.rect = theme.rect.united(proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget)); 2580 2605 partId = scrollbar->orientation == Qt::Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; 2581 2606 stateId = SCRBS_DISABLED; … … 2585 2610 } else { 2586 2611 if (sub & SC_ScrollBarSubPage) { 2587 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget);2612 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSubPage, widget); 2588 2613 partId = flags & State_Horizontal ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT; 2589 2614 if (!(flags & State_Enabled)) … … 2600 2625 } 2601 2626 if (sub & SC_ScrollBarAddPage) { 2602 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget);2627 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarAddPage, widget); 2603 2628 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; 2604 2629 if (!(flags & State_Enabled)) … … 2615 2640 } 2616 2641 if (sub & SC_ScrollBarSlider) { 2617 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);2642 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 2618 2643 if (!(flags & State_Enabled)) 2619 2644 stateId = SCRBS_DISABLED; … … 2626 2651 2627 2652 // Draw handle 2628 theme.rect = subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget);2653 theme.rect = proxy()->subControlRect(CC_ScrollBar, option, SC_ScrollBarSlider, widget); 2629 2654 theme.partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT; 2630 2655 theme.stateId = stateId; … … 2661 2686 if (!gripperBounds.isEmpty()) { 2662 2687 p->save(); 2663 XPThemeData grippBackground = theme;2664 grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;2665 2688 theme.rect = gripperBounds; 2666 2689 p->setClipRegion(d->region(theme));// Only change inside the region of the gripper 2667 d->drawBackground(grippBackground);// The gutter is the grippers background2668 2690 d->drawBackground(theme); // Transparent gripper ontop of background 2669 2691 p->restore(); … … 2682 2704 QRegion tickreg = slrect; 2683 2705 if (sub & SC_SliderGroove) { 2684 theme.rect = subControlRect(CC_Slider, option, SC_SliderGroove, widget);2706 theme.rect = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); 2685 2707 if (slider->orientation == Qt::Horizontal) { 2686 2708 partId = TKP_TRACK; … … 2698 2720 } 2699 2721 if (sub & SC_SliderTickmarks) { 2700 int tickOffset = p ixelMetric(PM_SliderTickmarkOffset, slider, widget);2722 int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); 2701 2723 int ticks = slider->tickPosition; 2702 int thickness = p ixelMetric(PM_SliderControlThickness, slider, widget);2703 int len = p ixelMetric(PM_SliderLength, slider, widget);2704 int available = p ixelMetric(PM_SliderSpaceAvailable, slider, widget);2724 int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); 2725 int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); 2726 int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); 2705 2727 int interval = slider->tickInterval; 2706 2728 if (interval <= 0) { … … 2758 2780 } 2759 2781 if (sub & SC_SliderHandle) { 2760 theme.rect = subControlRect(CC_Slider, option, SC_SliderHandle, widget);2782 theme.rect = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); 2761 2783 if (slider->orientation == Qt::Horizontal) { 2762 2784 if (slider->tickPosition == QSlider::TicksAbove) … … 2804 2826 fropt.QStyleOption::operator=(*slider); 2805 2827 fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); 2806 drawPrimitive(PE_FrameFocusRect, &fropt, p, widget);2828 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, p, widget); 2807 2829 } 2808 2830 } … … 2814 2836 = qstyleoption_cast<const QStyleOptionToolButton *>(option)) { 2815 2837 QRect button, menuarea; 2816 button = subControlRect(cc, toolbutton, SC_ToolButton, widget);2817 menuarea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget);2838 button = proxy()->subControlRect(cc, toolbutton, SC_ToolButton, widget); 2839 menuarea = proxy()->subControlRect(cc, toolbutton, SC_ToolButtonMenu, widget); 2818 2840 2819 2841 State bflags = toolbutton->state & ~State_Sunken; 2820 2842 State mflags = bflags; 2821 2822 if ( bflags & State_AutoRaise) {2843 bool autoRaise = flags & State_AutoRaise; 2844 if (autoRaise) { 2823 2845 if (!(bflags & State_MouseOver) || !(bflags & State_Enabled)) { 2824 2846 bflags &= ~State_Raised; … … 2835 2857 } 2836 2858 } 2837 2859 2838 2860 QStyleOption tool(0); 2839 2861 tool.palette = toolbutton->palette; 2840 2862 if (toolbutton->subControls & SC_ToolButton) { 2841 if (flags & (State_Sunken | State_On | State_Raised) || ! (flags & State_AutoRaise)) {2842 if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup ) {2863 if (flags & (State_Sunken | State_On | State_Raised) || !autoRaise) { 2864 if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup && autoRaise) { 2843 2865 XPThemeData theme(widget, p, QLatin1String("TOOLBAR")); 2844 2866 theme.partId = TP_SPLITBUTTON; … … 2859 2881 d->drawBackground(theme); 2860 2882 } else { 2861 tool.rect = button;2883 tool.rect = option->rect; 2862 2884 tool.state = bflags; 2863 if (widget && !qobject_cast<QToolBar*>(widget->parentWidget()) 2864 && !(bflags & State_AutoRaise)) 2865 drawPrimitive(PE_PanelButtonBevel, &tool, p, widget); 2885 if (autoRaise) // for tool bars 2886 proxy()->drawPrimitive(PE_PanelButtonTool, &tool, p, widget); 2866 2887 else 2867 drawPrimitive(PE_PanelButtonTool, &tool, p, widget);2888 proxy()->drawPrimitive(PE_PanelButtonBevel, &tool, p, widget); 2868 2889 } 2869 2890 } … … 2875 2896 fr.rect.adjust(3, 3, -3, -3); 2876 2897 if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup) 2877 fr.rect.adjust(0, 0, -p ixelMetric(QStyle::PM_MenuButtonIndicator,2898 fr.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, 2878 2899 toolbutton, widget), 0); 2879 drawPrimitive(PE_FrameFocusRect, &fr, p, widget);2900 proxy()->drawPrimitive(PE_FrameFocusRect, &fr, p, widget); 2880 2901 } 2881 2902 QStyleOptionToolButton label = *toolbutton; 2882 2903 label.state = bflags; 2883 2904 int fw = 2; 2905 if (!autoRaise) 2906 label.state &= ~State_Sunken; 2884 2907 label.rect = button.adjusted(fw, fw, -fw, -fw); 2885 drawControl(CE_ToolButtonLabel, &label, p, widget);2908 proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget); 2886 2909 2887 2910 if (toolbutton->subControls & SC_ToolButtonMenu) { 2888 2911 tool.rect = menuarea; 2889 2912 tool.state = mflags; 2890 drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget); 2913 if (autoRaise) { 2914 proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, p, widget); 2915 } else { 2916 tool.state = mflags; 2917 menuarea.adjust(-2, 0, 0, 0); 2918 // Draw menu button 2919 if ((bflags & State_Sunken) != (mflags & State_Sunken)){ 2920 p->save(); 2921 p->setClipRect(menuarea); 2922 tool.rect = option->rect; 2923 proxy()->drawPrimitive(PE_PanelButtonBevel, &tool, p, 0); 2924 p->restore(); 2925 } 2926 // Draw arrow 2927 p->save(); 2928 p->setPen(option->palette.dark().color()); 2929 p->drawLine(menuarea.left(), menuarea.top() + 3, 2930 menuarea.left(), menuarea.bottom() - 3); 2931 p->setPen(option->palette.light().color()); 2932 p->drawLine(menuarea.left() - 1, menuarea.top() + 3, 2933 menuarea.left() - 1, menuarea.bottom() - 3); 2934 2935 tool.rect = menuarea.adjusted(2, 3, -2, -1); 2936 proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, p, widget); 2937 p->restore(); 2938 } 2891 2939 } else if (toolbutton->features & QStyleOptionToolButton::HasMenu) { 2892 int mbi = p ixelMetric(PM_MenuButtonIndicator, toolbutton, widget);2940 int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolbutton, widget); 2893 2941 QRect ir = toolbutton->rect; 2894 2942 QStyleOptionToolButton newBtn = *toolbutton; 2895 2943 newBtn.rect = QRect(ir.right() + 4 - mbi, ir.height() - mbi + 4, mbi - 5, mbi - 5); 2896 drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget);2944 proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, widget); 2897 2945 } 2898 2946 } … … 2926 2974 d->drawBackground(theme); 2927 2975 2928 QRect ir = subControlRect(CC_TitleBar, tb, SC_TitleBarLabel, widget);2976 QRect ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarLabel, widget); 2929 2977 2930 2978 int result = TST_NONE; … … 2945 2993 } 2946 2994 if (sub & SC_TitleBarSysMenu && tb->titleBarFlags & Qt::WindowSystemMenuHint) { 2947 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarSysMenu, widget);2995 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarSysMenu, widget); 2948 2996 partId = WP_SYSBUTTON; 2949 2997 if ((widget && !widget->isEnabled()) || !isActive) … … 2963 3011 pGetThemePartSize(theme.handle(), qt_win_display_dc(), theme.partId, theme.stateId, 0, TS_TRUE, &sz); 2964 3012 if (sz.cx == 0 || sz.cy == 0) { 2965 int iconSize = p ixelMetric(PM_SmallIconSize, tb, widget);2966 QPixmap pm = standardIcon(SP_TitleBarMenuButton, tb, widget).pixmap(iconSize, iconSize);3013 int iconSize = proxy()->pixelMetric(PM_SmallIconSize, tb, widget); 3014 QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, tb, widget).pixmap(iconSize, iconSize); 2967 3015 p->save(); 2968 3016 drawItemPixmap(p, theme.rect, Qt::AlignCenter, pm); … … 2976 3024 if (sub & SC_TitleBarMinButton && tb->titleBarFlags & Qt::WindowMinimizeButtonHint 2977 3025 && !(tb->titleBarState & Qt::WindowMinimized)) { 2978 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarMinButton, widget);3026 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarMinButton, widget); 2979 3027 partId = WP_MINBUTTON; 2980 3028 if (widget && !widget->isEnabled()) … … 2994 3042 if (sub & SC_TitleBarMaxButton && tb->titleBarFlags & Qt::WindowMaximizeButtonHint 2995 3043 && !(tb->titleBarState & Qt::WindowMaximized)) { 2996 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarMaxButton, widget);3044 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarMaxButton, widget); 2997 3045 partId = WP_MAXBUTTON; 2998 3046 if (widget && !widget->isEnabled()) … … 3012 3060 if (sub & SC_TitleBarContextHelpButton 3013 3061 && tb->titleBarFlags & Qt::WindowContextHelpButtonHint) { 3014 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarContextHelpButton, widget);3062 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarContextHelpButton, widget); 3015 3063 partId = WP_HELPBUTTON; 3016 3064 if (widget && !widget->isEnabled()) … … 3034 3082 && (tb->titleBarState & Qt::WindowMaximized))); 3035 3083 if (drawNormalButton) { 3036 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarNormalButton, widget);3084 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarNormalButton, widget); 3037 3085 partId = WP_RESTOREBUTTON; 3038 3086 if (widget && !widget->isEnabled()) … … 3052 3100 if (sub & SC_TitleBarShadeButton && tb->titleBarFlags & Qt::WindowShadeButtonHint 3053 3101 && !(tb->titleBarState & Qt::WindowMinimized)) { 3054 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarShadeButton, widget);3102 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarShadeButton, widget); 3055 3103 partId = WP_MINBUTTON; 3056 3104 if (widget && !widget->isEnabled()) … … 3070 3118 if (sub & SC_TitleBarUnshadeButton && tb->titleBarFlags & Qt::WindowShadeButtonHint 3071 3119 && tb->titleBarState & Qt::WindowMinimized) { 3072 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarUnshadeButton, widget);3120 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarUnshadeButton, widget); 3073 3121 partId = WP_RESTOREBUTTON; 3074 3122 if (widget && !widget->isEnabled()) … … 3087 3135 } 3088 3136 if (sub & SC_TitleBarCloseButton && tb->titleBarFlags & Qt::WindowSystemMenuHint) { 3089 theme.rect = subControlRect(CC_TitleBar, option, SC_TitleBarCloseButton, widget);3137 theme.rect = proxy()->subControlRect(CC_TitleBar, option, SC_TitleBarCloseButton, widget); 3090 3138 //partId = titlebar->testWFlags(Qt::WA_WState_Tool) ? WP_SMALLCLOSEBUTTON : WP_CLOSEBUTTON; 3091 3139 partId = WP_CLOSEBUTTON; … … 3115 3163 3116 3164 if (option->subControls & SC_MdiCloseButton) { 3117 buttonRect = subControlRect(CC_MdiControls, option, SC_MdiCloseButton, widget);3165 buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiCloseButton, widget); 3118 3166 if (theme.isValid()) { 3119 3167 theme.partId = WP_MDICLOSEBUTTON; … … 3131 3179 } 3132 3180 if (option->subControls & SC_MdiNormalButton) { 3133 buttonRect = subControlRect(CC_MdiControls, option, SC_MdiNormalButton, widget);3181 buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiNormalButton, widget); 3134 3182 if (theme.isValid()) { 3135 3183 theme.partId = WP_MDIRESTOREBUTTON; … … 3147 3195 } 3148 3196 if (option->subControls & QStyle::SC_MdiMinButton) { 3149 buttonRect = subControlRect(CC_MdiControls, option, SC_MdiMinButton, widget);3197 buttonRect = proxy()->subControlRect(CC_MdiControls, option, SC_MdiMinButton, widget); 3150 3198 if (theme.isValid()) { 3151 3199 theme.partId = WP_MDIMINBUTTON; … … 3165 3213 break; 3166 3214 #endif //QT_NO_WORKSPACE 3215 #ifndef QT_NO_DIAL 3216 case CC_Dial: 3217 if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option)) 3218 QStyleHelper::drawDial(dial, p); 3219 break; 3220 #endif // QT_NO_DIAL 3167 3221 default: 3168 3222 QWindowsStyle::drawComplexControl(cc, option, p, widget); … … 3224 3278 3225 3279 case PM_SplitterWidth: 3226 res = qMax( 5, QApplication::globalStrut().width());3280 res = qMax(int(QStyleHelper::dpiScaled(5.)), QApplication::globalStrut().width()); 3227 3281 break; 3228 3282 … … 3234 3288 SIZE size; 3235 3289 pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); 3236 res = (pm == PM_IndicatorWidth ? size.cx+2 : res = size.cy+2);3290 res = (pm == PM_IndicatorWidth) ? size.cx : size.cy; 3237 3291 } 3238 3292 } … … 3246 3300 SIZE size; 3247 3301 pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); 3248 res = (pm == PM_ExclusiveIndicatorWidth ? size.cx+2 : res = size.cy+2);3302 res = (pm == PM_ExclusiveIndicatorWidth) ? size.cx : size.cy; 3249 3303 } 3250 3304 } … … 3272 3326 pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); 3273 3327 res = size.cy; 3274 }3275 }3276 break;3277 3278 case PM_MenuButtonIndicator:3279 {3280 XPThemeData theme(widget, 0, QLatin1String("TOOLBAR"), TP_SPLITBUTTONDROPDOWN);3281 if (theme.isValid()) {3282 SIZE size;3283 pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);3284 res = size.cx;3285 3328 } 3286 3329 } … … 3318 3361 #ifndef QT_NO_TOOLBAR 3319 3362 case PM_ToolBarHandleExtent: 3320 res = 8;3363 res = int(QStyleHelper::dpiScaled(8.)); 3321 3364 break; 3322 3365 … … 3333 3376 break; 3334 3377 case PM_DockWidgetSeparatorExtent: 3335 res = 4;3378 res = int(QStyleHelper::dpiScaled(4.)); 3336 3379 break; 3337 3380 case PM_DockWidgetTitleMargin: 3338 res = 4;3381 res = int(QStyleHelper::dpiScaled(4.)); 3339 3382 break; 3340 3383 … … 3345 3388 else 3346 3389 res = 0; 3390 break; 3391 3392 case PM_ButtonDefaultIndicator: 3393 res = 0; 3347 3394 break; 3348 3395 … … 3428 3475 const int delta = buttonWidth + 2; 3429 3476 int controlTop = option->rect.bottom() - buttonHeight - 2; 3430 const int frameWidth = p ixelMetric(PM_MdiSubWindowFrameWidth, option, widget);3477 const int frameWidth = proxy()->pixelMetric(PM_MdiSubWindowFrameWidth, option, widget); 3431 3478 const bool sysmenuHint = (tb->titleBarFlags & Qt::WindowSystemMenuHint) != 0; 3432 3479 const bool minimizeHint = (tb->titleBarFlags & Qt::WindowMinimizeButtonHint) != 0; … … 3513 3560 const int controlTop = 6; 3514 3561 const int controlHeight = height - controlTop - 3; 3515 const int iconExtent = p ixelMetric(PM_SmallIconSize);3562 const int iconExtent = proxy()->pixelMetric(PM_SmallIconSize); 3516 3563 QSize iconSize = tb->icon.actualSize(QSize(iconExtent, iconExtent)); 3517 3564 if (tb->icon.isNull()) … … 3522 3569 } 3523 3570 break; 3571 default: 3572 break; 3524 3573 } 3525 3574 } … … 3547 3596 case SC_ComboBoxListBoxPopup: 3548 3597 rect = cmb->rect; 3598 break; 3599 3600 default: 3549 3601 break; 3550 3602 } … … 3612 3664 case CT_ComboBox: 3613 3665 { 3614 HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button"); 3666 XPThemeData buttontheme(widget, 0, QLatin1String("Button")); 3667 HTHEME theme = buttontheme.handle(); 3615 3668 MARGINS borderSize; 3616 3669 if (theme) { … … 3634 3687 //Spinbox adds frame twice 3635 3688 sz = QWindowsStyle::sizeFromContents(ct, option, contentsSize, widget); 3636 int border = p ixelMetric(PM_SpinBoxFrameWidth, option, widget);3689 int border = proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget); 3637 3690 sz -= QSize(2*border, 2*border); 3638 3691 } … … 3727 3780 const QStyleOptionTitleBar *titlebar = qstyleoption_cast<const QStyleOptionTitleBar *>(option); 3728 3781 if (mask && titlebar) { 3782 // Note certain themes will not return the whole window frame but only the titlebar part when 3783 // queried This function needs to return the entire window mask, hence we will only fetch the mask for the 3784 // titlebar itself and add the remaining part of the window rect at the bottom. 3785 int tbHeight = proxy()->pixelMetric(PM_TitleBarHeight, option, widget); 3786 QRect titleBarRect = option->rect; 3787 titleBarRect.setHeight(tbHeight); 3729 3788 XPThemeData themeData; 3730 3789 if (titlebar->titleBarState & Qt::WindowMinimized) { 3731 themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_MINCAPTION, CS_ACTIVE, option->rect);3790 themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_MINCAPTION, CS_ACTIVE, titleBarRect); 3732 3791 } else 3733 themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_CAPTION, CS_ACTIVE, option->rect); 3734 mask->region = d->region(themeData); 3792 themeData = XPThemeData(widget, 0, QLatin1String("WINDOW"), WP_CAPTION, CS_ACTIVE, titleBarRect); 3793 mask->region = d->region(themeData) + 3794 QRect(0, tbHeight, option->rect.width(), option->rect.height() - tbHeight); 3735 3795 } 3736 3796 } … … 3787 3847 } 3788 3848 } 3849 break; 3850 default: 3789 3851 break; 3790 3852 } … … 3909 3971 } 3910 3972 break; 3973 default: 3974 break; 3911 3975 } 3912 3976 -
trunk/src/gui/styles/qwindowsxpstyle.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/qwindowsxpstyle_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/styles/styles.pri
r2 r561 8 8 styles/qcommonstylepixmaps_p.h \ 9 9 styles/qcommonstyle.h \ 10 styles/qstylehelper_p.h \ 11 styles/qproxystyle.h \ 12 styles/qproxystyle_p.h \ 10 13 styles/qstylesheetstyle_p.h 14 11 15 SOURCES += \ 12 16 styles/qstyle.cpp \ … … 14 18 styles/qstyleoption.cpp \ 15 19 styles/qstyleplugin.cpp \ 20 styles/qstylehelper.cpp \ 16 21 styles/qcommonstyle.cpp \ 22 styles/qproxystyle.cpp \ 17 23 styles/qstylesheetstyle.cpp \ 18 24 styles/qstylesheetstyle_default.cpp … … 32 38 x11{ 33 39 QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE 34 LIBS += $$QT_LIBS_QGTKSTYLE40 LIBS_PRIVATE += $$QT_LIBS_QGTKSTYLE 35 41 styles += gtk 36 42 } … … 104 110 HEADERS += styles/qgtkstyle.h 105 111 HEADERS += styles/qgtkpainter_p.h 106 HEADERS += styles/ gtksymbols_p.h112 HEADERS += styles/qgtkstyle_p.h 107 113 SOURCES += styles/qgtkstyle.cpp 108 114 SOURCES += styles/qgtkpainter.cpp 109 SOURCES += styles/ gtksymbols.cpp115 SOURCES += styles/qgtkstyle_p.cpp 110 116 !contains( styles, cleanlooks ) { 111 117 styles += cleanlooks … … 156 162 } 157 163 164 contains( styles, s60 ):contains(QT_CONFIG, s60) { 165 HEADERS += \ 166 styles/qs60style.h \ 167 styles/qs60style_p.h 168 SOURCES += styles/qs60style.cpp 169 symbian { 170 SOURCES += styles/qs60style_s60.cpp 171 LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -legul 172 } else { 173 SOURCES += styles/qs60style_simulated.cpp 174 RESOURCES += styles/qstyle_s60_simulated.qrc 175 } 176 } else { 177 DEFINES += QT_NO_STYLE_S60 178 }
Note:
See TracChangeset
for help on using the changeset viewer.