[PATCH] UXTHEME: Enable gradient captions if a theme provides colors
for them
Frank Richter
frank.richter at gmail.com
Mon Aug 14 10:02:37 CDT 2006
-------------- next part --------------
>From fecc375043319b4c1f5f0e09345f7da3877ab7c2 Mon Sep 17 00:00:00 2001
From: Frank Richter frank.richter at gmail.com <frank.richter at gmail.com>
Date: Mon, 14 Aug 2006 16:59:09 +0200
Subject: [PATCH] UXTHEME: Enable gradient captions if a theme provides colors for them
---
dlls/uxtheme/msstyles.c | 18 ++++++++++++++++++
dlls/uxtheme/system.c | 3 +++
2 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c
index 76414d9..827bdf6 100644
--- a/dlls/uxtheme/msstyles.c
+++ b/dlls/uxtheme/msstyles.c
@@ -700,6 +700,7 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE
int colorElements[TMT_LASTCOLOR-TMT_FIRSTCOLOR];
COLORREF colorRgb[TMT_LASTCOLOR-TMT_FIRSTCOLOR];
LPCWSTR lpValueEnd;
+ int captionColors = 0;
while((lpName=UXINI_GetNextValue(ini, &dwLen, &lpValue, &dwValueLen))) {
lstrcpynW(szPropertyName, lpName, min(dwLen+1, sizeof(szPropertyName)/sizeof(szPropertyName[0])));
@@ -712,6 +713,21 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE
if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) {
colorElements[colorCount] = iPropertyId - TMT_FIRSTCOLOR;
colorRgb[colorCount++] = RGB(r,g,b);
+ switch (iPropertyId)
+ {
+ case TMT_ACTIVECAPTION:
+ captionColors |= 0x1;
+ break;
+ case TMT_INACTIVECAPTION:
+ captionColors |= 0x2;
+ break;
+ case TMT_GRADIENTACTIVECAPTION:
+ captionColors |= 0x4;
+ break;
+ case TMT_GRADIENTINACTIVECAPTION:
+ captionColors |= 0x8;
+ break;
+ }
}
else {
FIXME("Invalid color value for %s\n", debugstr_w(szPropertyName));
@@ -730,6 +746,8 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE
}
if (setMetrics && (colorCount > 0))
SetSysColors(colorCount, colorElements, colorRgb);
+ if (setMetrics && (captionColors == 0xf))
+ SystemParametersInfoW (SPI_SETGRADIENTCAPTIONS, 0, (PVOID)TRUE, 0);
continue;
}
if(MSSTYLES_ParseIniSectionName(lpName, dwLen, szAppName, szClassName, &iPartId, &iStateId)) {
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 347074c..e19f913 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -249,6 +249,8 @@ static const WCHAR strColorKey[] =
{ 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
'C','o','l','o','r','s',0 };
static const WCHAR keyFlatMenus[] = { 'F','l','a','t','M','e','n','u', 0};
+static const WCHAR keyGradientCaption[] = { 'G','r','a','d','i','e','n','t',
+ 'C','a','p','t','i','o','n', 0 };
static const struct BackupSysParam
{
@@ -257,6 +259,7 @@ static const struct BackupSysParam
} backupSysParams[] =
{
{SPI_GETFLATMENU, SPI_SETFLATMENU, keyFlatMenus},
+ {SPI_GETGRADIENTCAPTIONS, SPI_SETGRADIENTCAPTIONS, keyGradientCaption},
{-1, -1, 0}
};
--
1.4.1.1
More information about the wine-patches
mailing list