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
Scroll bar blinks when scrolling #1202
Comments
Edit: I'm encountering the same issue. |
Thanks for opening this @EdoardoLaGreca! You're correct about this issue - when the scrollbar autohide field is set it will only show "during" motion and thus flickers if the application only receives scroll events even every second frame for example. It really needs a delay of some sort before disappearing or fading out quickly to reduce the stutter, though I'm not sure how to do this nicely as conrod doesn't drive it's own event loop (a side-effect of trying to support a bunch of different backends which makes animation tricky in general). Perhaps the scrollbar could generate an event which indicates the maximum amount of time until the GUI should be updated and redrawn in order to let the scrollbar disappear or fade out. Will have to keep thinking on this, there might be a nicer way to solve animated/timing based events in conrod in general. |
I saw this too, good to know it is a known issue. I'm still new to this, but I have a suggestion for how to handle it: just add some notion of time to the state that the widget consumes, and then calculate the visibility of the scroll bar based on that time. I.e. you can stash time at which the last relevant mouse event occurred in your global state, and this allows you to calculate how long it has been since that event. At this point you have If you want to get fancy with animations, then you can have: Where Hopefully that makes some sense... it's possible to express behavior in terms of pure functions over the current state. And since rust has The issue of not driving your event loop isn't all that relevant, as long as there's a way to update the current time before each frame is drawn. |
When running the example
all_winit_glium
(on Linux) from the examples page, the window opens normally and the scroll bar is not visible (which may be done on purpose) but when I scroll down with my mouse, it blinks fast.I've also noticed that the scroll bar's blinking frequency is equal to the mouse one when scrolling, so in other words: one mouse scrolling "unit" is equal to one fast blink (appearing and disappearing instantly).
Is it happening to someone else here? May it be a problem about my Linux distro? Please help.
The text was updated successfully, but these errors were encountered: