Closed Jerakin closed 2 years ago
Can you share the project so that I can try?
Eh the project is a mess 😐 could be hard to find it there (inviting you anyway).
I think I found the source of the issue and managed to reproduce it: "Adjustment Mode: Stretch" on stencil nodes gives issues. I think it is possible to reproduce it in gooey example.
In the gui file
\gooey\themes\kenneyblue\components\dynamiclist.gui
Set both bg
and stencil
to Adjust Mode: Stretch.
You only have to make the window narrower for it to pop up.
Hmm, yeah, since that's a dynamic list it has a fixed amount of list items and they are created on startup. We need to find a way to detect that there's a need for more/less list items and recreate them.
What do you think would be the best way to do this? Adding a window listener?
Well, I think maybe Gooey should have a function that the application can call to set/update the current window width/height. And components can somehow read this value and decide on recreating/updating the view.
I've played around with a gooey.get/set_window_size() function that the components can use to detect a change and that all works well. The next problem in the case of a list if to calculate the new size of the stencil node so that it's possible to calculate the number of list item nodes to create.
The next problem in the case of a list if to calculate the new size of the stencil node so that it's possible to calculate the number of list item nodes to create.
Would be very handy to call this separately for when you use set_size on a list too.
I've decided that it becomes too messy to use stretch adjust mode on lists. It complicates things too much when it comes to visible list item calculations, max scroll amount etc.
I have added support for detecting when the stencil size has changed and will recreate the nodes in the list when this happens.
The bottom of the scroll list looks like this when not resizing
But if I resize the screen with
defos.set_window_size(0, 0, 570, 1224)
(from 720, 1280) it looks like this insteadQuite a lot of padding is added and a extra item can be seen. The data is nil (but it get's set even though I check for nil before doing
gui.set_text()
.The stencil node have Adjustment Mode: Stretch and Y Anchor: Top