View Single Post
Old 10-07-2022, 01:39 AM   #14
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,605
Karma: 7511185
Join Date: Sep 2020
Device: none
Welp. I managed to make the scrollbar handle more distinctive, but my test.qss does work only when setting Calibre User interface style to System Default, in Look and Feel preferences.

Click image for larger version

Name:	MWSnap0715 2022-10-07, 01_03_59.png
Views:	164
Size:	24.4 KB
ID:	197027

That white on green handle was achieved using this qss styling. (corresponding attached file: test1.qss)

Click image for larger version

Name:	MWSnap0716 2022-10-07, 01_31_18.png
Views:	161
Size:	21.3 KB
ID:	197026

Then, after seeing this thread, I merged the previous scrollbar styling with the custom dark theme mentioned.
That's almost exactly what I needed to achieve, but some elements in this custom dark theme, like padding and border sizes don't fit Calibre UI as perfectly as the built-in dark color palette. (corresponding attached file: test.qss)

Click image for larger version

Name:	MWSnap0714 2022-10-07, 00_57_52.png
Views:	143
Size:	33.1 KB
ID:	197028

If I set Calibre Interface settings in Look and feel to "calibre style", the external qss gets overriden. So I end up in the same situation as before, as seen above. :\

Notes on what I had to to, running Calibre from source:

- location of qss file: one level above the /src directory
- code placement in gui2/__init__.py:

Code:
    def __init__(self, args=(), force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
        if not args:
            args = sys.argv[:1]
        args += ['-stylesheet', 'test.qss']
I also looked in palette.py to see if I could make Calibre not override my qss file when using the built-in dark theme, so that I could get the result seen in the second pic but wasn't able to figure that out.
Attached Files
File Type: zip qss-files.zip (7.0 KB, 144 views)

Last edited by Comfy.n; 10-07-2022 at 01:55 AM.
Comfy.n is offline   Reply With Quote