-
Notifications
You must be signed in to change notification settings - Fork 443
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
8334874: Horizontal scroll events from touch pads should scroll the TabPane tabs #1486
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back jpereda! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
Considering that this is an improvement and a change in behavior, I would like to suggest a couple of changes:
And, a question - does this change require a CSR, since we are changing the behavior? |
Good question. Thinking out loud, if what this PR does is to change the existing behavior of top/bottom TabPane scrolling (e.g., horizontal scrollbar) to align with what ScrollPane already does, then... maybe not? (a CSR wouldn't be a bad idea, though) I'd be happy to hear others thoughts on this. It does need two reviewers. /reviewers 2 |
@kevinrushforth |
I don't recommend doing that as part of this PR. That would be a noticeable behavior change, and warrants more discussion.
Do ScrollPane or ListView work this way already? If they do, then it seems reasonable to do the same here. Otherwise, I'm not sure we should do this for TabPane in isolation. |
we are changing the behavior already by changing the direction of the gesture, so I thought we should be able to tackle this issue within the same PR. The other point is the discussion - these comments are already on the mailing list, what alternative discussion is required? And what are the acceptance criteria for that discussion? |
Good point - both have the same issue (I am sure other controls as well, TableView, others did not check). Definitely deserves a separate ticket, possibly even an umbrella task (RTL navigation). |
Side side = getSkinnable().getSide(); | ||
side = side == null ? Side.TOP : side; | ||
switch (side) { | ||
default: | ||
case TOP: | ||
case BOTTOM: | ||
setScrollOffset(scrollOffset + e.getDeltaY()); | ||
// Consider vertical scroll events (dy > dx) from mouse wheel and trackpad, | ||
// and horizontal scroll events from a trackpad (dx > dy) |
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.
Maybe we should explain why - to preserve the existing behavior with the mouse (scrolling up/down)?
The trackpad events can have both dx
and dy
of various magnitude, both non-zero, so the logic seems to me a bit contrived - like filtering some events, although at the end it still feels ok.
What do you think?
This PR considers the horizontal scroll events that can be generated on a trackpad, on an horizontally sided
TabPane
control (top or bottom), adding to the existing vertical scroll events from mouse wheel and trackpad, to scroll its tabs.Therefore, scrolling a
TabPane
will behave in the same way thatScrollBar
does regarding those same events and control orientation (vertical/horizontal).Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1486/head:pull/1486
$ git checkout pull/1486
Update a local copy of the PR:
$ git checkout pull/1486
$ git pull https://git.openjdk.org/jfx.git pull/1486/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1486
View PR using the GUI difftool:
$ git pr show -t 1486
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1486.diff
Webrev
Link to Webrev Comment