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

Allow ordering of custom menu entries #37

Open
MESLewis opened this issue Feb 14, 2020 · 5 comments
Open

Allow ordering of custom menu entries #37

MESLewis opened this issue Feb 14, 2020 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@MESLewis
Copy link

MESLewis commented Feb 14, 2020

Right now all ShellAnything menu entries are inserted near the middle of the context menu.
I'm interested in heavy configuration of the menu and I would like to be able to add options near the top(ex "Edit" or "Open with Notepad++") and bottom(ex Properties) as well.

From my research I believe this may not be a straight forward change.

@end2endzone end2endzone added enhancement New feature or request question Further information is requested labels Feb 15, 2020
@end2endzone
Copy link
Owner

Hi.

This looks like a good idea. However, could you clarify your point because I do not exactly understand what you are proposing. The order in which each menu appears in a context menu is defined by the order in the xml file. If you want a menu to be inserted before another, you can define a <menu> node before the other.

For example, the following menus

    <menu name="test">
    </menu>
    <menu name="foo">
    </menu>
    <menu name="bar">
    </menu>

will be inserted in the context menu in the exact same order:
image

@end2endzone
Copy link
Owner

Maybe you are proposing to order the menus across xml configuration files. Like if file1.xml contains menu1 and file2.xml contains menu2 and you would like to order menu1 before/after menu2. Do I understand your idea?

It does not seems to a complicated task. However, I am currently working on #36 modifying win32Clipboard. to support utf-8 strings.

Would you like to contribute to the project? I am open to push request.

@MESLewis
Copy link
Author

Thank you for the response, apologies for the late reply. I updated the original issue to clarify. Good to know what ordering options there are in the mean time.

I'm looking to do some in depth customization of menu options, I'll definitely take a look at the code and see where I can help

@end2endzone
Copy link
Owner

Apologies for the late reply. That could be possible.

A shell extension like ShellAnything is a plugin for Windows File Explore. File Explorer is providing a pre-build menu (HMENU) when calling CContextMenu::QueryContextMenu().

Manipulating this menu can be tedious and can result in system instabilities. The problem is that menu manipulation could break other shell extensions expectations. More investigation is required on this issue.

@end2endzone
Copy link
Owner

Another problem is alignment based on previous menus from other shell extensions.

A possible way to implement this could be by creating after or before attributes for <menu> elements. For example, to insert test menu after the AMD Radeon Settings, one could declare the menus as the following:

<menu name="test" after="AMD Radeon Settings">
</menu>
<menu name="foo">
</menu>
<menu name="bar" before="Git GUI Here">
</menu>

However, this could be problematic. When File Explorer call ShellAnything to render its menus, there is no guaranty that AMD Radeon Settings or Git GUI Here menus are already drawn. The alignment could not work as the user expect it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants