shell: Remove AppMenu
https://wiki.gnome.org/Initiatives/GnomeGoals/AppMenuRetirement
This commit is contained in:
parent
79dc78b819
commit
58d5c9411d
3 changed files with 40 additions and 15 deletions
|
@ -1787,7 +1787,7 @@ here</property>
|
|||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">open-menu-symbolic</property>
|
||||
<property name="icon_name">view-more-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
@ -227,8 +227,6 @@ static void
|
|||
cc_application_startup (GApplication *application)
|
||||
{
|
||||
CcApplication *self = CC_APPLICATION (application);
|
||||
GMenu *section;
|
||||
GMenu *menu;
|
||||
const gchar *help_accels[] = { "F1", NULL };
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (self),
|
||||
|
@ -246,18 +244,6 @@ cc_application_startup (GApplication *application)
|
|||
}
|
||||
#endif /* HAVE_WACOM || HAVE_CHEESE */
|
||||
|
||||
menu = g_menu_new ();
|
||||
|
||||
section = g_menu_new ();
|
||||
g_menu_append (section, _("Keyboard Shortcuts"), "win.show-help-overlay");
|
||||
g_menu_append (section, _("Help"), "app.help");
|
||||
g_menu_append (section, _("Quit"), "app.quit");
|
||||
|
||||
g_menu_append_section (menu, NULL, G_MENU_MODEL (section));
|
||||
|
||||
gtk_application_set_app_menu (GTK_APPLICATION (application),
|
||||
G_MENU_MODEL (menu));
|
||||
|
||||
gtk_application_set_accels_for_action (GTK_APPLICATION (application),
|
||||
"app.help", help_accels);
|
||||
|
||||
|
|
|
@ -166,6 +166,32 @@
|
|||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="menu_model">primary_menu</property>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject">
|
||||
<property name="accessible-name" translatable="yes">Primary Menu</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">open-menu-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
@ -233,4 +259,17 @@
|
|||
<signal name="response" handler="on_development_warning_dialog_responded_cb" object="CcWindow" swapped="no" />
|
||||
</object>
|
||||
|
||||
<menu id="primary_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">win.show-help-overlay</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Help</attribute>
|
||||
<attribute name="action">app.help</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
||||
</interface>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue