Tag browser: Renaming of items should not toggle the item when pressing the Enter key

This commit is contained in:
Kovid Goyal 2020-10-27 07:06:38 +05:30
parent 34a4f06855
commit 71cf4248dc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -294,7 +294,7 @@ class TagsView(QTreeView): # {{{
self.collapsed.connect(self.collapse_node_and_children)
def keyPressEvent(self, event):
if event.key() == Qt.Key_Return:
if event.key() == Qt.Key_Return and self.state() != self.EditingState:
# I don't see how it can ever not be valid, but ...
if self.currentIndex().isValid():
self.toggle_current_index()