diff options
author | António Fernandes <antoniof@gnome.org> | 2019-06-22 18:54:02 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-03-10 14:02:25 +0000 |
commit | bd81bd895f15c7784a2487ea7d1006910ab0cb40 (patch) | |
tree | e8b59db9582cba13b9950cece471e8877b9ac190 /src/resources/ui/nautilus-files-view-context-menus.ui | |
parent | 3eb5e0e068b2ba29afd827b9ae14e6f10693e4fb (diff) | |
download | nautilus-bd81bd895f15c7784a2487ea7d1006910ab0cb40.tar.gz |
ui-utilities: Simplify GMenu handling
We have been iterating on menu items to match a custom attribute, "id",
in order to programatically add items to submenus and sections.
But GtkBuilder can get us the submenus and sections by actual id.
So take advantage of that and use the GMenu/GMenuModel API in a more
direct fashion.
Diffstat (limited to 'src/resources/ui/nautilus-files-view-context-menus.ui')
-rw-r--r-- | src/resources/ui/nautilus-files-view-context-menus.ui | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui b/src/resources/ui/nautilus-files-view-context-menus.ui index 9f0d23860..949abe5a4 100644 --- a/src/resources/ui/nautilus-files-view-context-menus.ui +++ b/src/resources/ui/nautilus-files-view-context-menus.ui @@ -5,8 +5,7 @@ <attribute name="label" translatable="yes">New _Folder</attribute> <attribute name="action">view.new-folder</attribute> </item> - <submenu> - <attribute name="id">templates-submenu</attribute> + <submenu id="templates-submenu"> <attribute name="label" translatable="yes">New _Document</attribute> <attribute name="action">view.new-document</attribute> <attribute name="hidden-when">action-disabled</attribute> @@ -37,19 +36,15 @@ <attribute name="hidden-when">action-disabled</attribute> </item> </section> - <section> - <attribute name="id">extensions</attribute> + <section id="background-extensions-section"> </section> </menu> <menu id="selection-menu"> - <section> - <attribute name="id">new-folder-with-selection-section</attribute> + <section id="new-folder-with-selection-section"> </section> - <section> - <attribute name="id">open-with-default-application-section</attribute> + <section id="open-with-default-application-section"> </section> - <submenu> - <attribute name="id">scripts-submenu</attribute> + <submenu id="scripts-submenu"> <attribute name="label" translatable="yes">_Scripts</attribute> <attribute name="action">view.scripts</attribute> <attribute name="hidden-when">action-disabled</attribute> @@ -85,8 +80,7 @@ <attribute name="hidden-when">action-disabled</attribute> </item> </section> - <section> - <attribute name="id">drive-section</attribute> + <section id="drive-section"> <item> <attribute name="label" translatable="yes">_Mount</attribute> <attribute name="action">view.mount-volume</attribute> @@ -197,8 +191,7 @@ <attribute name="hidden-when">action-disabled</attribute> </item> </section> - <section> - <attribute name="id">extensions</attribute> + <section id="selection-extensions-section"> <item> <attribute name="label" translatable="yes">_Extract Here</attribute> <attribute name="action">view.extract-here</attribute> @@ -239,4 +232,4 @@ </item> </section> </menu> -</interface>
\ No newline at end of file +</interface> |