Do not use attribute width as computed width and restore computed width on reset

If the attribute width (which is the user width) is used as computed width, on
reset of the widths the custom widths are still in used.
This commit is contained in:
Cédric Krier committed 2026-03-03 18:50:22 +01:00
1 parent 4c0eb9d4a9
commit efaaf3513b
1 file changed
+6 -5
@@ -455,11 +455,11 @@ class TreeXMLViewParser(XMLViewParser):
screen = self.view.screen
width = screen.tree_column_width[screen.model_name].get(column.name)
if not width:
if 'width' in attributes:
computed_width = width = int(attributes['width'])
else:
width = computed_width
if width or attributes.get('width'):
if not width:
width = int(attributes['width'])
else:
width = computed_width
column.width = width
column.computed_width = computed_width
if width > 0:
@@ -619,6 +619,7 @@ class ViewTree(View):
for col in self.treeview.get_columns():
if col.name:
col.set_fixed_width(col.computed_width)
col.width = col.computed_width
def get_column_widget(self, column):
'Return the widget of the column'