Skip to content

Commit

Permalink
nuke 14 panel bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
plasmax authored Oct 31, 2024
1 parent 98f589c commit 68c16b9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion PythonEditor/ui/features/autocompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PythonEditor.ui.Qt.QtWidgets import (
QWidget, QCompleter)
from PythonEditor.ui.Qt.QtCore import (
QObject, Qt, Slot, QStringListModel)
QObject, Qt, Slot, QStringListModel, QTimer)
from PythonEditor.utils.debug import debug
from PythonEditor.utils.constants import NUKE_DIR

Expand Down Expand Up @@ -680,6 +680,15 @@ def _pre_keyPressEvent(self, event):
- Complete class properties/methods
(parse for "self.")
"""

# Nuke 14 bugfix - override Spacebar to
# prevent the window from expanding
if event.key() == Qt.Key_Space:
self.set_override(False)
# print(' Autocomplete: pre keypress')
self.editor.keyPressEvent(event)
return True

# print(' Autocomplete: pre keypress')
cp = self.completer
completing = (
Expand Down Expand Up @@ -738,6 +747,19 @@ def _post_keyPressEvent(self, event):
"""
# print(' Autocomplete: post keypress.')
cp = self.completer

# Nuke 14 bugfix - override Spacebar to
# prevent the window from expanding
if event.key() == Qt.Key_Space:
event.accept()
self.set_override(True)
popup = cp.popup()
if popup:
# cp.popup().hide()
QTimer.singleShot(0, popup.hide)
# print(' Autocomplete: post keypress')
return True

#if event.text() in [':', '!', '.']:
if event.text() == '.':
# things to autocomplete on
Expand Down

0 comments on commit 68c16b9

Please sign in to comment.