mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Another place that should react to palette changes
This commit is contained in:
parent
a5493fd287
commit
4509900b32
@ -46,6 +46,12 @@ class TOCView(QTreeView):
|
||||
self.setMinimumWidth(80)
|
||||
self.header().close()
|
||||
self.setMouseTracking(True)
|
||||
self.set_style_sheet()
|
||||
self.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
self.customContextMenuRequested.connect(self.context_menu)
|
||||
QApplication.instance().palette_changed.connect(self.set_style_sheet, type=Qt.QueuedConnection)
|
||||
|
||||
def set_style_sheet(self):
|
||||
self.setStyleSheet('''
|
||||
QTreeView {
|
||||
background-color: palette(window);
|
||||
@ -66,8 +72,6 @@ class TOCView(QTreeView):
|
||||
border-radius: 6px;
|
||||
}
|
||||
''')
|
||||
self.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
self.customContextMenuRequested.connect(self.context_menu)
|
||||
|
||||
def mouseMoveEvent(self, ev):
|
||||
if self.indexAt(ev.pos()).isValid():
|
||||
|
Loading…
x
Reference in New Issue
Block a user