Restrict SemiWhite pixel for dark embedded theme & allow embedded theme properties also when starting with other themes

This commit is contained in:
asava 2020-04-17 17:50:31 +03:00
parent 2e95c4bc54
commit 11b6542852
2 changed files with 13 additions and 14 deletions

View File

@ -2687,19 +2687,18 @@ GetEarlyUserSettings (
break; break;
} }
} }
if ((AsciiStriCmp (Prop->string, "embedded") == 0) || (AsciiStriCmp (Prop->string, "") == 0)) { // get embedded theme property even when starting with other themes, as they may be changed later
Prop = GetProperty (DictPointer, "EmbeddedThemeType"); Prop = GetProperty (DictPointer, "EmbeddedThemeType");
if (Prop && (Prop->type == kTagTypeString) && Prop->string) { if (Prop && (Prop->type == kTagTypeString) && Prop->string) {
if (AsciiStriCmp (Prop->string, "Dark") == 0) { if (AsciiStriCmp (Prop->string, "Dark") == 0) {
ThemeX.DarkEmbedded = TRUE; ThemeX.DarkEmbedded = TRUE;
ThemeX.Font = FONT_GRAY; ThemeX.Font = FONT_GRAY;
} else if (AsciiStriCmp (Prop->string, "Light") == 0) { } else if (AsciiStriCmp (Prop->string, "Light") == 0) {
ThemeX.DarkEmbedded = FALSE; ThemeX.DarkEmbedded = FALSE;
ThemeX.Font = FONT_ALFA; ThemeX.Font = FONT_ALFA;
} else if (AsciiStriCmp (Prop->string, "DayTime") == 0) { } else if (AsciiStriCmp (Prop->string, "DayTime") == 0) {
ThemeX.DarkEmbedded = !ThemeX.Daylight; ThemeX.DarkEmbedded = !ThemeX.Daylight;
ThemeX.Font = ThemeX.Daylight?FONT_ALFA:FONT_GRAY; ThemeX.Font = ThemeX.Daylight?FONT_ALFA:FONT_GRAY;
}
} }
} }
} }

View File

@ -159,7 +159,7 @@ void XTheme::LoadFontImage(IN BOOLEAN UseEmbedded, IN INTN Rows, IN INTN Cols)
) { ) {
PixelPtr->Reserved = 0; //if a pixel has same color as first pixel then it will be transparent PixelPtr->Reserved = 0; //if a pixel has same color as first pixel then it will be transparent
//} else if (ThemeX.DarkEmbedded) { //} else if (ThemeX.DarkEmbedded) {
} else if (!ThemeX.Daylight) { } else if (ThemeX.embedded && !ThemeX.Daylight) {
*PixelPtr = SemiWhitePixel; //special case to change a text to semi white, not blue pixels *PixelPtr = SemiWhitePixel; //special case to change a text to semi white, not blue pixels
} }
FontPtr[Ypos + x] = *PixelPtr++; //not (x, YPos) !!! FontPtr[Ypos + x] = *PixelPtr++; //not (x, YPos) !!!