mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
rename variable 'max_len' to 'message_len'
This commit is contained in:
parent
66daa081fe
commit
f5842d91bd
1 changed files with 5 additions and 3 deletions
|
|
@ -105,16 +105,18 @@ class ScrollMessageBox(QtWidgets.QDialog):
|
||||||
content_widget = QtWidgets.QWidget(self)
|
content_widget = QtWidgets.QWidget(self)
|
||||||
scroll_widget.setWidget(content_widget)
|
scroll_widget.setWidget(content_widget)
|
||||||
|
|
||||||
max_len = 0
|
message_len = 0
|
||||||
content_layout = QtWidgets.QVBoxLayout(content_widget)
|
content_layout = QtWidgets.QVBoxLayout(content_widget)
|
||||||
for message in messages:
|
for message in messages:
|
||||||
label_widget = QtWidgets.QLabel(message, content_widget)
|
label_widget = QtWidgets.QLabel(message, content_widget)
|
||||||
content_layout.addWidget(label_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
|
# guess size of scrollable area
|
||||||
max_width = QtWidgets.QApplication.desktop().availableGeometry().width
|
max_width = QtWidgets.QApplication.desktop().availableGeometry().width
|
||||||
scroll_widget.setMinimumWidth(min(max_width, max_len * 6))
|
scroll_widget.setMinimumWidth(
|
||||||
|
min(max_width, message_len * 6)
|
||||||
|
)
|
||||||
layout.addWidget(scroll_widget)
|
layout.addWidget(scroll_widget)
|
||||||
|
|
||||||
if not cancelable: # if no specific buttons OK only
|
if not cancelable: # if no specific buttons OK only
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue