mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +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
|
@ -1773,16 +1773,11 @@ fn generate_repeated_component(
|
|||
fn listview_layout(
|
||||
self: core::pin::Pin<&Self>,
|
||||
offset_y: &mut sp::LogicalLength,
|
||||
viewport_width: core::pin::Pin<&sp::Property<sp::LogicalLength>>,
|
||||
) {
|
||||
) -> sp::LogicalLength {
|
||||
let _self = self;
|
||||
let vp_w = viewport_width.get();
|
||||
#p_y.set(*offset_y);
|
||||
*offset_y += #p_height.get();
|
||||
let w = #p_width.get();
|
||||
if vp_w < w {
|
||||
viewport_width.set(w);
|
||||
}
|
||||
#p_width.get()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue