mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix #802773 (popularity-sort not affected by sub-cat scheme)
This commit is contained in:
commit
a6d1de1cc9
1 changed files with 16 additions and 1 deletions
|
|
@ -12,7 +12,7 @@
|
|||
from itertools import izip
|
||||
|
||||
from PyQt4.Qt import (QItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon,
|
||||
QApplication, QMenu, QPoint, QModelIndex)
|
||||
QApplication, QMenu, QPoint, QModelIndex, QToolTip, QCursor)
|
||||
|
||||
from calibre.gui2.tag_browser.model import (TagTreeItem, TAG_SEARCH_STATES,
|
||||
TagsModel)
|
||||
|
|
@ -493,10 +493,25 @@ def add_node_tree(tree_dict, m, path):
|
|||
pa.setCheckable(True)
|
||||
pa.setChecked(True)
|
||||
|
||||
if config['sort_tags_by'] != "name":
|
||||
fla.setEnabled(False)
|
||||
m.hovered.connect(self.collapse_menu_hovered)
|
||||
fla.setToolTip(_('First letter is usable only when sorting by name'))
|
||||
# Apparently one cannot set a tooltip to empty, so use a star and
|
||||
# deal with it in the hover method
|
||||
da.setToolTip('*')
|
||||
pa.setToolTip('*')
|
||||
|
||||
if not self.context_menu.isEmpty():
|
||||
self.context_menu.popup(self.mapToGlobal(point))
|
||||
return True
|
||||
|
||||
def collapse_menu_hovered(self, action):
|
||||
tip = action.toolTip()
|
||||
if tip == '*':
|
||||
tip = ''
|
||||
QToolTip.showText(QCursor.pos(), tip)
|
||||
|
||||
def dragMoveEvent(self, event):
|
||||
QTreeView.dragMoveEvent(self, event)
|
||||
self.setDropIndicatorShown(False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue