Frank Richter : uxtheme:
Enable gradient captions if a theme provides colors for them.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 14 14:10:20 CDT 2006
Module: wine
Branch: master
Commit: f34412b957cc465bebf54b4d9211c0d2180d9e51
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f34412b957cc465bebf54b4d9211c0d2180d9e51
Author: Frank Richter <frank.richter at gmail.com>
Date: Mon Aug 14 17:02:37 2006 +0200
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}
};
More information about the wine-cvs
mailing list