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 reveal style to Settings button in NavigationView in top mode,Closes #942 #1236
Add reveal style to Settings button in NavigationView in top mode,Closes #942 #1236
Conversation
Thanks for this contribution, @chingucoding! We'll take a look soon. |
x:Name="RevealBorder" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
contract4NotPresent:Visibility="Collapsed" > |
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.
I don't think you need this contract check. I think the value of BorderBrush (NavigationViewItemBorderBrush) is already doing the right thing depending on which version of the OS the code is running on. NavigationViewItemBorderBrush sometimes maps to SystemControlTransparentBrush, and other times, when reveal is available, to SystemControlBackgroundTransparentRevealBorderBrush.
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.
I thought about that too. This Border is also used in the "MUX_NavigationViewItemPresenterStyleWhenOnLeftPane" style . Should we remove the contract4NotPresent for that Border element too?
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.
@kaiguo what would you recommend?
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.
Yeah I think it's safe to remove them altogether.
@chingucoding You probably need to update reveal states and maybe border brushes too in the visual state setters. Take a look at "MUX_NavigationViewItemPresenterStyleWhenOnLeftPane"
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.
@chingucoding You probably need to update reveal states and maybe border brushes too in the visual state setters. Take a look at "MUX_NavigationViewItemPresenterStyleWhenOnLeftPane"
I don't think this is necessary since the reveal works just as expected:
Dark theme | Light theme |
---|---|
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.
This is very subtle but it's not only the approaching animation, there are also hover and pressed animations, which requires setting reveal brush states.
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.
Should be fixed now.
@kaiguo Thank you for the pointing out the right places to fix!
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.
@chingucoding thanks for the fix!
There's another related issue, you probably have noticed, the items on top nav don't have reveal either. Would you like to contribute a fix for that too 😊?
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.
@kaiguo Of course! Should the reveal be the same as for the settings button? Or should the reveal be different for those items (since the also have a different hover visual as the buttons)?
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
36cee22
to
434a107
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
🎉 Handy links: |
🎉 Handy links: |
Summary
Added reveal style to settings button in NavigationView when it is in top mode.
Change
Added the item "Border x:Name=RevealBorder" to the template of the settings button in top mode
Testing
Tested by starting MUXControlsTestApp and navigating through following test pages:
Motivation
Fixes #942.