mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 06:02:59 +02:00
Nicer cursor handling for ToC panel in the viewer
This commit is contained in:
parent
af854628be
commit
bb1a9b70f1
1 changed files with 8 additions and 1 deletions
|
|
@ -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 @@ def __init__(self, *args):
|
|||
}
|
||||
''')
|
||||
|
||||
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…
Reference in a new issue