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

Add option to use legacy/office-style mouse wheel tab shifting #1058

Merged

Conversation

andersforsgren
Copy link

Closes #1055

This adds a new boolean option to use the old-style mouse wheel behavior found in Fluent.Ribbon <=v8 and Office.

The name of the new option is IsMouseWheelScrollingEnabledEverywhere, (and it's frankly not a good name...)

When true, the mouse wheel events are caught and used to cycle tabs, regardless of where on the ribbon toolbar the wheel event occurs. Wen the new option is false, the old behavior remains: mouse wheel in the tab area can cycle tab (conditional on the old IsMouseWheelScrollingEnabled option). In both cases, the same logic will potentially block the tab shifting, such as if a control has focus.

If IsMouseWheelScrollingEnabledEverywhere is true , then the value of IsMouseWheelScrollingEnabled will be ignored.

The default for the new option is false.

@andersforsgren andersforsgren force-pushed the office-scrollwheel-option branch from 4eeab22 to 6257329 Compare August 25, 2022 18:27
@batzen
Copy link
Member

batzen commented Aug 28, 2022

I did a quick test and it does not behave as office behaves.
I guess there have to be more changes if this should match the office behavior.

  • It's still possible to trigger group scrolling
  • Tab scrolling/shifting does not work when focus is on certain elements inside the Ribbon (buttons etc.), whereas in office it works

If you want to mirror the exact behavior as in office there is more to be done.
I am not sure if you want the exact same behavior as in office, though.

@andersforsgren
Copy link
Author

It's not important to me that it works the same way as in office. The important part is to be able to shift tabs with Mousewheel when inside the groups at all, whether it's like Fluent.Ribbon v8.X or office. It needs to be some kind consistent and least-surprising behavior here though when it comes to group scroll/tab scroll/focus.

It's still possible to trigger group scrolling

Good catch.Will try to sort that. I think it's surprising for the user to get group scrolling only when this option is enabled + a control is focused. Better to make this option completely disable group scrolling.

Tab scrolling/shifting does not work when focus is on certain elements inside the Ribbon (buttons etc.), whereas in office it works

Ok maybe there are different behaviors also in office? I can't scroll with focus on any controls in (Tried O365 Outlook build 2207 16.0.1427).

@andersforsgren andersforsgren force-pushed the office-scrollwheel-option branch from b72bff7 to 4d841c9 Compare August 31, 2022 08:10
@andersforsgren
Copy link
Author

Attempted some changes here. There were two changes

  1. If a dropdown popup is open, then mouse wheel events will be ignored for tab shifting and cancelled entirely (marked handled with no action) unless over the popup. This means wheel can be used to scroll in popups

  2. Normally Fluent.Ribbon prevents tab shifting when a control has keyboard focus. With IsMouseWheelScrollingAllowedEverywhere, the behavior will be more aggressive and now allow it, by moving focus if necessary. Now, mouse wheel will either be handled by an open popup OR it's used to cycle ribbon tabs.

Note that potentially the check in 1) above should perhaps be made regardless of whether IsMouseWheelScrollingAllowedEverywhere is true, because the behavior otherwise is this, which feels kind of buggy

ribbon_scroll

However at the moment I have not made that change in this branch. The behavior above remains.

@batzen
Copy link
Member

batzen commented Sep 1, 2022

Will merge your changes, but i am not sure if we should stick with IsMouseWheelScrollingAllowedEverywhere.
Not sure what would be a better name, but somehow i don't like it.

Also i am not sure if we should mark every mousewheel event as handled, when we didn't handle it but just want to skip our own processing. Will try to test some things and see how it behaves.

Will fix the bug you discovered regarding group scrolling.

@batzen batzen merged commit e28cc28 into fluentribbon:develop Sep 1, 2022
@batzen batzen added this to the 10.0 milestone Sep 1, 2022
batzen added a commit that referenced this pull request Sep 1, 2022
@andersforsgren
Copy link
Author

Thanks. Yes as I said the name is pretty terrible but I felt it was most important to keep it similar in prefix to the other option. If they must be renamed then I think both should be, but then they should perhaps instead be converted to a single Enum with 3 or more different modes for behavior instead of multiple booleans.

@andersforsgren andersforsgren deleted the office-scrollwheel-option branch September 1, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using ScrollWheel on ribbon group or control no longer shifts tab
2 participants