mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06: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
1 changed files with 9 additions and 0 deletions
|
@ -80,6 +80,15 @@ Item
|
|||
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.
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue