Help with editing a prefs file to edit QSS?

I just got Scrivener and I am trying to make a custom theme. One issue I came across is where Scrivener makes the background and text font color when typing in a new name in the binder the same color. I’ve seen a few other forum posts describing this (link below), and some options suggest editing the qss. I have questions on how to do that.

https://www.reddit.com/r/ScrivenerThemeBuilder/comments/ybvyow/how_to_change_color_of_the_text_in_binder_and/?rdt=53123

I have VSCode, not super familiar with it. At a certain point it seems I will need to edit QSS files through VSCode since that is the code editor I have, if there are other suggestions let me know. Within VSCode, with the very, very, little I have worked on with it so far there seems to be an automatic function for identifying and telling it which extensions or languages to use. What I don’t know is if VSCode will automatically have everything necessary for identifying and running HTML, CSS, and QSS. I’m not at the point to be editting the QSS yet, I’m just wondering–will I need to and be able to use VSCode extensions that can enable the QSS editing?

Now, more importantly: I tried formatting the prefs file as a zip file as recommended elsewhere (see link below) on the same subreddit to extract the files. When I tried to extract that zip file through 7zip, I received a “cannot open the file as zip archive is not archive” message, and therefore cannot work with the files necessary.

https://www.reddit.com/r/ScrivenerThemeBuilder/comments/wciugs/how_to_load_my_updated_theme_in_scrivener/

I am interested in customizing more color options in the theme as well so any help would be very useful.

Yes, you’ll get colored code and intellisense in the QSS.
I can check the exact name of the extension later (!@PC)

Edit the Prefs-file through the UI. All four files (xml manifest, pal palette, prefs preferences and the qss Stylesheet) should be zipped together in a zipfile. Rename the results to a scrtheme file to create the Theme. Load the Theme with Window > Themes > Load a theme from file.

Glad you’ve found r/ScrivenerThemeBuilder, you can find the e-book on Amazon or Kobo.

1 Like

Ah ok. Didn’t consider exporting the prefs as a zip from scrivener itself, that makes a lot more sense.

Also wondering if once I have the qss editor open if I can edit the font color under synopses as well? It has a different font color than the notes section. While I’m here, wondering if there is a way to see what dimensions work best for background textures for editor margins? I found a background I want to use and the ratio seems to be getting scrivener to zoom in which takes away most of the image I am hoping to see.

Creating the subreddit was a good call, lots of good information there. As for the book, I don’t think I have the finances to allocate towards something like that, I will plan on looking into it more in the future though.

Actually, I think I misunderstood. I don’t see a way to export the themes or options as a zip file within scriveners UI. My previous attempts were to rename the same file with .zip at the end. I will try naming it to scrtheme now.

Don’t save as a Zip-file, but as a Prefs-file. Zip together with the other three files and rename to scrtheme.

You can save the current state of you pteferences in File > Options > Manage > Save Prefs…

For a long time, I thought the color of the divider in the Synopsis pane could not be changed. I even put it on the WishList in the L&L Community Forum. It was recorded as a bug, though.

Then I stumbled on the solution trying to change the textcolor of the Synopsis pane in the Inspector, which came as a surprise:

>> Looking into the Synopsis text color, I’ve come up with this:

>> SCRIndexCardWidget QWidget {color: lime;}

>> But it comes with a surprise. I hope you like it anyway.

For you, the surprise is reversed: you’ll have to deal with divider similar colored as the text.

So, choose wisely. :smiley:

1 Like

Ok. I tried saving as a prefs file then renaming it to both scrtheme and theme. Theme didn’t work and I can’t find out how to open scrtheme as a windows theme. Maybe it’s because I only have the options/theme options file and am unsure what the other 3 files are?

And ok. I will look into that when I edit. Seems I’ll also be looking into what the divider is as well.

Ah nvm on the divider. For now.

Remember it’s a texture, so the left and right editor background will show the same texture. Size should be equal or smaller than your screen width and height, and it will be converted to a jpg.

Ok, so match the height, and what about width?

A Theme is more than a prefs-file on the Windows platform. The other three files are a Palette (pal), a Stylesheet (qss), and a small manifest (xml).

You can extract the other three from any Theme except the Default. Just rename scrtheme to zip and unzip.

I wasn’t able to find a way to export as an scrtheme. I found a theme on a marketplace which may answer why I wasn’t able to which has a description that says “Because this theme is built on Scrivener’s Default theme, I am unable to export the file as a .scrtheme.”

I didn’t know you could create a theme from something other than the default theme, it seems I’ll have to try recreating the theme then?

Yeah it seems starting from a different theme was necessary. Will be working on that. Will try that now and leave updates as comments here. Thank you for all your patience and help!

1 Like

I just read that you already mentioned it can be extracted from themes other than the default. My bad. I am working on it now, luckily the prefs file from what I already had in the default saved me a lot of time.

In the Window > Themes menu select Save theme to file.

( tbe e-book is only $9.99, and you can copy code out of the book, just saying :wink:)

1 Like

I am tempted. We shall see. I’m hoping to make more themes for different projects so it would be useful.

Templates are per application, but you can switch fast using an AutoHotKey-script I can provide… :slightly_smiling_face:

1 Like