Tabbed pane scroll viewport edge fade gradients #344
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.
This PR adds a different way of handling tabbed pane edge clipping when using the scroll tab layout.
Instead of a hard cutoff and title string clipping, gradients are added on the sides that obscure the tabs, making them disappear gradually.
Comparison
Why
It looks a bit better in my opinion. I don't feel like the title clipping with "..." is particularly modern.
Inspiration comes from IntelliJ's IDEA where tabs have this exact effect
Potential issues
It makes a tab partially disappear even when it's selected and fully visible. That could probably be explicitly solved, but curiously that happens in IDEA too. Think the easiest solution to that is to keep the gradient width smaller or equal to the left/right tab insets (in case of TOP tab placement).
It does not look so good (imo) with LEFT/RIGHT tab placements. The gradients could perhaps be made smaller for those cases or not use them at all.
Usage
Its controlled with two UIManager properties
It works by placing two components on the edges using the scroll tab layout manager, much like the forward/backward buttons. The selection indicator is not obscured, which required adding a way to track its position in the paintTabSelection() method.
Because of that it does conflict with the other PR I recently opened #343 but that can be easily resolved.