mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06: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
2 changed files with 2 additions and 2 deletions
|
@ -90,7 +90,7 @@ Item
|
||||||
new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
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.
|
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.
|
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.
|
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…
Add table
Add a link
Reference in a new issue