fluentribbon / Fluent.Ribbon

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

Black line (border) around RibbonTabItem #1131

Closed GinoDerycke closed 1 year ago

GinoDerycke commented 1 year ago

I changed to version 10. Now I get a border around the selected (focused) RibbonTabItem. I don't know this is the purpose?

BUT: when I focus another object in my WPF application and select another RibbonTabItem, the border is not shown anymore. I have now set for each RibbonTabItem Focusable="False" so that the border is never shown.

With border: image

Without border: image


Environment

batzen commented 1 year ago

That's on purpose because the FocusVisualStyle changed to resemble the one from current Office versions. image

You can change the style by overriding the style with your own. You can either override the inner rectangle style with a style key "Fluent.Ribbon.Styles.FocusVisual.Rectangle" or replace the whole FocusVisualStyle by replacing "Fluent.Ribbon.Styles.FocusVisual". Those styles can be viewed at https://github.com/fluentribbon/Fluent.Ribbon/blob/develop/Fluent.Ribbon/Themes/Controls/FocusStyles.xaml

GinoDerycke commented 1 year ago

Yes, that current Office look seems very nice but is not standard? Do you have to implement it manually to get the line underneath the selected RibbonTabItem?

Plus: when I have selected another control in my application, the focus border never gets back:

https://github.com/fluentribbon/Fluent.Ribbon/assets/39372388/e9fb42b2-04c1-4195-900b-ed51f2507c99

batzen commented 1 year ago

The thick focus visual also starts to appear in parts of Windows 11, so I guess it' getting s the new standard.

When the focus visual appears depends on how the control got focus. By default it only appears when using the keyboard or keyboard API. That's why it disappears in your case. That's just the default behavior of Windows and WPF. It don't like that difference in behavior too, but it is what it is.

You can change the default behavior in the Windows accessibility settings. The setting is named "Underline access keys" whereas the property in WPF is named "AlwaysShowFocusVisual". Sadly the WPF property is internal and can't be easily changed.

GinoDerycke commented 1 year ago

OK, thank you.

Is there already a style that shows new Office look or do I need to write it myself?

image

batzen commented 1 year ago

Fluent.Ribbon only provides one theme, as providing multiple (to reflect different office versions) was way too much maintenance work.

I haven't yet decided if I will follow the current Office theme completely. Currently things only get cherry picked (like the focus visual).

It's a lot of work to keep up with all the changes made in Office and I am the only maintainer here...