MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

Fix Enhance Mouseover Visuals for TabControl

Open corvinsz opened this issue 11 months ago • 4 comments

fixes #3802

  • Sets the Cursor="Hand" when hovering over a TabItem
  • Added the same "hover effect" to TabItem which any normal Button has

Current behavior

tabControlPre

New behavior

tabControlPost

corvinsz avatar Feb 28 '25 18:02 corvinsz

Adding a highlight to the tab header on mouse-hover makes sense. However changing the mouse cursor does not follow the WPF framework defaults for the for tab control. I also checked winforms and winUI, neither change the mouse cursor when hovering over a tab item (provided default styles are applied).

jbooth88 avatar Mar 13 '25 21:03 jbooth88

I would argue WPF defaults don't matter. The purpose of this library is to bring Material Design to WPF, and the MD specs suggest what is proposed in this PR (as far as i have read it). https://m3.material.io/components/tabs/accessibility#1f5832f9-1898-4da1-bfe4-f40c84027f8a

corvinsz avatar Mar 13 '25 22:03 corvinsz

  • I added a new attached property called TabAssist.TabHeaderCursor
  • The new default Cursor is the Hand
  • Consumers can force the old Cursor by setting the AP (e.g.: materialDesign:TabAssist.TabHeaderCursor="Arrow")

corvinsz avatar Mar 14 '25 18:03 corvinsz

I would argue WPF defaults don't matter. The purpose of this library is to bring Material Design to WPF, and the MD specs suggest what is proposed in this PR (as far as i have read it). https://m3.material.io/components/tabs/accessibility#1f5832f9-1898-4da1-bfe4-f40c84027f8a

I agree with @corvinsz. And often when I am in doubt when looking at the MD3 specs, I drop back to the MD2 specs where they have the interactive demos for many things. And that clearly shows the hand cursor on hover: https://m2.material.io/components/tabs#interactive-demo

nicolaihenriksen avatar Mar 14 '25 20:03 nicolaihenriksen