Skip to content

Commit

Permalink
change Dark theme to be actually dark; add theme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Aug 9, 2024
1 parent edf6a77 commit 2c76bbf
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
36 changes: 36 additions & 0 deletions docs/md/Customize-theme-colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Customize theme (colors)

**Available in version 3.6 or later.**

You can change colors of SumatraPDF UI by creating a custom theme using `Themes` [advanced setting](Advanced-options-settings.md).

To create a theme:

- use `Settings` / `Advanced Options...` menu (or `Ctrl + K` Command Palette, type `adv` to narrow down and select `Advanced Options...` command)
- this opens default .txt editor with advanced settings file
- find `Themes` array and add new shortcut definitions

Example of customization:

```
Shortcuts [
[
Name = My Dark Theme
TextColor = #bac9d0
BackgroundColor = #263238
ControlBackgroundColor = #263238
LinkColor = #8aa3b0
ColorizeControls = true
]
]
```

`TextColor` and `BackgroundColor` are for main window color and color of text.

If you use `I` (`CmdInvertColors`) they will also be used to replace white background / black text color when renderign PDF/ePub documents.

`ControlBackgroundColor` is for background of Windows controls (buttons, window frame, menus, list controls etc.).

`LinkColor` is a color for links. Typically it's blue.

`ColorizeControls` should be `true`. If `false` we won't try to change colors of standard windows controls (menu, toolbar, buttons etc.) so a lot of UI will not respect theme colors.
8 changes: 5 additions & 3 deletions docs/md/SumatraPDF-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@

[Keyboard shortcuts](Keyboard-shortcuts.md)

[Scrolling, zooming, navigating](Scrolling-and-zooming.md)

[Customizing keyboard shortcuts](Customizing-keyboard-shortcuts.md)

[Customizing toolbar](Customize-toolbar.md)
[Scrolling, zooming, navigating](Scrolling-and-zooming.md)

[Commands](Commands.md)

[Command-line arguments](Command-line-arguments.md)

[Advanced options / settings](Advanced-options-settings.md)

[Customizing toolbar](Customize-toolbar.md)

[Customizing UI colors / theme](Customize-theme-colors.md)

[Customize external viewers](Customize-external-viewers.md)

[Customize search / translation services](Customize-search-translation-services.md)
Expand Down
8 changes: 8 additions & 0 deletions src/Theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ static const char* themesTxt = R"(Themes [
LinkColor = #8aa3b0
ColorizeControls = true
]
[
Name = Dark from 3.5
TextColor = #bac9d0
BackgroundColor = #263238
ControlBackgroundColor = #263238
LinkColor = #8aa3b0
ColorizeControls = true
]
[
Name = Darker
TextColor = #c3c3c6
Expand Down

0 comments on commit 2c76bbf

Please sign in to comment.