View Single Post
Old 03-16-2021, 08:54 AM   #399
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,509
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
I tried dealing with colors in dark mode for a specific widget (in the Import List plugin) and I failed. I don't think the result is going to be different this time. I do need help with this.
This works for me.

Action Chains.gui.misc.StandardItem
Code:
class StandardItem(QStandardItem):
    def __init__(self, txt=''):
        super().__init__()
        self.setEditable(False)
        self.setText(txt)
In general you shouldn't change fonts and colors unless you have a good reason for it. Calibre goes to a lot of trouble to get things right in both dark and light themes.

If you do want to change colors then you should decide what to do depending on QApplication.instance().is_dark_theme. You will also probably want to override the data() method in QStandardItem to return the colors you want depending on what is being shown.
Attached Thumbnails
Click image for larger version

Name:	Clipboard04.jpg
Views:	1064
Size:	87.8 KB
ID:	185997  
chaley is offline   Reply With Quote