Skip to content

Commit

Permalink
Merge pull request #57 from BigRoy/enhancement/load_asset_lop_set_fol…
Browse files Browse the repository at this point in the history
…der_path_dialog

Load Asset LOP: Make Set Project or Set Folder Path appear as pop-up dialog
  • Loading branch information
BigRoy authored Jul 30, 2024
2 parents 3255a8d + 296f622 commit 56591e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/ayon_houdini/api/hda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 56591e9

Please sign in to comment.