-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Code Quality: Added support for middle clicking in the new BreadcrumbBar #17476
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: main
Are you sure you want to change the base?
Code Quality: Added support for middle clicking in the new BreadcrumbBar #17476
Conversation
@@ -10,7 +10,7 @@ public partial class BreadcrumbBarItem | |||
{ | |||
private void ItemContentButton_Click(object sender, RoutedEventArgs e) | |||
{ | |||
OnItemClicked(); | |||
//OnItemClicked(); |
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.
Is this supposed to be commented out?
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.
Thought it would be better than removing the event handler to let poeple notice that this is already handled. Should we remove?
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.
If it's already handled, it should be removed.
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.
Done
@@ -279,7 +279,8 @@ private async void BreadcrumbBar_ItemClicked(Controls.BreadcrumbBar sender, Cont | |||
ViewModel.PathComponents[args.Index].Path is not { } path) | |||
return; | |||
|
|||
await ViewModel.HandleFolderNavigationAsync(path); | |||
var pointerUpdateKind = args.PointerRoutedEventArgs.GetCurrentPoint(null).Properties.PointerUpdateKind; | |||
await ViewModel.HandleFolderNavigationAsync(path, pointerUpdateKind is PointerUpdateKind.MiddleButtonReleased); |
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.
Instead of passing PointerUpdateKind.MiddleButtonReleased
directly, I think we can make the code easier to read if we add another variable like this var openInNewTab = PointerUpdateKind.MiddleButtonReleased
.
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.
Done.
Resolved / Related Issues
Steps used to test these changes