-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Scrollbar dragging batch two #60953
Merged
dseguin
merged 13 commits into
CleverRaven:master
from
ZeroInternalReflection:ScrollbarDragExpansion1
Sep 19, 2022
Merged
Scrollbar dragging batch two #60953
dseguin
merged 13 commits into
CleverRaven:master
from
ZeroInternalReflection:ScrollbarDragExpansion1
Sep 19, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
[C++]
Changes (can be) made in C++. Previously named `Code`
Character / World Generation
Issues and enhancements concerning stages of creating a character or a world
Info / User Interface
Game - player communication, menus, etc.
Martial Arts
Arts, Techniques, weapons and anything touching martial arts.
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
labels
Sep 12, 2022
33 tasks
awesome work! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
[C++]
Changes (can be) made in C++. Previously named `Code`
Character / World Generation
Issues and enhancements concerning stages of creating a character or a world
Info / User Interface
Game - player communication, menus, etc.
json-styled
JSON lint passed, label assigned by github actions
Martial Arts
Arts, Techniques, weapons and anything touching martial arts.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Interface "Scrollbar dragging batch two"
Purpose of change
Expand the scrollbar click-and-drag support implemented in a few UIs in #60006.
Describe the solution
Move handling of scrollbar dragging to the scrollbar() class. Scrollbar dragging can then be implemented anywhere that uses scrollbar()/draw_scrollbar() with the following changes:
Implement these changes for:
Describe alternatives you've considered
Eventually
Would result in a staggering amount of code duplication
Testing
Tested in English at a variety of screen sizes (generally smaller ones so there were more scrollbars) in Linux.
Character creation UIs:
Character_creation_scrollbar_drag.mp4
Draw_item_info UI:
Draw_item_info_scrollbar_drag.mp4
uilist and martial arts information screen:
Uilist_and_martial_arts_scrollbar_drag.mp4
Testing in curses on gnome-terminal (it mostly works, but isn't as nice):
Character_creation_scrollbar_drag--Curses.mp4
In a subsequent commit (2022-09-14), I updated the dragging code to actually interpolate properly (rather than the tried-and-tested method of "Eh, looks about right"). Having the mouse cursor over the
^
should now have the scrolling window at the very top, and having the mouse cursor over theV
should now have the scrolling window at the very bottom. (Compare to some of the videos above, where it was occasionally necessary to move the mouse beyond the window in order to scroll all of the way)Corrected_interpolation.mp4
Additional context
If I didn't screw up in this implementation, there are a whole lot more places to add it to.