slint icon indicating copy to clipboard operation
slint copied to clipboard

feature: fluent scrolling

Open std-microblock opened this issue 1 year ago • 10 comments

Fluent scrolling takes an important part of the user experience, but Slint doesn't seem to support it.

I'd appreciate it if fluent scrolling could be implemented in standard ScrollView. To be honest, I had to implement the ScrollView again by myself because of the lack of this function.

The demo here shows the difference.

fortunately, it's pretty simple to implement it in slint thanks to your works :)

std-microblock avatar Dec 09 '23 09:12 std-microblock

I assume this is about having an animation when using the mouse wheel.

This shouldn't be too hard to do by using set_animated_value instead of set around https://github.com/slint-ui/slint/blob/a94148c12ced69fec92e3fdc99f068e4884f23c2/internal/core/items/flickable.rs#L316

ogoffart avatar Dec 11 '23 12:12 ogoffart

I assume this is about having an animation when using the mouse wheel.

This shouldn't be too hard to do by using set_animated_value instead of set around https://github.com/slint-ui/slint/blob/a94148c12ced69fec92e3fdc99f068e4884f23c2/internal/core/items/flickable.rs#L316

nice! I don't know how to make properties animated on rust side so I failed to implement it after some investigations

std-microblock avatar Dec 11 '23 12:12 std-microblock

I don't know how to make properties animated on rust side

Using the Property::set_animated_value https://docs.rs/i-slint-core/latest/i_slint_core/struct.Property.html#method.set_animated_value

ogoffart avatar Jan 17 '24 13:01 ogoffart

I don't know how to make properties animated on rust side

Using the Property::set_animated_value https://docs.rs/i-slint-core/latest/i_slint_core/struct.Property.html#method.set_animated_value

Would you work on this? If not, I'll get the issue fixed and do pr when I have spare time.

std-microblock avatar Jan 17 '24 14:01 std-microblock

We try to keep "good first issues" open for a bit to give contributors a chance to sink their teeth in:-)

Go ahead and give it a try.

hunger avatar Jan 17 '24 20:01 hunger

image This is not working somehow, am I doing anything wrong? @ogoffart

std-microblock avatar Jul 26 '24 17:07 std-microblock

How do you compute animated? Are you sure that it's true?

tronical avatar Jul 29 '24 09:07 tronical

That looks alright, what is not working?

Maybe if this is called every frame, the animation is always restarted and never progress (just an idea, i don't know what the problem is)

ogoffart avatar Jul 30 '24 17:07 ogoffart

How do you compute animated? Are you sure that it's true?

Yes

std-microblock avatar Jul 31 '24 06:07 std-microblock

That looks alright, what is not working?

Maybe if this is called every frame, the animation is always restarted and never progress (just an idea, i don't know what the problem is)

I scroll, and nothing happens.

No, it's called only once each scroll.

Can you check what happened in my repo? I have no idea about this.

reproduce: cargo r --bin gallery, and check the standard list view

std-microblock avatar Jul 31 '24 06:07 std-microblock