Changeset 769 for trunk/src/gui/styles/qwindowsmobilestyle.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/styles/qwindowsmobilestyle.cpp
r651 r769 4041 4041 void QWindowsMobileStylePrivate::tintImagesButton(QColor color) 4042 4042 { 4043 4043 if (currentTintButton == color) 4044 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 } 4045 currentTintButton = color; 4046 4047 imageTabEnd = QImage(tabend_xpm); 4048 imageTabSelectedEnd = QImage(tabselectedend_xpm); 4049 imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); 4050 imageTabMiddle = QImage(tabmiddle_xpm); 4051 tintImage(&imageTabEnd, color, 0.0); 4052 tintImage(&imageTabSelectedEnd, color, 0.0); 4053 tintImage(&imageTabSelectedBegin, color, 0.0); 4054 tintImage(&imageTabMiddle, color, 0.0); 4055 4056 if (!doubleControls) { 4057 int height = imageTabMiddle.height() / 2 + 1; 4058 imageTabEnd = imageTabEnd.scaledToHeight(height); 4059 imageTabMiddle = imageTabMiddle.scaledToHeight(height); 4060 imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); 4061 imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); 4062 } 4062 4063 } 4063 4064 … … 5076 5077 QImage image; 5077 5078 int xoffset, yoffset; 5079 bool isTabBarArrow = widget && widget->parent() 5080 && widget->inherits("QToolButton") 5081 && widget->parent()->inherits("QTabBar"); 5082 5078 5083 switch (element) { 5079 5084 case PE_IndicatorArrowUp: … … 5090 5095 image = d->imageArrowLeft; 5091 5096 xoffset = 8; 5092 yoffset = 2;5097 yoffset = isTabBarArrow ? 12 : 2; 5093 5098 break; 5094 5099 case PE_IndicatorArrowRight: 5095 5100 image = d->imageArrowRight; 5096 5101 xoffset = 8; 5097 yoffset = 2;5102 yoffset = isTabBarArrow ? 12 : 2; 5098 5103 break; 5099 5104 case PE_IndicatorArrowUpBig: … … 5352 5357 painter->drawLines(a); 5353 5358 break; } 5359 case PE_IndicatorBranch: { 5360 // Copied from the Windows style. 5361 static const int decoration_size = d->doubleControls ? 18 : 9; 5362 static const int ofsA = d->doubleControls ? 4 : 2; 5363 static const int ofsB = d->doubleControls ? 8 : 4; 5364 static const int ofsC = d->doubleControls ? 12 : 6; 5365 static const int ofsD = d->doubleControls ? 1 : 0; 5366 int mid_h = option->rect.x() + option->rect.width() / 2; 5367 int mid_v = option->rect.y() + option->rect.height() / 2; 5368 int bef_h = mid_h; 5369 int bef_v = mid_v; 5370 int aft_h = mid_h; 5371 int aft_v = mid_v; 5372 if (option->state & State_Children) { 5373 int delta = decoration_size / 2; 5374 bef_h -= delta; 5375 bef_v -= delta; 5376 aft_h += delta; 5377 aft_v += delta; 5378 QPen oldPen = painter->pen(); 5379 QPen crossPen = oldPen; 5380 crossPen.setWidth(2); 5381 painter->setPen(crossPen); 5382 painter->drawLine(bef_h + ofsA + ofsD, bef_v + ofsB + ofsD, bef_h + ofsC + ofsD, bef_v + ofsB + ofsD); 5383 if (!(option->state & State_Open)) 5384 painter->drawLine(bef_h + ofsB + ofsD, bef_v + ofsA + ofsD, bef_h + ofsB + ofsD, bef_v + ofsC + ofsD); 5385 painter->setPen(option->palette.dark().color()); 5386 painter->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1); 5387 if (d->doubleControls) 5388 painter->drawRect(bef_h + 1, bef_v + 1, decoration_size - 3, decoration_size - 3); 5389 painter->setPen(oldPen); 5390 } 5391 QBrush brush(option->palette.dark().color(), Qt::Dense4Pattern); 5392 if (option->state & State_Item) { 5393 if (option->direction == Qt::RightToLeft) 5394 painter->fillRect(option->rect.left(), mid_v, bef_h - option->rect.left(), 1, brush); 5395 else 5396 painter->fillRect(aft_h, mid_v, option->rect.right() - aft_h + 1, 1, brush); 5397 } 5398 if (option->state & State_Sibling) 5399 painter->fillRect(mid_h, aft_v, 1, option->rect.bottom() - aft_v + 1, brush); 5400 if (option->state & (State_Open | State_Children | State_Item | State_Sibling)) 5401 painter->fillRect(mid_h, option->rect.y(), 1, bef_v - option->rect.y(), brush); 5402 break; } 5354 5403 case PE_Frame: 5355 5404 qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), … … 6949 6998 ret = d->doubleControls ? windowsMobileSliderThickness * 2: windowsMobileSliderThickness; 6950 6999 break; 6951 case PM_TabBarScrollButtonWidth: 6952 ret = d->doubleControls ? 14 * 2 : 18; 6953 case PM_CheckBoxLabelSpacing: 6954 case PM_RadioButtonLabelSpacing: 7000 case PM_TabBarScrollButtonWidth: 7001 ret = d->doubleControls ? 14 * 2 : 18; 7002 break; 7003 case PM_CheckBoxLabelSpacing: 7004 case PM_RadioButtonLabelSpacing: 6955 7005 ret = d->doubleControls ? 6 * 2 : 6; 6956 7006 break;
Note:
See TracChangeset
for help on using the changeset viewer.