ScrollViewer with Content-Assisted Scrolling - #671
Open
mstrobel wants to merge 9 commits into
Open
Conversation
# Conflicts: # src/main/java/com/googlecode/lanterna/gui2/AbstractInteractableComponent.java
Contributor
A screenshot would be nice :) |
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

I actually wrote this about eight years ago, but never got around to finishing it until your repo caught my eye in my starred list this weekend. If I recall, it's more or less complete. The only issue I could remember was that cursors would continue to paint even when their owner controls were scrolled out of view. I added a fix for that today.
I was able to build a really slick internal tool for inspecting a proprietary shared memory database with Lanterna at my last job, and I wanted to give something back. Hopefully you'll find it useful.
I'm sure there's a bug or two, but give it a go and see what you think. There's an interactive test/demo called
ScrollControllerTestthat lets you toggle content-assisted scrolling. It renders a checkerboard, and depending on whether the assist is enabled, it will either scroll normally by lines/columns or will snap to the squares' edges.I'd wanted to include a proof-of-concept for hosting your
Tablewhere it would snap to column/row boundaries when scrolling, but I never got around to it.