Skip to content
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

Fix issue where icon on RadioMenuFlyout and ToggleMenuFlyout was not being displayed #4587

Merged

Conversation

marcelwgn
Copy link
Collaborator

Description

Update templates to contain the icon viewbox and update visual states to update the state correctly.

Motivation and Context

Closes #4473

How Has This Been Tested?

Tested manually.

Screenshots (if appropriate):

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 19, 2021
@StephenLPeters StephenLPeters added area-Flyouts team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 19, 2021
@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

@chingucoding can you share pics of what the states look like now. Also, can you take a quick look at the original PR and see if we are missing any other template parts ? Thanks!

@marcelwgn
Copy link
Collaborator Author

@chingucoding can you share pics of what the states look like now. Also, can you take a quick look at the original PR and see if we are missing any other template parts ? Thanks!

Screenshots:

Image of ToggleMenuFlyoutItem with icon being set

Image of RadioMenuFlyoutItem with icon being set

The only thing missing in the templates are the "KeyboardAcceleratorTextBlock", however I am not sure if this was a deliberate choice removing them or not. Maybe @tashatitova knows more about this?

@ranjeshj
Copy link
Contributor

@chingucoding can you share pics of what the states look like now. Also, can you take a quick look at the original PR and see if we are missing any other template parts ? Thanks!

Screenshots:

Image of ToggleMenuFlyoutItem with icon being set

Image of RadioMenuFlyoutItem with icon being set

The only thing missing in the templates are the "KeyboardAcceleratorTextBlock", however I am not sure if this was a deliberate choice removing them or not. Maybe @tashatitova knows more about this?

I don't think that is deliberate. We should add that back.

@marcelwgn
Copy link
Collaborator Author

Readded them now @ranjeshj .

@ranjeshj ranjeshj requested review from karkarl, teaP and YuliKl March 22, 2021 18:05
@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

@chingucoding can you share pics once more with the possible combinations ? @YuliKl @marksfoster can you double check this is good ?

@marcelwgn
Copy link
Collaborator Author

Sure Ranjesh, here more elaborate screenshots:

Screenshot of multiple different flyout items with icons and keyboard accelerators set

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@teaP teaP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I look at the generic.xaml version of the styles for MenuFlyoutItem and ToggleMenuFlyoutItem, they look much more up to date than what we currently have in here (e.g. they have Setters instead of these archaic Storyboards, the keyboard accelerator is in there, etc.). I'm not sure what the history is here, but it looks to me like both of these styles actually need to be updated to what generic.xaml has, minus reveal. Is that something you'd want to take on?

dev/CommonStyles/MenuFlyout_themeresources.xaml Outdated Show resolved Hide resolved
@marcelwgn
Copy link
Collaborator Author

marcelwgn commented Mar 24, 2021

#3958 deliberately changed the setters to objectanimations, that's why I thought that this would be the new way moving forward for these styles. So what is the correct way of doing this now? Were the changes of #3958 "incorrect" then @teaP ?

Edit: Looks like that there only was a movement of code, not replacement. None the less, what is the correct way here then?

@teaP
Copy link
Contributor

teaP commented Mar 24, 2021

#3958 deliberately changed the setters to objectanimations, that's why I thought that this would be the new way moving forward for these styles. So what is the correct way of doing this now? Were the changes of #3958 "incorrect" then @teaP ?

Edit: Looks like that there only was a movement of code, not replacement. None the less, what is the correct way here then?

We definitely should stick with setters anywhere there's no actual animation. I should have looked at #3958 more closely :P especially since it looks like we lost some things that you're adding back now.

@marcelwgn
Copy link
Collaborator Author

marcelwgn commented Mar 24, 2021

We definitely should stick with setters anywhere there's no actual animation. I should have looked at #3958 more closely :P especially since it looks like we lost some things that you're adding back now.

Well updated the menu flyout item styles now holistically to use setters where I was confident we can use a setter instead!

Out of curiosity, @teaP do you know why animations were used in the first place (as in why were those chosen few years ago instead of setters)?

@teaP
Copy link
Contributor

teaP commented Mar 24, 2021

We definitely should stick with setters anywhere there's no actual animation. I should have looked at #3958 more closely :P especially since it looks like we lost some things that you're adding back now.

Well updated the menu flyout item styles now holistically to use setters where I was confident we can use a setter instead!

Out of curiosity, @teaP do you know why animations were used in the first place (as in why were those chosen few years ago instead of setters)?

Thanks! Animations were historically used because VisualState.Setters didn't used to exist. :) It was added in TH1.

@marcelwgn
Copy link
Collaborator Author

Thanks! Animations were historically used because VisualState.Setters didn't used to exist. :) It was added in TH1.

OHhh I see, that makes sense, thank you @teaP !

Copy link
Contributor

@teaP teaP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping to clean this up!

dev/CommonStyles/MenuFlyout_themeresources.xaml Outdated Show resolved Hide resolved
dev/CommonStyles/MenuFlyout_themeresources.xaml Outdated Show resolved Hide resolved
@marcelwgn
Copy link
Collaborator Author

Problems should be resolved now.

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@teaP
Copy link
Contributor

teaP commented Mar 25, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit 585e0c6 into microsoft:master Mar 26, 2021
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Nov 28, 2023
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Flyouts team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToggleMenuFlyoutItem and RadioMenuFlyoutItem do not show assigned icon in winui 2.6 prerelease
4 participants