From 296f622344694e7e1b7f8ceb1ff46b457b895a70 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 30 Jul 2024 12:50:04 +0200 Subject: [PATCH] Make Set Project or Set Folder Path appear as pop-up dialog similar to Set Product Name --- client/ayon_houdini/api/hda_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/ayon_houdini/api/hda_utils.py b/client/ayon_houdini/api/hda_utils.py index 1edbb11f5e..65d665c0f6 100644 --- a/client/ayon_houdini/api/hda_utils.py +++ b/client/ayon_houdini/api/hda_utils.py @@ -446,7 +446,7 @@ def __init__(self, parent=None): folder_widget = SimpleFoldersWidget(parent=self) - accept_button = QtWidgets.QPushButton("Accept") + accept_button = QtWidgets.QPushButton("Set folder path") main_layout = QtWidgets.QVBoxLayout(self) main_layout.addWidget(project_widget, 0) @@ -502,6 +502,8 @@ def select_folder_path(node): Args: node (hou.OpNode): The HDA node. """ + cursor_pos = QtGui.QCursor.pos() + main_window = lib.get_main_window() project_name = node.evalParm("project_name") @@ -520,6 +522,12 @@ def _select_folder_path(): dialog.setStyleSheet(load_stylesheet()) + # Make it appear like a pop-up near cursor + dialog.resize(300, 600) + dialog.setWindowFlags(QtCore.Qt.Popup) + pos = dialog.mapToGlobal(cursor_pos - QtCore.QPoint(300, 0)) + dialog.move(pos) + result = dialog.exec_() if result != QtWidgets.QDialog.Accepted: return