1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
4038 |
4038 |
4039 #ifdef Q_WS_WINCE_WM |
4039 #ifdef Q_WS_WINCE_WM |
4040 |
4040 |
4041 void QWindowsMobileStylePrivate::tintImagesButton(QColor color) |
4041 void QWindowsMobileStylePrivate::tintImagesButton(QColor color) |
4042 { |
4042 { |
4043 if (currentTintButton == color) |
4043 if (currentTintButton == color) |
4044 return; |
4044 return; |
4045 |
4045 currentTintButton = color; |
4046 imageTabEnd = QImage(tabend_xpm); |
4046 |
4047 imageTabSelectedEnd = QImage(tabselectedend_xpm); |
4047 imageTabEnd = QImage(tabend_xpm); |
4048 imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); |
4048 imageTabSelectedEnd = QImage(tabselectedend_xpm); |
4049 imageTabMiddle = QImage(tabmiddle_xpm); |
4049 imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); |
4050 tintImage(&imageTabEnd, color, 0.0); |
4050 imageTabMiddle = QImage(tabmiddle_xpm); |
4051 tintImage(&imageTabSelectedEnd, color, 0.0); |
4051 tintImage(&imageTabEnd, color, 0.0); |
4052 tintImage(&imageTabSelectedBegin, color, 0.0); |
4052 tintImage(&imageTabSelectedEnd, color, 0.0); |
4053 tintImage(&imageTabMiddle, color, 0.0); |
4053 tintImage(&imageTabSelectedBegin, color, 0.0); |
4054 |
4054 tintImage(&imageTabMiddle, color, 0.0); |
4055 if (!doubleControls) { |
4055 |
4056 int height = imageTabMiddle.height() / 2 + 1; |
4056 if (!doubleControls) { |
4057 imageTabEnd = imageTabEnd.scaledToHeight(height); |
4057 int height = imageTabMiddle.height() / 2 + 1; |
4058 imageTabMiddle = imageTabMiddle.scaledToHeight(height); |
4058 imageTabEnd = imageTabEnd.scaledToHeight(height); |
4059 imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); |
4059 imageTabMiddle = imageTabMiddle.scaledToHeight(height); |
4060 imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); |
4060 imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); |
4061 } |
4061 imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); |
|
4062 } |
4062 } |
4063 } |
4063 |
4064 |
4064 void QWindowsMobileStylePrivate::tintImagesHigh(QColor color) |
4065 void QWindowsMobileStylePrivate::tintImagesHigh(QColor color) |
4065 { |
4066 { |
4066 if (currentTintHigh == color) |
4067 if (currentTintHigh == color) |
5073 color = option->palette.light().color(); |
5074 color = option->palette.light().color(); |
5074 else |
5075 else |
5075 color = option->palette.buttonText().color(); |
5076 color = option->palette.buttonText().color(); |
5076 QImage image; |
5077 QImage image; |
5077 int xoffset, yoffset; |
5078 int xoffset, yoffset; |
|
5079 bool isTabBarArrow = widget && widget->parent() |
|
5080 && widget->inherits("QToolButton") |
|
5081 && widget->parent()->inherits("QTabBar"); |
|
5082 |
5078 switch (element) { |
5083 switch (element) { |
5079 case PE_IndicatorArrowUp: |
5084 case PE_IndicatorArrowUp: |
5080 image = d->imageArrowUp; |
5085 image = d->imageArrowUp; |
5081 xoffset = 1; |
5086 xoffset = 1; |
5082 yoffset = 12; |
5087 yoffset = 12; |
5087 yoffset =12; |
5092 yoffset =12; |
5088 break; |
5093 break; |
5089 case PE_IndicatorArrowLeft: |
5094 case PE_IndicatorArrowLeft: |
5090 image = d->imageArrowLeft; |
5095 image = d->imageArrowLeft; |
5091 xoffset = 8; |
5096 xoffset = 8; |
5092 yoffset = 2; |
5097 yoffset = isTabBarArrow ? 12 : 2; |
5093 break; |
5098 break; |
5094 case PE_IndicatorArrowRight: |
5099 case PE_IndicatorArrowRight: |
5095 image = d->imageArrowRight; |
5100 image = d->imageArrowRight; |
5096 xoffset = 8; |
5101 xoffset = 8; |
5097 yoffset = 2; |
5102 yoffset = isTabBarArrow ? 12 : 2; |
5098 break; |
5103 break; |
5099 case PE_IndicatorArrowUpBig: |
5104 case PE_IndicatorArrowUpBig: |
5100 image = d->imageArrowUpBig; |
5105 image = d->imageArrowUpBig; |
5101 xoffset = 3; |
5106 xoffset = 3; |
5102 yoffset = 12; |
5107 yoffset = 12; |
6946 ret = d->doubleControls ? 1 : 2; |
6951 ret = d->doubleControls ? 1 : 2; |
6947 break; |
6952 break; |
6948 case PM_SliderThickness: |
6953 case PM_SliderThickness: |
6949 ret = d->doubleControls ? windowsMobileSliderThickness * 2: windowsMobileSliderThickness; |
6954 ret = d->doubleControls ? windowsMobileSliderThickness * 2: windowsMobileSliderThickness; |
6950 break; |
6955 break; |
6951 case PM_TabBarScrollButtonWidth: |
6956 case PM_TabBarScrollButtonWidth: |
6952 ret = d->doubleControls ? 14 * 2 : 18; |
6957 ret = d->doubleControls ? 14 * 2 : 18; |
6953 case PM_CheckBoxLabelSpacing: |
6958 break; |
6954 case PM_RadioButtonLabelSpacing: |
6959 case PM_CheckBoxLabelSpacing: |
|
6960 case PM_RadioButtonLabelSpacing: |
6955 ret = d->doubleControls ? 6 * 2 : 6; |
6961 ret = d->doubleControls ? 6 * 2 : 6; |
6956 break; |
6962 break; |
6957 // Returns the number of pixels to use for the business part of the |
6963 // Returns the number of pixels to use for the business part of the |
6958 // slider (i.e., the non-tickmark portion). The remaining space is shared |
6964 // slider (i.e., the non-tickmark portion). The remaining space is shared |
6959 // equally between the tickmark regions. |
6965 // equally between the tickmark regions. |