[raiguard][1.1.49] Multi-line labels cause strange behavior with scroll panes and stretching
Posted: Sat Dec 11, 2021 9:41 pm
To reproduce
1. Download Task List (requires the Factorio library)
2. Create a task with a very long description (lorem ipsum works nicely)
3. Observe the above effects
I attempted to reproduce this with a simple test mod, but failed. Something in the combination of elements and layouts in Task List is causing this, but I haven't been able to figure out exactly what. Here is the layout of a task item in the mod's code.
Bug 1: Scroll pane height
As you can see, the added height of the multi-line label is not communicated to the scroll pane at all, so rather than stretching until it hits max height (which in this case is 900), it immediately initiates scrolling. The expected behavior is that it would stretch like it normally does until it his max height, and only then would it start scrolling.
Bug 2: horizontally_stretchable
The content of the scroll pane uses horizontally_stretchable with a twelve-pixel padding on the scroll pane's content flow. However, when the label wraps, the stretching is reduced to the width of the label itself. You can see this in the above video by comparing looking at the distance between the expand button and the scroll bar - it is much more than twelve pixels. It also happens to line up perfectly with the width of the description label.
Then, if you scroll down, the subtasks are going all the way right, and the padding is gone for them. You cannot click the expand buttons because they're outside of the scroll pane's content flow.
The expected behavior is that it would stretch until it hits the twelve-pixel padding on the scroll pane.