mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
fixed set focus for dictionary widget
This commit is contained in:
parent
75f3dca1ce
commit
5578784360
2 changed files with 21 additions and 0 deletions
|
|
@ -89,6 +89,25 @@ class DictImmutableKeysWidget(BaseWidget):
|
|||
|
||||
self._prepare_entity_layouts(child["children"], wrapper)
|
||||
|
||||
def set_focus(self, scroll_to=False):
|
||||
"""Set focus of a widget.
|
||||
|
||||
Args:
|
||||
scroll_to(bool): Also scroll to widget in category widget.
|
||||
"""
|
||||
if self.body_widget:
|
||||
if scroll_to:
|
||||
self.scroll_to(self.body_widget.top_part)
|
||||
self.body_widget.top_part.setFocus()
|
||||
|
||||
else:
|
||||
if scroll_to:
|
||||
if not self.input_fields:
|
||||
self.scroll_to(self)
|
||||
else:
|
||||
self.scroll_to(self.input_fields[0])
|
||||
self.setFocus()
|
||||
|
||||
def _ui_item_base(self):
|
||||
self.setObjectName("DictInvisible")
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,8 @@ class ExpandingWidget(QtWidgets.QWidget):
|
|||
self.main_layout.setSpacing(0)
|
||||
self.main_layout.addWidget(top_part)
|
||||
|
||||
self.top_part = top_part
|
||||
|
||||
def hide_toolbox(self, hide_content=False):
|
||||
self.button_toggle.setArrowType(QtCore.Qt.NoArrow)
|
||||
self.toolbox_hidden = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue