Replies: 2 comments 1 reply
-
Update: I was able to make an optimization to my code by rendering only the visible elements from the large list based on position and visibility. Because slint is limited in what can be done in expressions/functions I'm limited now to all items in the list being the same size. I think that's a limitation of ListView as well. But on top of the questions in previous message, is there a way to create components normally and have slint optimize out components that aren't visible? It has all the information (x, y, width, height) and could easily just leave blank spot where a component is not visible and not accessible for interaction, yet it seems like it does create them all. I tried using |
Beta Was this translation helpful? Give feedback.
-
This doesn't seem normal. Maybe there is a bug or some way to optimize.
The code that instentiate the item in Rust is there: Line 965 in a1c2e2f (Note that if you're using C++, then it is not optimized the same way) And it is at this point not possible to implement it the same way for a custom ListView.
You can work on the viewport-y property.
Right now the material style has the best ListView form embedded. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing on ESP32, and want to develop a control that can scroll through a few hundreds of rectangles with touch-area. Because it is on a small screen I'm developing my own navigation controls.
It uses SwipeGestureHandler, and a few rectangles (for scrollbars) that manipulate the
y
attribute of a VerticalLayout containing all buttons. I'm also animating the y to get a smooth scroll. And it all works reasonably well.When loading about 150 items everything works fine. It shows quickly and functions well.
However, when the view is destroyed it takes a few good seconds for it to disappear. This is not something that would work for my application.
I compared that behavior to ListView and with ListView that slow destroy isn't there.
When trying to migrate my code to use ListView, I couldn't get things to work.
I couldn't get the viewport-y to be animated for smooth scrolling, I couldn't bind viewport-y to another property - that property changed but the viewport-y didn't, etc.
Is it possible to fully control ListView scroll positioning including animations?
If I end up having to use ListView, the scroll-bar there is completely unusable on a small device. It is very narrow, built for a desktop application. Is there a way to at least control its width in anyway? It seems like that's not accessible but maybe there's a way?
Beta Was this translation helpful? Give feedback.
All reactions