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

Attribute definitions: Fix context menu on sequence items #1033

Merged
Merged
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
9 changes: 6 additions & 3 deletions client/ayon_core/tools/attribute_defs/files_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _on_about_to_be_removed(self, parent_index, start, end):
"""Make sure that removed items are removed from items mapping.

Connected with '_on_insert'. When user drag item and drop it to same
view the item is actually removed and creted again but it happens in
view the item is actually removed and created again but it happens in
inner calls of Qt.
"""

Expand Down Expand Up @@ -841,7 +841,7 @@ def _on_rows_inserted(self, parent_index, start_row, end_row):
self._multivalue
)
widget.context_menu_requested.connect(
self._on_context_menu_requested
self._on_item_context_menu_request
)
self._files_view.setIndexWidget(index, widget)
self._files_proxy_model.setData(
Expand All @@ -859,7 +859,7 @@ def _on_rows_removed(self, parent_index, start_row, end_row):
for row in range(self._files_proxy_model.rowCount()):
index = self._files_proxy_model.index(row, 0)
item_id = index.data(ITEM_ID_ROLE)
available_item_ids.add(index.data(ITEM_ID_ROLE))
available_item_ids.add(item_id)

widget_ids = set(self._widgets_by_id.keys())
for item_id in available_item_ids:
Expand Down Expand Up @@ -923,6 +923,9 @@ def _on_context_menu_requested(self, pos, valid_index):
if menu.actions():
menu.popup(pos)

def _on_item_context_menu_request(self, pos):
self._on_context_menu_requested(pos, True)

def dragEnterEvent(self, event):
if self._multivalue:
return
Expand Down
Loading