Making Scrivener themes for dummies + removing base color in Binder

Haven’t seen a simple and generalized guide for creating themes, so made a one. It’s not full, but that’s enough. Also figured out how to make one color Binder without that base color line on the left. Haven’t visited forum for a while, probably it’s already solved, but still added. No programming needed for anything.

How to create a theme?

  1. First you need a theme file to edit. You can save some built-in theme: Window — Themes — Save Theme to File. You get a .scrtheme file, which in a way is an archive.

  2. Install 7-zip and open a .scrtheme file. There are four files in it. The main one is *.pal. Open it right in the archive without unzipping, just double-click it. You can use any editor (I use WordPad).

  3. The .pal has information on the colours of Scrivener’s elements (an example is below). Numbers in brackets are in RGB format. Change what you like in that format. You can use Scrivener to get RGB codes.

  4. Close the editor and save the changes. Close 7-zip and press OK to update the file.

  5. Go to Window — Themes — Load Theme from File . Open the modified theme file. Restart Scrivener to apply changes.

Example of a .pal file with the original explanations (Grey Matter Light theme):

Base(209,212,211) //Used mostly as the background color for text entry widgets, but can also be used as the background of combobox drop down lists and toolbar handles. It is usually white or another light color
AlternateBase(195,197,196) //Used as the alternate background color in views with alternating row colors
Window(220,222,221) //A general background color
ToolTipBase(220,222,221) //Used as the background color for ToolTip
Button(220,222,221) //The general button background color
Highlight(217,223,227) //A background color to indicate a selected item or the current item
//TEXTS
WindowText(77,77,77) //A general foreground color
Text(77,77,77) //The foreground color used with Base. This is usually the same as the WindowText, in which case it must provide good contrast with Window and Base
BrightText(72,81,18) //A text color that is very different from WindowText, and contrasts well e.g. Dark. Typically used for text that needs to be drawn where Text or WindowText would give poor contrast, such as on pressed push buttons
ButtonText(77,77,77) //A foreground color used with the Button color
HighlightedText(77,77,77) //A text color that contrasts with Highlight
ToolTipText(77,77,77) //Used as the foreground color for ToolTip
PlaceholderText(51,51,51) //Used as the placeholder color for various text input widgets
Link(72,81,18) //A text color used for unvisited hyperlinks
LinkVisited(72,81,18) //A text color used for already visited hyperlinks
//BASE PALETTE SHADES
Light(169,171,170) //Lighter than Button color
Midlight(169,171,170) //Between Button and Light
Mid(130,131,131) //Between Button and Dark
Dark(220,222,221) //Darker than Button
Shadow(37,37,38) //very dark color i.e. black
//DISABLED
WindowText:Disabled(73,78,80)
Text:Disabled(73,78,80)
Text:Disabled(73,78,80)
ButtonText:Disabled(73,78,80)
Highlight:Disabled(243,249,253)

Palettes

Every color above is used as a palette. Simply put, “Base”, “AlternateBase”, “Midlight” and others are used as parameters in a .qss file in a general theme “archive” (*.scrtheme). I haven’t worked out how the parameters are used, so experiment.

Removing the base color in Binder

Open the .qss file. Find this block in the bottom:

QTreeView::branch:has-siblings:adjoins-item,
QTreeView::branch:!has-children:!has-siblings:adjoins-item,
QTreeView::branch:closed:has-children:has-siblings,
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:open:has-children:has-siblings,
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:has-siblings:!adjoins-item,
QTreeView::branch:active:has-siblings:!adjoins-item,
QTreeView::branch:!active:has-siblings:!adjoins-item,
QTreeView::branch:selected:active,
QTreeView::branch:selected:!active {
background: palette(base);

Replace in the background “palette(base)” with “transparent” (without the quotes)

Check the pdf-file. Screenshots are there and additional info.
https://drive.google.com/file/d/1r25SOUP0iSYpiQz5SsWT6Wnc-CCaPvi6/view?usp=sharing

7 Likes