mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
ListView: fix continuous redraw with fluent style
Because we set the viewport-width several time to different value during the layouting of the ListView, it will cause this property to always be dirty. In particular, this causes permanent restart of the fluent's scrollbar animation on the size of the handle, causing continous repaints.
This commit is contained in:
parent
5806b027ff
commit
7e37f19e2c
5 changed files with 19 additions and 36 deletions
|
@ -1237,12 +1237,13 @@ public:
|
|||
float listview_width, float viewport_y) const
|
||||
{
|
||||
float offset = viewport_y;
|
||||
viewport_width->set(listview_width);
|
||||
auto vp_width = listview_width;
|
||||
if (!inner)
|
||||
return offset;
|
||||
for (auto &x : inner->data) {
|
||||
(*x.ptr)->listview_layout(&offset, viewport_width);
|
||||
vp_width = std::max(vp_width, (*x.ptr)->listview_layout(&offset));
|
||||
}
|
||||
viewport_width->set(vp_width);
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue