From 2c76bbf7dd3485cd464691ff8cdf19721f046bb7 Mon Sep 17 00:00:00 2001 From: Krzysztof Kowalczyk Date: Fri, 9 Aug 2024 15:09:12 +0200 Subject: [PATCH] change Dark theme to be actually dark; add theme docs --- docs/md/Customize-theme-colors.md | 36 +++++++++++++++++++++++++++++ docs/md/SumatraPDF-documentation.md | 8 ++++--- src/Theme.cpp | 8 +++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 docs/md/Customize-theme-colors.md diff --git a/docs/md/Customize-theme-colors.md b/docs/md/Customize-theme-colors.md new file mode 100644 index 000000000000..c1951db5b2cf --- /dev/null +++ b/docs/md/Customize-theme-colors.md @@ -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. diff --git a/docs/md/SumatraPDF-documentation.md b/docs/md/SumatraPDF-documentation.md index 6cd75a5c3913..7024eb3583d3 100644 --- a/docs/md/SumatraPDF-documentation.md +++ b/docs/md/SumatraPDF-documentation.md @@ -7,11 +7,9 @@ [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) @@ -19,6 +17,10 @@ [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) diff --git a/src/Theme.cpp b/src/Theme.cpp index 0bb85047618c..fc15b37f1c58 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -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