Commit f34412b9 authored by Frank Richter's avatar Frank Richter Committed by Alexandre Julliard

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

parent 67a0c694
...@@ -700,6 +700,7 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) ...@@ -700,6 +700,7 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
int colorElements[TMT_LASTCOLOR-TMT_FIRSTCOLOR]; int colorElements[TMT_LASTCOLOR-TMT_FIRSTCOLOR];
COLORREF colorRgb[TMT_LASTCOLOR-TMT_FIRSTCOLOR]; COLORREF colorRgb[TMT_LASTCOLOR-TMT_FIRSTCOLOR];
LPCWSTR lpValueEnd; LPCWSTR lpValueEnd;
int captionColors = 0;
while((lpName=UXINI_GetNextValue(ini, &dwLen, &lpValue, &dwValueLen))) { while((lpName=UXINI_GetNextValue(ini, &dwLen, &lpValue, &dwValueLen))) {
lstrcpynW(szPropertyName, lpName, min(dwLen+1, sizeof(szPropertyName)/sizeof(szPropertyName[0]))); lstrcpynW(szPropertyName, lpName, min(dwLen+1, sizeof(szPropertyName)/sizeof(szPropertyName[0])));
...@@ -712,6 +713,21 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) ...@@ -712,6 +713,21 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) { if(MSSTYLES_GetNextInteger(lpValue, lpValueEnd, &lpValue, &b)) {
colorElements[colorCount] = iPropertyId - TMT_FIRSTCOLOR; colorElements[colorCount] = iPropertyId - TMT_FIRSTCOLOR;
colorRgb[colorCount++] = RGB(r,g,b); 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 { else {
FIXME("Invalid color value for %s\n", debugstr_w(szPropertyName)); FIXME("Invalid color value for %s\n", debugstr_w(szPropertyName));
...@@ -730,6 +746,8 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) ...@@ -730,6 +746,8 @@ void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
} }
if (setMetrics && (colorCount > 0)) if (setMetrics && (colorCount > 0))
SetSysColors(colorCount, colorElements, colorRgb); SetSysColors(colorCount, colorElements, colorRgb);
if (setMetrics && (captionColors == 0xf))
SystemParametersInfoW (SPI_SETGRADIENTCAPTIONS, 0, (PVOID)TRUE, 0);
continue; continue;
} }
if(MSSTYLES_ParseIniSectionName(lpName, dwLen, szAppName, szClassName, &iPartId, &iStateId)) { if(MSSTYLES_ParseIniSectionName(lpName, dwLen, szAppName, szClassName, &iPartId, &iStateId)) {
......
...@@ -249,6 +249,8 @@ static const WCHAR strColorKey[] = ...@@ -249,6 +249,8 @@ static const WCHAR strColorKey[] =
{ 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\', { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
'C','o','l','o','r','s',0 }; 'C','o','l','o','r','s',0 };
static const WCHAR keyFlatMenus[] = { 'F','l','a','t','M','e','n','u', 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 static const struct BackupSysParam
{ {
...@@ -257,6 +259,7 @@ static const struct BackupSysParam ...@@ -257,6 +259,7 @@ static const struct BackupSysParam
} backupSysParams[] = } backupSysParams[] =
{ {
{SPI_GETFLATMENU, SPI_SETFLATMENU, keyFlatMenus}, {SPI_GETFLATMENU, SPI_SETFLATMENU, keyFlatMenus},
{SPI_GETGRADIENTCAPTIONS, SPI_SETGRADIENTCAPTIONS, keyGradientCaption},
{-1, -1, 0} {-1, -1, 0}
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment