Quote:
Originally Posted by capink
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.