mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:33:26 +02: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
1 changed files with 3 additions and 2 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
from PyQt5.Qt import (
|
||||
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
|
||||
)
|
||||
|
||||
|
|
@ -220,7 +220,8 @@ def get_state(self):
|
|||
(hide_empty_categories and len(category.child_tags()) == 0)):
|
||||
continue
|
||||
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)
|
||||
states = [c.tag.state for c in category.child_tags()]
|
||||
names = [(c.tag.name, c.tag.category) for c in category.child_tags()]
|
||||
|
|
|
|||
Loading…
Reference in a new issue