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
Fix #4013: Scroll bar can get tiny for extremely long lists #4025
Conversation
This solution plays with the scrollbar drawing parameters, which makes it only a hack, not a real solution.
|
||
if(scroll->v_thumb_bottom - scroll->v_thumb_top < 20) { | ||
double percent = (scroll->v_thumb_bottom*1.0)/view_size; | ||
printf("percent: %f\n", percent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you accidentally left this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is only a draft. If this is approved, then I'll do the same for the horizontal scrollbar and some code cleaning
@Gymnasiast Sorry, I thought it was because #4013 was marked as a duplicate of #592. If this isn't really a fix for #592, I must change the name to avoid Github autoclosing #592, when it really didn't get fixed. |
That was because Duncan only read the issue title and didn't pay attention to what #592 was actually about. If you read both issues it's very easy to see they're totally different issues. |
Are you finished? |
I couldn't test the horizontal scrollbar because I wasn't able to find a window with such a small horizontal scrollbar, but the code is very simple and is equivalent to the vertical scrollbar code, so I can not find why this should not work |
Famous last words ;) |
@janisozaur true. In fact if there is no window with such an horizontal space, we can revert the untested change in horizontal scrollbar (diff lines 76-82), and leave changes in the vertical scrollbar (which are the important ones) |
You can leave it as it is. It's more consistent this way and not likely to cause problems. |
WARNING: This is not a 'real' solution, but a hack with the drawing parameters to have bigger scrollbars when the list being scrolled is too large.
Because of that, the scrollbar moves slightly slower than the mouse pointer actually do, so the pointer will ended up pointing ahead the scrollbar.
This would better implemented while rewriting UI system.
Currently, only vertical scrollbars are implemented. If this hack is approved, then the horizontal bars can be implemented before merge.