mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
better stretch, margins and spacing
This commit is contained in:
parent
51beef8192
commit
c2cdd4130e
2 changed files with 8 additions and 7 deletions
|
|
@ -56,6 +56,7 @@ class AttributeDefinitionsDialog(QtWidgets.QDialog):
|
|||
btns_layout.addWidget(cancel_btn, 0)
|
||||
|
||||
main_layout = QtWidgets.QVBoxLayout(self)
|
||||
main_layout.setContentsMargins(10, 10, 10, 10)
|
||||
main_layout.addWidget(attrs_widget, 0)
|
||||
main_layout.addStretch(1)
|
||||
main_layout.addWidget(btns_widget, 0)
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ class AttributeDefinitionsWidget(QtWidgets.QWidget):
|
|||
layout.deleteLater()
|
||||
|
||||
new_layout = QtWidgets.QGridLayout()
|
||||
new_layout.setContentsMargins(0, 0, 0, 0)
|
||||
new_layout.setColumnStretch(0, 0)
|
||||
new_layout.setColumnStretch(1, 1)
|
||||
self.setLayout(new_layout)
|
||||
|
|
@ -210,12 +211,8 @@ class AttributeDefinitionsWidget(QtWidgets.QWidget):
|
|||
if not attr_def.visible:
|
||||
continue
|
||||
|
||||
col_num = 0
|
||||
expand_cols = 2
|
||||
if attr_def.is_value_def and attr_def.is_label_horizontal:
|
||||
expand_cols = 1
|
||||
|
||||
col_num = 2 - expand_cols
|
||||
|
||||
if attr_def.is_value_def and attr_def.label:
|
||||
label_widget = AttributeDefinitionsLabel(
|
||||
attr_def.id, attr_def.label, self
|
||||
|
|
@ -233,9 +230,12 @@ class AttributeDefinitionsWidget(QtWidgets.QWidget):
|
|||
| QtCore.Qt.AlignVCenter
|
||||
)
|
||||
layout.addWidget(
|
||||
label_widget, row, 0, 1, expand_cols
|
||||
label_widget, row, col_num, 1, 1
|
||||
)
|
||||
if not attr_def.is_label_horizontal:
|
||||
if attr_def.is_label_horizontal:
|
||||
col_num += 1
|
||||
expand_cols = 1
|
||||
else:
|
||||
row += 1
|
||||
|
||||
if attr_def.is_value_def:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue