Skip to content

Commit

Permalink
don't lighten the page background in inverse mode for custom themes (f…
Browse files Browse the repository at this point in the history
…ixes #4465)
  • Loading branch information
kjk committed Aug 10, 2024
1 parent 7e0fe80 commit 950d15d
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/Theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ static const char* themesTxt = R"(Themes [
LinkColor = #0020a0
ColorizeControls = false
]
[
Name = Dark
TextColor = #F9FAFB
BackgroundColor = #000000
ControlBackgroundColor = #000000
LinkColor = #6B7280
ColorizeControls = true
]
[
Name = Dark from 3.5
TextColor = #bac9d0
Expand All @@ -52,6 +44,14 @@ static const char* themesTxt = R"(Themes [
LinkColor = #9999a0
ColorizeControls = true
]
[
Name = Dark
TextColor = #F9FAFB
BackgroundColor = #000000
ControlBackgroundColor = #000000
LinkColor = #6B7280
ColorizeControls = true
]
]
)";

Expand Down Expand Up @@ -206,7 +206,14 @@ COLORREF ThemeDocumentColors(COLORREF& bg) {
// should match the colors of the window
text = ThemeWindowTextColor();
bg = ThemeMainWindowBackgroundColor();
bg = AdjustLightOrDark(bg, 8);

if (gCurrThemeIndex < 3) {
// https://github.com/sumatrapdfreader/sumatrapdf/issues/4465
// this is probably not expected for custom colors but we used to do
// it for built-in themes
// so do it for legacy themes but not for custom themes or new Dark theme
bg = AdjustLightOrDark(bg, 8);
}
return text;
}

Expand Down

0 comments on commit 950d15d

Please sign in to comment.