mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 19:25:58 +08:00
Limit column widths to not exceed the total width of the table
A bit clunky, but very effective! This way we don't have to deal with clipping or scrolling horizontally. Contributes to issue CURA-8686.
This commit is contained in:
parent
279c23f5aa
commit
2429f28b7f
@ -80,6 +80,15 @@ Item
|
|||||||
if(drag.active)
|
if(drag.active)
|
||||||
{
|
{
|
||||||
parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back.
|
parent.parent.width = Math.max(10, parent.parent.width + mouseX); //Don't go smaller than 10 pixels, to make sure you can still scale it back.
|
||||||
|
let sum_widths = 0;
|
||||||
|
for(let i = 0; i < headerBar.children.length; ++i)
|
||||||
|
{
|
||||||
|
sum_widths += headerBar.children[i].width;
|
||||||
|
}
|
||||||
|
if(sum_widths > tableScrollView.width)
|
||||||
|
{
|
||||||
|
parent.parent.width -= sum_widths - tableScrollView.width; //Limit the total width to not exceed the view.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tableView.forceLayout();
|
tableView.forceLayout();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user