uxtheme: Enable gradient captions if a theme provides colors for them.

This commit is contained in:
Frank Richter 2006-08-14 17:02:37 +02:00 committed by Alexandre Julliard
parent 67a0c69499
commit f34412b957
2 changed files with 21 additions and 0 deletions

View File

@ -700,6 +700,7 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
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 tf, BOOL setMetrics)
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 tf, BOOL setMetrics)
}
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)) {

View File

@ -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}
};