Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jperedadnr
Copy link
Collaborator

@jperedadnr jperedadnr commented Jun 24, 2024

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 that ScrollBar does regarding those same events and control orientation (vertical/horizontal).


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8334874: Horizontal scroll events from touch pads should scroll the TabPane tabs (Enhancement - P4)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 24, 2024

👋 Welcome back jpereda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 24, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Ready for review label Jun 24, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 24, 2024

Webrevs

@andy-goryachev-oracle
Copy link
Contributor

Considering that this is an improvement and a change in behavior, I would like to suggest a couple of changes:

  1. For Side.LEFT/RIGHT, reverse the direction. What we have now is inconsistent with the movement of e.g. ListView (can be seen if using track pad with the list view and TabPane in the Monkey Tester):

Screenshot 2024-06-24 at 12 32 18

  1. Since now the TabPane movement correctly reflects the orientation of track pad gesture, we need to reverse the movement when TabPane effective nodeOrientation is RTL.

  2. We don't have the behavior documented currently (some initial docs can be found in /doc-files/behavior). Maybe it's a good opportunity at least start a file for TabPane?

And, a question - does this change require a CSR, since we are changing the behavior?

@kevinrushforth
Copy link
Member

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

@openjdk
Copy link

openjdk bot commented Jun 24, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@kevinrushforth
Copy link
Member

  1. For Side.LEFT/RIGHT, reverse the direction. What we have now is inconsistent with the movement of e.g. ListView (can be seen if using track pad with the list view and TabPane in the Monkey Tester):

I don't recommend doing that as part of this PR. That would be a noticeable behavior change, and warrants more discussion.

  1. Since now the TabPane movement correctly reflects the orientation of track pad gesture, we need to reverse the movement when TabPane effective nodeOrientation is RTL.

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.

@andy-goryachev-oracle
Copy link
Contributor

I don't recommend doing that as part of this PR. That would be a noticeable behavior change, and warrants more discussion

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?

@andy-goryachev-oracle
Copy link
Contributor

Do ScrollPane or ListView work this way already?

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)
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Ready for review
3 participants