Book list: Fix a regression that caused editing cells in a split book list not working in the second split. Fixes #2097677 [Calibre v7.25 List View no longer allow direct edit of fields in Split Window](https://bugs.launchpad.net/calibre/+bug/2097677)

Note that tabbing in the split list also isnt working, will look at that
next.
This commit is contained in:
Kovid Goyal 2025-02-09 18:37:03 +05:30
parent 4b6d6560f2
commit dfb0308e5a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -225,7 +225,10 @@ class StyledItemDelegate(QStyledItemDelegate):
self.ignore_kb_mods_on_edit = False self.ignore_kb_mods_on_edit = False
def createEditor(self, parent, option, index): def createEditor(self, parent, option, index):
if self.table_widget.currentIndex() != index: current_indices = [self.table_widget.currentIndex()]
if hasattr(self.table_widget, 'pin_view'):
current_indices.append(self.table_widget.pin_view.currentIndex())
if index not in current_indices:
idx = self.table_widget.currentIndex() idx = self.table_widget.currentIndex()
print(f'createEditor idx err: delegate={self.__class__.__name__}. ' print(f'createEditor idx err: delegate={self.__class__.__name__}. '
f'cur idx=({idx.row()}, {idx.column()}), ' f'cur idx=({idx.row()}, {idx.column()}), '