-
Notifications
You must be signed in to change notification settings - Fork 35
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 hiding and disabling of menu items with submenus #1859
Comments
supported files. Related to: Allow to hide .sublime-menu folders sublimehq/sublime_text#1859
@evandrocoan can you clarify why you don't believe this is a duplicate of #1095 please? is the main difference that you want to control the visibility of the parent menu item "folder" explicitly, as opposed to just automatically having the parent hidden when all of it's children are hidden/disabled? |
@keith-hall I think so, yes. I generally prefer this approach over #1095, because this shows clear intent that a parent item should be disabled or hidden rather than implicitly doing it when a sub-menu has no visible or enabled items. Sometimes a user might want to see this specifically. I vote to close #1095 as a duplicate in favor of this more general suggestion. @evandrocoan In your code example, I believe your |
Allow to hide .sublime-menu folders sublimehq/sublime_text#1859
Hide Anaconda context menu entry on non-python projects DamnWidget#571 Allow to hide .sublime-menu folders sublimehq/sublime_text#1859
You are right @FichteFoll, I updated the issue. @keith-hall, the package SublimeLinter, has menu entries which are not disabled when it is on a non-linted project. Therefore it would also not be enough to just check whether all entries are disabled. Perhaps I could also want to some |
Hide Anaconda context menu entry on non-python projects DamnWidget#571 Allow to hide .sublime-menu folders sublimehq/sublime_text#1859
+1 for this feature request |
+1 from me as well Perhaps just add the ability to call specific menu checkers from the JSON object itself. So something like: {
"caption": "My Menu",
"id": "my_menu",
"children": [],
"is_visible": "my_is_visible_function", // leverage the "id" to look for the class
"is_enabled": "my_is_enabled_function", // see "is_visible"
"args": {"paths": []}
} class MyMenu(sublime_plugin.WindowCommand):
def MyIsVisibleFunction( self, paths = [] ):
return True
def MyIsEnabledFunction( self, paths = [] ):
return False I dunno, just hoping this makes it in somehow someway. |
If a package group several of its menu's entries in a sub-menu, we currently cannot hide
folder
on non-related projects files:I would suggest to hide each folder the same way the menu's entries are hidden.
Context.sublime-menu
-->
Here the
sublimelinter_main_linter_context_menu
would never be called to run a action, but just to check whether it is visible or not, as in:Note, if different
Context.sublime-menu
file define the same folder, they are independent from each other, so hiding the folder from one, should not remove the folder entries from the other folder. For example, the package Anaconda, and its related packages as Anaconda-Rust, both define the folder menuAnaconda
, so when the main Anaconda package say to hide the folder, it should not hide the other package's defined folders.Related issues:
The text was updated successfully, but these errors were encountered: