mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Tag browser: Fix use of the tweak to control order of items in the Tag browser causing unexpected expansion of items after editing metadata. Fixes #1730245 [Tag browser unexpectedly expands after edit](https://bugs.launchpad.net/calibre/+bug/1730245)
This commit is contained in:
parent
10036f66ff
commit
cc410ac6da
@ -13,7 +13,7 @@ from itertools import izip
|
|||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QStyledItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon, QApplication,
|
QStyledItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon, QApplication,
|
||||||
QMenu, QPoint, QModelIndex, QToolTip, QCursor, QDrag, QRect,
|
QMenu, QPoint, QToolTip, QCursor, QDrag, QRect,
|
||||||
QLinearGradient, QPalette, QColor, QPen, QBrush, QFont
|
QLinearGradient, QPalette, QColor, QPen, QBrush, QFont
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -220,7 +220,8 @@ class TagsView(QTreeView): # {{{
|
|||||||
(hide_empty_categories and len(category.child_tags()) == 0)):
|
(hide_empty_categories and len(category.child_tags()) == 0)):
|
||||||
continue
|
continue
|
||||||
row += 1
|
row += 1
|
||||||
if self.isExpanded(self._model.index(row, 0, QModelIndex())):
|
index = self._model.index_for_category(category.category_key)
|
||||||
|
if index is not None and self.isExpanded(index):
|
||||||
expanded_categories.append(category.category_key)
|
expanded_categories.append(category.category_key)
|
||||||
states = [c.tag.state for c in category.child_tags()]
|
states = [c.tag.state for c in category.child_tags()]
|
||||||
names = [(c.tag.name, c.tag.category) for c in category.child_tags()]
|
names = [(c.tag.name, c.tag.category) for c in category.child_tags()]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user