mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #8271 (Tag editor forgets position)
This commit is contained in:
parent
1e2501e8da
commit
ceb28df1b0
@ -79,6 +79,8 @@ class TagEditor(QDialog, Ui_TagEditor):
|
||||
|
||||
def apply_tags(self, item=None):
|
||||
items = self.available_tags.selectedItems() if item is None else [item]
|
||||
rows = [self.available_tags.row(i) for i in items]
|
||||
row = max(rows)
|
||||
for item in items:
|
||||
tag = unicode(item.text())
|
||||
self.tags.append(tag)
|
||||
@ -89,6 +91,12 @@ class TagEditor(QDialog, Ui_TagEditor):
|
||||
for tag in self.tags:
|
||||
self.applied_tags.addItem(tag)
|
||||
|
||||
if row >= self.available_tags.count():
|
||||
row = self.available_tags.count() - 1
|
||||
|
||||
if row > 2:
|
||||
item = self.available_tags.item(row)
|
||||
self.available_tags.scrollToItem(item)
|
||||
|
||||
|
||||
def unapply_tags(self, item=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user