Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design problem in ListView update code #602

Open
ogoffart opened this issue Oct 21, 2021 · 0 comments
Open

Design problem in ListView update code #602

ogoffart opened this issue Oct 21, 2021 · 0 comments
Labels
a:models&views The implementation of the `for` and ListView (mO,bF) bug Something isn't working

Comments

@ogoffart
Copy link
Member

In the ListView, some stale state might be visible (scrollbar state) when the model change.

The ListView will set the size of the viewport from the update code. ensure_updated_listview which is called from the visitor that visits the tree for the painting. The problem is that the viewport height is used to compute the scrollbar size.
Which means that we don't repaint the scene if we change the viewport size while painting. Also the poition of the viewport might also change from ensure_updated_listview

The symptom of that is that the scrollbar size are not updated when the model change with the native style.
This was reported in slint-ui/cargo-ui#10
(The fluent style is fine because it draws the scrollbar after the flickable)

We could work-around that problem by forcing the scrollbar to be painted after the Flickable, but this is not how the native style work because it draws the frame and the scrollbar in one go. We eventually need to split that anyway to support styles that draw the scrollbar over the content only when scrolling.

Maybe a definitive fix would be to change the binding on the viewport-height so it depends on the model via a runtime function.

@ogoffart ogoffart added the bug Something isn't working label Nov 29, 2022
@ogoffart ogoffart added the a:models&views The implementation of the `for` and ListView (mO,bF) label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:models&views The implementation of the `for` and ListView (mO,bF) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant