Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update image_tags_editor.py #125

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion taggui/utils/text_edit_item_delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def sizeHint(self, option, index):
return size

def eventFilter(self, editor, event: QEvent):
if event.type() == QEvent.KeyPress and event.key() == Qt.Key_Return:
if (event.type() == QEvent.KeyPress
and event.key() in (Qt.Key_Return, Qt.Key_Enter)):
self.commitData.emit(editor)
self.closeEditor.emit(editor)
self.parent().setCurrentIndex(
Expand Down
2 changes: 1 addition & 1 deletion taggui/widgets/image_tags_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, image_tag_list_model: QStringListModel,
lambda: QTimer.singleShot(0, self.clear))

def keyPressEvent(self, event: QKeyEvent):
if not event.key() == Qt.Key_Return:
if event.key() not in (Qt.Key_Return, Qt.Key_Enter):
super().keyPressEvent(event)
return
# If Ctrl+Enter is pressed and the completer is visible, add the first
Expand Down