mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Merge pull request #1669 from pypeclub/feature/project_manager_columns
Project Manger: Default name column width
This commit is contained in:
commit
aaf8048eb8
1 changed files with 6 additions and 8 deletions
|
|
@ -92,19 +92,16 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
"stretch": QtWidgets.QHeaderView.ResizeToContents
|
||||
},
|
||||
"name": {
|
||||
"stretch": QtWidgets.QHeaderView.Stretch
|
||||
"stretch": QtWidgets.QHeaderView.Interactive,
|
||||
"width": 260
|
||||
},
|
||||
"type": {
|
||||
"stretch": QtWidgets.QHeaderView.Interactive,
|
||||
"width": 100
|
||||
"width": 140
|
||||
},
|
||||
"tools_env": {
|
||||
"stretch": QtWidgets.QHeaderView.Interactive,
|
||||
"width": 140
|
||||
},
|
||||
"pixelAspect": {
|
||||
"stretch": QtWidgets.QHeaderView.Interactive,
|
||||
"width": 80
|
||||
"width": 200
|
||||
}
|
||||
}
|
||||
persistent_columns = {
|
||||
|
|
@ -180,13 +177,14 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
|
||||
def header_init(self):
|
||||
header = self.header()
|
||||
header.setStretchLastSection(False)
|
||||
|
||||
default_behavior = self.columns_sizes["default"]
|
||||
widths_by_idx = {}
|
||||
for idx in range(header.count()):
|
||||
key = self._source_model.columns[idx]
|
||||
behavior = self.columns_sizes.get(key, default_behavior)
|
||||
if behavior is None:
|
||||
continue
|
||||
logical_index = header.logicalIndex(idx)
|
||||
stretch = behavior["stretch"]
|
||||
header.setSectionResizeMode(logical_index, stretch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue