summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qwindowsxpstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/styles/qwindowsxpstyle.cpp')
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 322bfac805..9560c4b988 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -161,8 +161,7 @@ HTHEME XPThemeData::handle()
htheme = QWindowsXPStylePrivate::handleMap->operator[](name);
if (!htheme) {
- htheme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget),
- (TCHAR*)name.utf16());
+ htheme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), (wchar_t*)name.utf16());
if (htheme) {
if (!QWindowsXPStylePrivate::handleMap)
QWindowsXPStylePrivate::handleMap = new QMap<QString, HTHEME>;
@@ -1203,7 +1202,8 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
MARGINS borderSize;
if (widget) {
- HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button");
+ XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ HTHEME theme = buttontheme.handle();
if (theme) {
int stateId;
if (!(option->state & State_Enabled))
@@ -1547,11 +1547,11 @@ case PE_Frame:
if (widget) {
bool useGradient = true;
const int maxlength = 256;
- WCHAR themeFileName[maxlength];
- WCHAR themeColor[maxlength];
+ wchar_t themeFileName[maxlength];
+ wchar_t themeColor[maxlength];
// Due to a a scaling issue with the XP Silver theme, tab gradients are not used with it
if (pGetCurrentThemeName(themeFileName, maxlength, themeColor, maxlength, NULL, 0) == S_OK) {
- WCHAR* offset;
+ wchar_t *offset = 0;
if ((offset = wcsrchr(themeFileName, QChar(QLatin1Char('\\')).unicode())) != NULL) {
offset++;
if (!lstrcmp(offset, L"Luna.msstyles") && !lstrcmp(offset, L"Metallic")) {
@@ -1919,8 +1919,8 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
{
name = QLatin1String("BUTTON");
partId = BP_PUSHBUTTON;
- bool justFlat = (btn->features & QStyleOptionButton::Flat) && !(flags & (State_On|State_Sunken))
- || (btn->features & QStyleOptionButton::CommandLinkButton
+ bool justFlat = ((btn->features & QStyleOptionButton::Flat) && !(flags & (State_On|State_Sunken)))
+ || ((btn->features & QStyleOptionButton::CommandLinkButton)
&& !(flags & State_MouseOver)
&& !(btn->features & QStyleOptionButton::DefaultButton));
if (!(flags & State_Enabled) && !(btn->features & QStyleOptionButton::Flat))
@@ -3245,7 +3245,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
- res = (pm == PM_IndicatorWidth ? size.cx : res = size.cy);
+ res = (pm == PM_IndicatorWidth) ? size.cx : size.cy;
}
}
break;
@@ -3257,7 +3257,7 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
if (theme.isValid()) {
SIZE size;
pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
- res = (pm == PM_ExclusiveIndicatorWidth ? size.cx : res = size.cy);
+ res = (pm == PM_ExclusiveIndicatorWidth) ? size.cx : size.cy;
}
}
break;
@@ -3537,6 +3537,8 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
rect = QRect(frameWidth + hPad, controlTop + vPad, iconSize.width(), iconSize.height());
}
break;
+ default:
+ break;
}
}
break;
@@ -3563,6 +3565,9 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
case SC_ComboBoxListBoxPopup:
rect = cmb->rect;
break;
+
+ default:
+ break;
}
}
break;
@@ -3627,7 +3632,8 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt
case CT_LineEdit:
case CT_ComboBox:
{
- HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button");
+ XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ HTHEME theme = buttontheme.handle();
MARGINS borderSize;
if (theme) {
int result = pGetThemeMargins(theme,
@@ -3803,6 +3809,8 @@ QPixmap QWindowsXPStyle::standardPixmap(StandardPixmap standardPixmap, const QSt
}
}
break;
+ default:
+ break;
}
return QWindowsStyle::standardPixmap(standardPixmap, option, widget);
}
@@ -3924,6 +3932,8 @@ QIcon QWindowsXPStyle::standardIconImplementation(StandardPixmap standardIcon,
}
break;
+ default:
+ break;
}
return QWindowsStyle::standardIconImplementation(standardIcon, option, widget);