-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Bringing custom shellcontextmenu #699
Conversation
@BuraChuhadar This is really exciting! Do you want me to mark this as a draft for now? |
Sounds good please mark it as draft. I am still working on it. |
@BuraChuhadar Will this solve #719? |
@yaichenbaum I am currently working on phase 1. So I am not planning to bring File > New options yet. For those the full menu needs to re-written to close #719 . I am not sure how do you want to approach to that. |
Lets keep this limited to open with for now, however to plan ahead, is there a central place in the registry to pull a list of the item types you can create? |
I think i need some clarification on this. As far as i understand this retrives the "open with" options for a filetype from the registry. |
You cannot bring File > New options from the registry. You would need to read it from the shell 32 DLL instead. |
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.
Please address comment regarding WindowsPrincipal
Just saw this now. Let me know if this should be a draft. Hopefully my feedback helps guide you, but I really like these changes so far, |
@yaichenbaum I finalized the code no need to draft it. Please take a look. I am seeing WindowsPrincipal class is being supported. If you still think that isn't the case or if there is a way to check if it is supported under UWP then I can take a look. |
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 am seeing it as supported under UWP: https://stackoverflow.com/questions/36713824/how-to-get-group-infolike-guest-admin-etc-of-current-login-user-in-uwp-windo. Let me know if this is a concern.
@BuraChuhadar The stack overflow link you sent stated that the API is intended for use inside a brokered component rather than the UWP component. It doesn't seem supported here: https://docs.microsoft.com/en-us/dotnet/api/?view=dotnet-uwp-10.0&term=principal |
OK, I will take a look no problem to address WIndows Principal code. |
@BuraChuhadar Actually, I think it would be better if we removed that part altogether because modern Windows will essentially deprecate the concept of admin vs standard user. With the WinRT sandbox, users expect to be standard users, so we should always assume they are. |
69011fc
to
35e95b5
Compare
@duke7553 it has been a while I couldn't focus on this. I added the changes you mentioned. Let's finish the phase one of this implementation. I will continue adding more features around this. Let me know if it looks good now. The administration security check has been removed from the code. |
@yaichenbaum this is ready for review. I took a step back and changed my decision from adding the icons due to restrictions of IconElement class under MenuFlyout class. I would wait to see WinUI 3.0 will deliver something better. I am going to attach this discussion related to the FlyoutMenu icons: microsoft/microsoft-ui-xaml#1494 I updated the current: 1- Bringing CommandLineToArgvW to parse command registry from Win32API At this point this PR getting quite large. I would suggest let's merge this in as I will continue with other approaches to improve the overall quality with the context menus to pair up the functionality as much as I can with Windows' native explorer. I am looking forward to hearing about the feedback. |
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.
Very excellent work! Users will love this feature
@tsvietOK I will add a null check around that in that case you won't be able to load the extra shell menu items. Thank you for sharing it. |
Never mind. I found the problem. I sent a fix for it and fixed the merge conflicts. |
@BuraChuhadar For some reason extended context menu displaying only after second right click on folder(or select it before right click). As i understand for the moment extended context menu is not working for files. |
@tsvietOK it should work for files as well. I didn't try directly right clicking. I will check once I have the chance. |
@tsvietOK sent another fix. I see that the opening of the context menu wasn't synchronizing with the UI correctly given that the registry call method was async. I sent a fix by simply waiting for the registry method read task to complete. Please let me know if you see anything else. Thanks. |
@BuraChuhadar I tested the latest changes and for the first time, I was able to get it working 🎉. It feels kind of off without the icons, we are using custom icons in menus in a couple of places so if you are running into issues, let us know so we can work together to improve the UI. |
@BuraChuhadar I am probably doing something wrong, but when i right clicking on file, displaying only standard context menu. Can you share example screenshot on how it should look like. |
@yaichenbaum I won't be addressing the icons as I mentioned above. Native explorer has the same behavior. You are welcome to send another PR for the icons. @tsvietOK please send me your reproducible steps. Otherwise, I would suggest merging these changes and address issues on later tickets. You are welcome to assign to me the upcoming issues. Here is the video of working changes with directory and files. It is a youtube video click on it to see it under youtube: |
@BuraChuhadar maybe i don't have supported apps installed. |
@tsvietOK this feature won't use shell context extensions. Which in this case Notepad++ is using shell context extensions. I am seeing there are articles around Microsoft not interested in supporting shell context extensions and yet there is still software out there using this. Even PowerToys under Microsoft project is using this. I will try to bring shell context extension support with a different PR at the moment this PR supports only static shell context menus. |
@BuraChuhadar If this is ready to merge, I'd like to do so considering the vast amount of work you put into this. I'm really impressed! |
@duke7553 it is ready to merge. Thank you for the feedback. |
@BuraChuhadar Great work on this PR! As far as I can tell, File Explorer does show the icons in the right click context menu. |
@xpoppyx you won't see all the available items in context menu from the explorer. This feature only implements the static context menus, not the dynamic ones. File a bug and assign it to me if you see there are potential issues with reproducible steps. |
@yaichenbaum not all the items under the native explorer has icons that's what I meant. MenuFlyout also doesn't support bitmap images so I am OK leaving like this. If you have a proposal or a helper method to assign bitmaps to a menu flyout component then I can bring the icons. |
That makes sense, in the future we should try to get that working. In the meantime your work helped implement one of the most requested features 🎉. |
@yaichenbaum implementing that would be challenging because the dynamic shell context menus are using COM implementation and depending on the STA or MTA thread apartment the rendering of the shell context menu changes. I am thinking to see if I can bring something by using PowerShell or cmd to query the shell context menu and render it like that. I will create another PR once I see it is possible. |
{ | ||
AllView.SelectedItems.Add(item); | ||
AllView.SelectedItem = selectedItem; |
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.
What purpose of this change? This broke file selection. File size on status bar is not more visible when changing view mode from GridViewBrowser
to GenericFileBrowser
and back.
No description provided.