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

Improve KeyGesture.ToString() output in case when Key is set to Key.None #18353

Merged
merged 4 commits into from
Mar 8, 2025

Conversation

Samael7777
Copy link
Contributor

@Samael7777 Samael7777 commented Mar 2, 2025

What does the pull request do?

Improve KeyGesture.ToString() output in case when Key is set to Key.None

What is the current behavior?

When create a new KeyGesure like :

new KeyGesture(Key.None, KeyModifiers.Alt | KeyModifiers.Shift)

ToString() output string contains Shift+Alt+None

What is the updated/expected behavior with this PR?

Output string contains only modifiers (like Shift+Alt)

In case, if KeyGesture creates as

new KeyGesture(Key.None, KeyModifiers.None)

output string is None

@Samael7777 Samael7777 changed the title Improve ToString() output in case when Key is set to Key.None Improve KeyGesture.ToString() output in case when Key is set to Key.None Mar 2, 2025
Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

Could you please add this case to the KeyGestureTests.ToStringData/ParseData arrays so it's properly tested?

@Samael7777
Copy link
Contributor Author

Thank you for your contribution!

Could you please add this case to the KeyGestureTests.ToStringData/ParseData arrays so it's properly tested?

Add commits with KeyGesture.Parse changes with modifiers-only combination support, add cases in test

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Mar 2, 2025

  • All contributors have signed the CLA.

@Samael7777
Copy link
Contributor Author

@cla-avalonia agree

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@MrJul MrJul added this pull request to the merge queue Mar 8, 2025
Merged via the queue into AvaloniaUI:master with commit edaaf5b Mar 8, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants