From 1bc6c070459bcc775e3fdb78225a9bcc474791a3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 9 Jun 2021 16:18:39 +0200 Subject: [PATCH] define name column width and use interactive stretch to be able resize it and avoid strange behavior --- .../tools/project_manager/project_manager/view.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openpype/tools/project_manager/project_manager/view.py b/openpype/tools/project_manager/project_manager/view.py index 4d75af3405..74f5a06b71 100644 --- a/openpype/tools/project_manager/project_manager/view.py +++ b/openpype/tools/project_manager/project_manager/view.py @@ -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)