mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Dark mode: Fix colors in remove all formats except dialog
This commit is contained in:
parent
52dff55b41
commit
09eaa46360
@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
from PyQt5.Qt import QVBoxLayout, QDialog, QLabel, QDialogButtonBox, Qt, \
|
||||
QAbstractListModel, QListView, QSize
|
||||
QAbstractListModel, QListView, QSize, QApplication
|
||||
|
||||
from calibre.gui2 import file_icon_provider
|
||||
|
||||
@ -63,9 +63,11 @@ class SelectFormats(QDialog):
|
||||
self.fview.doubleClicked.connect(self.double_clicked,
|
||||
type=Qt.QueuedConnection)
|
||||
if exclude:
|
||||
self.fview.setStyleSheet('''
|
||||
QListView { background-color: #FAE7B5}
|
||||
''')
|
||||
if QApplication.instance().is_dark_theme:
|
||||
sheet = 'background-color: #DAA520; color: black'
|
||||
else:
|
||||
sheet = 'background-color: #fae7b5'
|
||||
self.fview.setStyleSheet('QListView { %s }' % sheet)
|
||||
self._l.addWidget(self.fview)
|
||||
self.fview.setModel(self.formats)
|
||||
self.fview.setSelectionMode(self.fview.SingleSelection if single else
|
||||
@ -93,8 +95,8 @@ class SelectFormats(QDialog):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt5.Qt import QApplication
|
||||
app = QApplication([])
|
||||
from calibre.gui2 import Application
|
||||
app = Application([])
|
||||
d = SelectFormats(['epub', 'lrf', 'lit', 'mobi'], 'Choose a format')
|
||||
d.exec_()
|
||||
print(d.selected_formats)
|
||||
|
Loading…
x
Reference in New Issue
Block a user