slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

Shift+mouse wheel should scroll sideways #2228

Closed mgunyho closed 1 year ago

mgunyho commented 1 year ago

I think it's fairly standard for applications to scroll sideways with shift + scroll wheel. I would like to have this behavior for the ScrollView.

Related to #1280 I suppose.

ogoffart commented 1 year ago

That should be easy to do in the items/flickable.rs file when handling the wheel event we could check if shift is pressed. (We do that check also when clicking on a Textinput)

DaMilyutin commented 1 year ago

@ogoffart, some mouses has scroll left and scroll right buttons, too. It is done by tilting the wheel. I guess it is same as shift+wheel. Just FYI.

ogoffart commented 1 year ago

@DaMilyutin Our Flickable and ScrollView already support that

ogoffart commented 1 year ago

I tried to look at what other framework do to see if this is really the case. (i'm on linux)

So i'm tempted to say we can indeed do shift + wheel to invert scroll direction

ogoffart commented 1 year ago

Implemented in PR https://github.com/slint-ui/slint/pull/2242