mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 12:19:03 +08:00
Enforce minimum column width through binding formula
We can't enforce it when resizing, due to the width rescaling with the width. But we can enforce it through the binding formula after applying the width scale. Contributes to issue CURA-8686.
This commit is contained in:
parent
8de1f923a4
commit
02c517a841
@ -90,7 +90,7 @@ Item
|
||||
new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
||||
}
|
||||
let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized.
|
||||
parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction });
|
||||
parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ Item
|
||||
new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
||||
}
|
||||
let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized.
|
||||
parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction });
|
||||
parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user