Removes duplicated entries from Layers Menu#1404
Conversation
Removes "Add New Layer", "Delete Layer", "Duplicate Layer" and "Merge Layer Down" from Layers Menu, as it is already present on the Layers Panel. Also adds the shortcuts to the respective buttons in the Layers Panel (on hover), making them more discoverable. Partially fixes #1386
|
Only problem is the keyboard shortcuts don't get translated on the hover effect as they were to the menu. I didn't want to hardcode because Primary might not be Ctrl (I believe in MacOS it is the Super key?). @cameronwhite, any ideas? |
|
I'd also suggest using Also, as every other shortcut related to the layers is Maybe even |
Restores shortcuts and removes the correct menu entries
|
I'd avoid adding the shortcut text in the command's label - this would start appearing for translators (which gets annoying especially if the shortcut ever changes), and also duplicates it. I think we could handle this more generically when toolbar buttons are created from a Gtk.Action, by appending the shortcut to the button's label when constructing the tooltip To get the shortcut, though, I think you'd need to call |
The problem is RegisterActions runs after LayerActions, so the shortcuts are not set yet when the labels are being created.
We would also need CreateToolBarItem to get access to the Gtk.Application instance in order to call GetAccelsForAction(). Maybe we could refactor Command to take an optional shortcut for an action and then assign it at creation time? Makes more sense to me and would be better integrated overall, also avoiding verbosity. |
|
I'll just close this MR and open a new one just removing the menu entries. We can work on the refactor showing keyboard shortcuts on a future MR. Opening an issue (#1408) for now. |

Removes "Add New Layer", "Delete Layer", "Duplicate Layer" and "Merge Layer Down" from Layers Menu, as it is already present on the Layers Panel. Also adds the shortcuts to the respective buttons in the Layers Panel (on hover), making them more discoverable.
Partially fixes #1386