Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is smooth scrolling available out of the box? #27

Closed
Chris2011 opened this issue Dec 15, 2019 · 8 comments
Closed

Question: Is smooth scrolling available out of the box? #27

Chris2011 opened this issue Dec 15, 2019 · 8 comments

Comments

@Chris2011
Copy link

The headline says it all: Is there a smooth scrolling feature which comes with the FlatLaf out of the box? When I use NetBeans with a nb-darcula theme for example the scrolling jumps to a specific number of rows. It is fixed. This features was implemented into NetBeans (one specific LaF) out of the box. It would be nice, if the FlatLaF will have it, if not :)

Cheers

Chris

@DevCharly
Copy link
Collaborator

@Chris2011
Copy link
Author

Thx for the info :)

@DevCharly
Copy link
Collaborator

implemented in 0.24
(coming to NetBeans soon with my next PR)

@Chris2011
Copy link
Author

Awesome :). Thank U so much. Will like to test it out

@bobbylight
Copy link

I tried 0.25.1 out today, and smooth scrolling isn't working for me, though it does work in IntelliJ. I see your implementation looks different than that used in IntelliJ. For me, this part of the conditional is not being met, thus I'm falling back to regular scrolling:

e.getPreciseWheelRotation() != e.getWheelRotation() )

Why is this particular condition there (or more generally, how is it derived from the other implementations linked here and elsewhere? Is there some mouse/OS setting I need to enable somewhere?

Kudos on getting a feature like this into the LaF - it's little things like this that really help the fidelity of Swing applications.

@DevCharly
Copy link
Collaborator

Why is this particular condition there

This conditions simply checks whether the mouse has a high-resolution wheel.
If not, regular scrolling is used.

FlatLaf (currently) supports "smooth scrolling" only with high-resolution wheels or trackpads.
Maybe "smooth scrolling" is the wrong term, but with high-resolution wheels or trackpads it seems to scroll smooth because many many wheel events are fired when you (slowly) rotate the wheel, which means many repaints...

IntelliJ on the other hand seems to have some smooth scrolling for non-high-resolution wheels too.

While scrolling in IntelliJ looks smooth even with non-high-resolution wheels, you can not scroll e.g. half a line when you rotate very slowly. It scrolls always 3 lines (on Windows), but does some repaints to make it feel smooth.

With a high-resolution wheel or trackpads you can scroll pixelwise...

Is there some mouse/OS setting I need to enable somewhere?

Good question. I don't know.
But it seems that on Windows this is a OS/driver problem.
I have a mouse that supports high-resolution on macOS, but not on Windows.
Maybe smooth scrolling has to be enabled somewhere in Windows? Or a special mouse driver is needed?

@bobbylight
Copy link

Thanks. I looked around and couldn't figure out to enable smooth/enhanced scrolling with my mouse. Just wondering if you were aware of some Windows setting that worked for all/most users.

@DevCharly
Copy link
Collaborator

Just wondering if you were aware of some Windows setting that worked for all/most users

No, sorry.

Maybe it is necessary to install additional software from the mouse vendor?

DevCharly added a commit that referenced this issue Jan 8, 2021
- scroll at least one pixel to avoid "hanging"
- limit scroll increment to visible width/height
- no longer use block increment because had width/height of view (IOW was too large and had no effect)

(issue #27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants