-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix Enhance Mouseover Visuals for TabControl #3803
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
base: master
Are you sure you want to change the base?
Conversation
-change the Cursor on hover -implement a "hover" effect
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). |
I would argue WPF defaults don't matter. |
@@ -291,7 +291,7 @@ | |||
Duration="0" /> | |||
</Storyboard> | |||
</ControlTemplate.Resources> | |||
<Grid x:Name="Root"> | |||
<Grid x:Name="Root" Cursor="Hand"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than hard code this value here, lets set it in a Style setter that way if consumers want to change it, they can.
See the MaterialDesignRaisedButton
for an example of doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Keboo I intentionally placed the Cursor="Hand"
property at that level. If I set it at the Style-level, the Cursor becomes a Hand when hovering over the content of the TabItem, which is not desired:
Maybe adding an attached property (e.g.: TabAssist.TabHeaderCursor
) is the way to go? This way the cursor behaves the correct way, and consumers can change it, if they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I had not considered that. Yes, let's go with the attached property approach.
|
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: |
fixes #3802
Cursor="Hand"
when hovering over aTabItem
TabItem
which any normalButton
hasCurrent behavior
New behavior