Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4268 from ynput/bugfix/OP-4666_Scene-Manager-Upda…
Browse files Browse the repository at this point in the history
…te-all-to-latest-bug

Scene Manager: Fix variable name
  • Loading branch information
antirotor authored Jan 4, 2023
2 parents 629b9ee + f3c13e7 commit 077cc3a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions openpype/widgets/message_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,19 @@ def __init__(self, icon, title, messages, cancelable=False):
content_widget = QtWidgets.QWidget(self)
scroll_widget.setWidget(content_widget)

max_len = 0
message_len = 0
content_layout = QtWidgets.QVBoxLayout(content_widget)
for message in messages:
label_widget = QtWidgets.QLabel(message, content_widget)
content_layout.addWidget(label_widget)
max_len = max(max_len, len(message))
message_len = max(message_len, len(message))

# guess size of scrollable area
max_width = QtWidgets.QApplication.desktop().availableGeometry().width
scroll_widget.setMinimumWidth(min(max_width, max_len * 6))
desktop = QtWidgets.QApplication.desktop()
max_width = desktop.availableGeometry().width()
scroll_widget.setMinimumWidth(
min(max_width, message_len * 6)
)
layout.addWidget(scroll_widget)

if not cancelable: # if no specific buttons OK only
Expand Down

0 comments on commit 077cc3a

Please sign in to comment.