Skin: Add support for Immersive* color names

This commit is contained in:
ge0rdi
2020-09-24 20:49:37 +02:00
parent fbcf85559e
commit e2ff745949
2 changed files with 5 additions and 2 deletions

View File

@@ -405,7 +405,7 @@ void ShowMetroColorViewer( void )
if (fout) fprintf(fout,"%02X%02X%02X%02X %S\n",(color>>24)&0xFF,color&0xFF,(color>>8)&0xFF,(color>>16)&0xFF,name); if (fout) fprintf(fout,"%02X%02X%02X%02X %S\n",(color>>24)&0xFF,color&0xFF,(color>>8)&0xFF,(color>>16)&0xFF,name);
#endif #endif
MetroColor mc; MetroColor mc;
mc.name=name; mc.name=text;
mc.NAME=mc.name; mc.NAME=mc.name;
mc.NAME.MakeUpper(); mc.NAME.MakeUpper();
mc.type=type; mc.type=type;

View File

@@ -375,7 +375,10 @@ COLORREF MenuSkin::GetMetroColor( const wchar_t *names ) const
if (GetImmersiveUserColorSetPreference!=NULL) if (GetImmersiveUserColorSetPreference!=NULL)
{ {
wchar_t text[256]; wchar_t text[256];
Sprintf(text,_countof(text),L"Immersive%s",name); if (wcsncmp(name,L"Immersive",9)==0)
wcscpy_s(text,name);
else
Sprintf(text,_countof(text),L"Immersive%s",name);
int type=GetImmersiveColorTypeFromName(text); int type=GetImmersiveColorTypeFromName(text);
data.colorType=type<0?-1:type; data.colorType=type<0?-1:type;
if (type>=0) if (type>=0)