Skip to content

Commit

Permalink
Make Set Project or Set Folder Path appear as pop-up dialog similar t…
Browse files Browse the repository at this point in the history
…o Set Product Name
  • Loading branch information
BigRoy committed Jul 30, 2024
1 parent 3255a8d commit 296f622
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 296f622

Please sign in to comment.