mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Nicer cursor handling for ToC panel in the viewer
This commit is contained in:
parent
af854628be
commit
bb1a9b70f1
@ -17,9 +17,9 @@ class TOCView(QTreeView):
|
||||
|
||||
def __init__(self, *args):
|
||||
QTreeView.__init__(self, *args)
|
||||
self.setCursor(Qt.PointingHandCursor)
|
||||
self.setMinimumWidth(80)
|
||||
self.header().close()
|
||||
self.setMouseTracking(True)
|
||||
self.setStyleSheet('''
|
||||
QTreeView {
|
||||
background-color: palette(window);
|
||||
@ -40,6 +40,13 @@ class TOCView(QTreeView):
|
||||
}
|
||||
''')
|
||||
|
||||
def mouseMoveEvent(self, ev):
|
||||
if self.indexAt(ev.pos()).isValid():
|
||||
self.setCursor(Qt.PointingHandCursor)
|
||||
else:
|
||||
self.unsetCursor()
|
||||
return QTreeView.mouseMoveEvent(self, ev)
|
||||
|
||||
class TOCItem(QStandardItem):
|
||||
|
||||
def __init__(self, spine, toc, depth, all_items, parent=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user