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

NextTab action: allow Cycling when reaching the end #1874

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Wittmaxi
Copy link
Contributor

@Wittmaxi Wittmaxi commented May 6, 2024

Specifically for CTabFolders, this commit detects when the NextTab action has reached the last item and will cycle to the first item instead of doing nothing. It will load the item which is displayed in that page.

5
(achieved by pressing Ctrl + pgdown)

This fix only works for CTabFolders: the "traverse"-Method only returns whether it performed something or nothing. However, it also returns true if it effectively performed nothing but actually couldn't because it was on the last item.
For CTabFolders, I can check whether we are on the last item and manually jump to the second-to last item in the row. By jumping to the second-to-last item, I can still perform the "normal action" performed by SWT for traverse, which means that all Components are loaded correctly and the chevron is shown correctly.
I could not find a good general API which would allow to tell in general which tab I am on.
However, all of the "normal" views use a CTabFolder, so the loss of generality is minimal

Specifically for CTabFolders, this commit detects when the NextTab
action has reached the last item and will cycle to the first item
instead of doing nothing. It will load the item which is displayed in
that page.
@Wittmaxi Wittmaxi marked this pull request as draft May 6, 2024 14:28
Copy link
Contributor

github-actions bot commented May 6, 2024

Test Results

   921 files  ±0     921 suites  ±0   48m 10s ⏱️ + 1m 29s
 7 535 tests ±0   7 384 ✅  - 1  150 💤 ±0  1 ❌ +1 
23 757 runs  ±0  23 241 ✅  - 1  515 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit ca8fa8a. ± Comparison against base commit 17e35c4.

@fedejeanne
Copy link
Contributor

fedejeanne commented May 7, 2024

@Wittmaxi, thank you for contributing this.
I haven't really looked at the code yet so my comment is only a general one: is this a new feature or was the behavior "wrong" before this PR?

If I navigate through the tabs before applying this PR then the chevron is opened and I can select the next tab (it takes more clicks, but it's doable), which might be ok for others. This mean that this PR would be changing some normal (maybe even desired?) behavior.

With that in mind, I have only one ask for now and that is: please explain the current behavior and how this PR changes it in the description of this PR so the community can give its opinion. Change the PR to "ready for review" once this is done and see if someone comments on that.

I'll take a look at the code later today.

(FWIW I like the functionality that this PR brings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants