diff options
author | Ignacio Casal Quinteiro <icq@gnome.org> | 2016-03-30 23:31:38 +0200 |
---|---|---|
committer | Ignacio Casal Quinteiro <icq@gnome.org> | 2016-03-30 23:32:05 +0200 |
commit | 740cf4a51206145f955412e9386fde7f16e29760 (patch) | |
tree | 29a61d870c01a96e7cbc368a6cb9ce32e12ce847 | |
parent | ad15a3a553eeb59cc8b7fb6cf7b31184149c7acd (diff) | |
download | gedit-wip/menus.tar.gz |
Use menubar only for OSX and Unitywip/menus
They are the only 2 cases where a menubar might work but on
the other cases a menubar will be shown between the sidebar and
the normal window behaving really weird.
-rw-r--r-- | gedit/gedit-app.c | 16 | ||||
-rw-r--r-- | gedit/resources/gtk/menus-traditional.ui | 136 |
2 files changed, 150 insertions, 2 deletions
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c index c3a0a4762..e21b3bd95 100644 --- a/gedit/gedit-app.c +++ b/gedit/gedit-app.c @@ -765,6 +765,9 @@ gedit_app_startup (GApplication *application) const gchar *cache_dir; gchar *metadata_filename; #endif +#ifndef OS_OSX + const gchar *current_desktop; +#endif priv = gedit_app_get_instance_private (GEDIT_APP (application)); @@ -797,7 +800,16 @@ gedit_app_startup (GApplication *application) application); /* menus */ - priv->hamburger_menu = get_menu_model (GEDIT_APP (application), "hamburger-menu"); +#ifndef OS_OSX + /* We will use a menubar with osx or unity */ + current_desktop = g_getenv ("XDG_CURRENT_DESKTOP"); + if (current_desktop == NULL || + g_ascii_strcasecmp (current_desktop, "Unity") != 0) + { + priv->hamburger_menu = get_menu_model (GEDIT_APP (application), + "hamburger-menu"); + } +#endif priv->notebook_menu = get_menu_model (GEDIT_APP (application), "notebook-menu"); priv->tab_width_menu = get_menu_model (GEDIT_APP (application), "tab-width-menu"); priv->line_col_menu = get_menu_model (GEDIT_APP (application), "line-col-menu"); @@ -1920,7 +1932,7 @@ _gedit_app_get_line_col_menu (GeditApp *app) GeditMenuExtension * _gedit_app_extend_menu (GeditApp *app, - const gchar *extension_point) + const gchar *extension_point) { GeditAppPrivate *priv; GMenuModel *model; diff --git a/gedit/resources/gtk/menus-traditional.ui b/gedit/resources/gtk/menus-traditional.ui index 6c8ef997e..e7a9c771a 100644 --- a/gedit/resources/gtk/menus-traditional.ui +++ b/gedit/resources/gtk/menus-traditional.ui @@ -1,6 +1,142 @@ <?xml version="1.0"?> <interface> <!-- interface-requires gtk+ 3.0 --> + <menu id="hamburger-menu"> + <section> + <attribute name="id">juntion-section</attribute> + <attribute name="display-hint">horizontal-buttons</attribute> + <item> + <attribute name="label" translatable="yes">_Reload</attribute> + <attribute name="action">win.revert</attribute> + <attribute name="verb-icon">view-refresh-symbolic</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Print…</attribute> + <attribute name="action">win.print</attribute> + <attribute name="verb-icon">printer-symbolic</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Fullscreen</attribute> + <attribute name="action">win.fullscreen</attribute> + <attribute name="verb-icon">view-fullscreen-symbolic</attribute> + </item> + </section> + <section> + <attribute name="id">file-section</attribute> + </section> + <section> + <attribute name="id">file-section-1</attribute> + <item> + <attribute name="label" translatable="yes">_Save As…</attribute> + <attribute name="action">win.save-as</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Save _All</attribute> + <attribute name="action">win.save-all</attribute> + </item> + </section> + <section> + <attribute name="id">edit-section</attribute> + </section> + <section> + <attribute name="id">edit-section-1</attribute> + </section> + <section> + <attribute name="id">search-section</attribute> + <item> + <attribute name="label" translatable="yes">_Find…</attribute> + <attribute name="action">win.find</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Find and Replace…</attribute> + <attribute name="action">win.replace</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Clear Highlight</attribute> + <attribute name="action">win.clear-highlight</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Go to Line…</attribute> + <attribute name="action">win.goto-line</attribute> + </item> + </section> + <section> + <submenu> + <attribute name="label" translatable="yes">View</attribute> + <section> + <attribute name="id">view-section</attribute> + <item> + <attribute name="label" translatable="yes">Side _Panel</attribute> + <attribute name="action">win.side-panel</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Bottom Panel</attribute> + <attribute name="action">win.bottom-panel</attribute> + <attribute name="hidden-when">action-disabled</attribute> + </item> + </section> + <section> + <attribute name="id">view-section-1</attribute> + </section> + <section> + <attribute name="id">view-section-2</attribute> + <item> + <attribute name="label" translatable="yes">_Highlight Mode…</attribute> + <attribute name="action">win.highlight-mode</attribute> + </item> + </section> + </submenu> + <submenu> + <attribute name="label" translatable="yes">Tools</attribute> + <section> + <attribute name="id">spell-section</attribute> + </section> + <section> + <attribute name="id">tools-section</attribute> + </section> + <section> + <attribute name="id">tools-section-1</attribute> + </section> + </submenu> + </section> + <section> + <attribute name="id">preferences-section</attribute> + <item> + <attribute name="label" translatable="yes">_Preferences</attribute> + <attribute name="action">app.preferences</attribute> + </item> + </section> + <section> + <attribute name="id">help-section</attribute> + <item> + <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute> + <attribute name="action">app.shortcuts</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Help</attribute> + <attribute name="action">app.help</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_About</attribute> + <attribute name="action">app.about</attribute> + </item> + </section> + <section> + <attribute name="id">close-section</attribute> + <item> + <attribute name="label" translatable="yes">_Close All</attribute> + <attribute name="action">win.close-all</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Close</attribute> + <attribute name="action">win.close</attribute> + </item> + <item> + <attribute name="label" translatable="yes">_Quit</attribute> + <attribute name="action">app.quit</attribute> + </item> + </section> + </menu> <menu id="menubar"> <section> <submenu> |