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:
Olivier Goffart 2025-01-20 17:55:23 +01:00
parent 5806b027ff
commit 7e37f19e2c
5 changed files with 19 additions and 36 deletions

View file

@ -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;
}