mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Settings: Version settings popup fix (#4822)
* added no mouse relay attribute to popup * completer is not shown if widget is not visible * remove unused import
This commit is contained in:
parent
caf25ddf13
commit
380930e06f
1 changed files with 15 additions and 5 deletions
|
|
@ -4,7 +4,6 @@ from qtpy import QtWidgets, QtCore, QtGui
|
|||
import qtawesome
|
||||
|
||||
from openpype.client import get_projects
|
||||
from openpype.pipeline import AvalonMongoDB
|
||||
from openpype.style import get_objected_colors
|
||||
from openpype.tools.utils.widgets import ImageButton
|
||||
from openpype.tools.utils.lib import paint_image_with_color
|
||||
|
|
@ -97,6 +96,7 @@ class CompleterView(QtWidgets.QListView):
|
|||
|
||||
# Open the widget unactivated
|
||||
self.setAttribute(QtCore.Qt.WA_ShowWithoutActivating)
|
||||
self.setAttribute(QtCore.Qt.WA_NoMouseReplay)
|
||||
delegate = QtWidgets.QStyledItemDelegate()
|
||||
self.setItemDelegate(delegate)
|
||||
|
||||
|
|
@ -241,6 +241,18 @@ class SettingsLineEdit(PlaceholderLineEdit):
|
|||
if self._completer is not None:
|
||||
self._completer.set_text_filter(text)
|
||||
|
||||
def _completer_should_be_visible(self):
|
||||
return (
|
||||
self.isVisible()
|
||||
and (self.hasFocus() or self._completer.hasFocus())
|
||||
)
|
||||
|
||||
def _show_completer(self):
|
||||
if self._completer_should_be_visible():
|
||||
self._focus_timer.start()
|
||||
self._completer.show()
|
||||
self._update_completer()
|
||||
|
||||
def _update_completer(self):
|
||||
if self._completer is None or not self._completer.isVisible():
|
||||
return
|
||||
|
|
@ -249,7 +261,7 @@ class SettingsLineEdit(PlaceholderLineEdit):
|
|||
self._completer.move(new_point)
|
||||
|
||||
def _on_focus_timer(self):
|
||||
if not self.hasFocus() and not self._completer.hasFocus():
|
||||
if not self._completer_should_be_visible():
|
||||
self._completer.hide()
|
||||
self._focus_timer.stop()
|
||||
|
||||
|
|
@ -258,9 +270,7 @@ class SettingsLineEdit(PlaceholderLineEdit):
|
|||
self.focused_in.emit()
|
||||
|
||||
if self._completer is not None:
|
||||
self._focus_timer.start()
|
||||
self._completer.show()
|
||||
self._update_completer()
|
||||
self._show_completer()
|
||||
|
||||
def paintEvent(self, event):
|
||||
super(SettingsLineEdit, self).paintEvent(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue