fluentribbon / Fluent.Ribbon

WPF Ribbon control like in Office
http://fluentribbon.github.io
MIT License
2.54k stars 518 forks source link

Using ScrollWheel on ribbon group or control no longer shifts tab #1055

Closed andersforsgren closed 2 years ago

andersforsgren commented 2 years ago

In v8.X using the mouse scrollwheel on a ribbon control shifted the tab. This is useful if you move your cursor to where you expect the control to be (by muscle memory) and realize you are on the wrong tab. You can go to the correct tab by mousewheel without moving the mouse.

To repro: load the showcase app and use scrollwheel when hovering on the red DropDownButton. image

This behavior seems to have been removed in v9.0.0. The behavior now is that scrolling why hovering the ribbon tab itself will shift tabs, but moving the scrollwheel on a ribbon control will only move the scrollview. If the ribbon isn't overflowing the view, then the scrollwheel has no effect.

It's not clear whether this change is deliberate. To be honest I never understood how there can be two different kinds of scrolling behavior (overflow-scrollbar-thingy and tab-shifting) and how they hang together. I can imagine several different ways they can be combined, but can't see any comments in source/docs about it. It seems to be related to a change for #894 concerning the ApplicationMenu, and an OnMouseWheel was added to RibbonGroupsContainerScrollViewer: https://github.com/fluentribbon/Fluent.Ribbon/commit/dd3166b37a428814d865d703763c146b008edda8

The behavior I'm struggling to create is that mouse wheel only cycles tabs, or at least cycles tabs if the content doesn't need scrolling (because it can fit). There is only one option IsMouseWheelScrollingEnabled. I was looking for e.g. IsMouseWheelTabShiftingEnabled but can't find one. The behavior in e.g. Office seems to be to NOT pass mousewheel to the groups' scrollviewer but only shift tabs. That's what I'd like to achieve too. Is it possible?


Environment

batzen commented 2 years ago

That change in behavior was intentional, as accidental scrolling happend very often.

You can still scroll and shift tabs by hovering over the tabs, while no control inside the ribbon has the focus.

Shifting tabs only because there is no overflow scrolling causes weird behavior, as shifting would start as soon as overflow scrolling reaches the end.

IsMouseWheelScrollingEnabled only applies to tab shifting.

I could add a new option, beside IsMouseWheelScrollingEnabled to force tab shifting and disable overflow scrolling. It would be disabled by default as i don't like the behavior in word.

What do you think?

andersforsgren commented 2 years ago

Yes some way of emulating the v8 (Office) behaviour would be terrific. I could give it a go but I'm not sure about the design and how the 2 options would work together. The simplest way is adding another boolean option, but would ForceMouseWheelTabShifting simply overrule the IsMouseScrollhweelEnabled? So if both are enabled, then it's forced tab shifting only/everywhere, and if the ForceMouseWheelTabShifting option is disabled then the existing option is used as it works currently?

batzen commented 2 years ago

That sounds reasonable. Feel free to give it a try.