Skip to content

Commit

Permalink
Make TAB key work for auto-completion #1525
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Jan 23, 2025
1 parent db25380 commit 8f66241
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ai_diffusion/ui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def event(self, e: QEvent | None):
# Ctrl+Backspace should be handled by QPlainTextEdit, not Krita.
if e.type() == QEvent.Type.ShortcutOverride:
assert isinstance(e, QKeyEvent)
if e.matches(QKeySequence.DeleteStartOfWord):
if e.matches(QKeySequence.StandardKey.DeleteStartOfWord):
e.accept()
return super().event(e)

Expand All @@ -414,6 +414,11 @@ def focusOutEvent(self, e):
if scroll := self.verticalScrollBar():
scroll.triggerAction(QScrollBar.SliderAction.SliderToMinimum)

def focusNextPrevChild(self, next):
if self._completer.is_active:
return False
return super().focusNextPrevChild(next)

def notify_text_changed(self):
self._completer.check_completion()
self.text_changed.emit(self.text)
Expand Down

0 comments on commit 8f66241

Please sign in to comment.