View Single Post
Old 10-06-2022, 09:01 AM   #11
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,048
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by kovidgoyal View Post
Look in gui2/__init__.py

where QApplication is constructed and pass it the path to stylesheet with -stylesheet.
Well.. I see I need to use this:
https://doc.qt.io/qt-6/qapplication....tyleSheet-prop

Now how/where would I insert the path to a stylesheet in gui2/__init__.py?
In trying to guess, I found this in line 1090:

Code:
class Application(QApplication):

    shutdown_signal_received = pyqtSignal()
    palette_changed = pyqtSignal()

    def __init__(self, args=(), force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
then I tried this:

Code:
[...]color_prefs=gprefs, windows_app_uid=None, stylesheet=c:\x.qss):
Program wouldn't load... Then tried running "calibre.exe -stylesheet c:\x.qss", no good either

Also, looking in https://doc.qt.io/qt-6/stylesheet-syntax.html I'm not sure if the file should have .qss or .css extension. First thing I'd like to test is using a wildcard as in:

Code:
* -webkit-scrollbar-thumb {
  background-color: blue;    /* color of the scroll thumb */
  border-radius: 20px;       /* roundness of the scroll thumb */
  border: 3px solid orange;  /* creates padding around scroll thumb */
}
(reference: https://www.digitalocean.com/communi...css-scrollbars
Comfy.n is online now   Reply With Quote