[gnome-photos/menu-retirement: 18/18] Remove app menu
- From: Thomas An <yisooan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/menu-retirement: 18/18] Remove app menu
- Date: Mon, 14 Jan 2019 06:50:58 +0000 (UTC)
commit f997528dfdc688a94448df0d5ff1d1183671df80
Author: Yi-Soo An <yisooan gmail com>
Date: Tue Nov 20 17:29:36 2018 +0900
Remove app menu
According to the design guidelines[1], we remove app menu.
This patch includes below parts,
- Remove the app menu
- Add a primary menu to the main toolbar
- Change the menu icon in the image view to view-more-symbolic
[1]: https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement
https://gitlab.gnome.org/GNOME/gnome-photos/issues/117
po/POTFILES.in | 2 +-
src/Makefile.am | 2 +-
src/meson.build | 2 +-
src/photos-main-toolbar.c | 25 ++++++++++++++++++++++++-
src/photos-menus.ui | 28 ----------------------------
src/photos-preview-menu.ui | 4 ++++
src/photos-primary-menu.ui | 18 ++++++++++++++++++
src/photos.gresource.xml | 2 +-
8 files changed, 50 insertions(+), 33 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 919b9c18..d0b3cbf9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,10 +24,10 @@ src/photos-item-manager.c
src/photos-local-item.c
src/photos-main-toolbar.c
src/photos-main-window.c
-src/photos-menus.ui
src/photos-organize-collection-dialog.c
src/photos-preview-menu.ui
src/photos-preview-nav-buttons.c
+src/photos-primary-menu.ui
src/photos-print-notification.c
src/photos-print-operation.c
src/photos-print-setup.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 6e1969fe..5c63c717 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -455,8 +455,8 @@ EXTRA_DIST = \
photos-main-toolbar.ui \
photos-main-window.ui \
photos-marshalers.list \
- photos-menus.ui \
photos-preview-menu.ui \
+ photos-primary-menu.ui \
photos-removable-device-widget.ui \
photos-removable-devices-button.ui \
photos-selection-menu.ui \
diff --git a/src/meson.build b/src/meson.build
index 1ce52d06..f1eecc6f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -284,8 +284,8 @@ resource_data = files(
'photos-import-dialog.ui',
'photos-main-toolbar.ui',
'photos-main-window.ui',
- 'photos-menus.ui',
'photos-preview-menu.ui',
+ 'photos-primary-menu.ui',
'photos-removable-devices-button.ui',
'photos-removable-device-widget.ui',
'photos-selection-menu.ui',
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 396ef90e..649fc8e1 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -232,6 +232,25 @@ photos_main_toolbar_add_devices_button (PhotosMainToolbar *self)
}
+static void
+photos_main_toolbar_add_primary_menu_button (PhotosMainToolbar *self)
+{
+ GMenu *primary_menu;
+ g_autoptr (GtkBuilder) builder = NULL;
+ GtkWidget *menu_button;
+ GtkWidget *image;
+
+ builder = gtk_builder_new_from_resource ("/org/gnome/Photos/primary-menu.ui");
+
+ primary_menu = G_MENU (gtk_builder_get_object (builder, "primary-menu"));
+ image = gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_BUTTON);
+ menu_button = gtk_menu_button_new ();
+ gtk_button_set_image (GTK_BUTTON (menu_button), image);
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), G_MENU_MODEL (primary_menu));
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (self->header_bar), menu_button);
+}
+
+
static void
photos_main_toolbar_remote_display_button_clicked (PhotosMainToolbar *self)
{
@@ -440,6 +459,7 @@ photos_main_toolbar_populate_for_collection_view (PhotosMainToolbar *self)
{
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
+ photos_main_toolbar_add_primary_menu_button (self);
photos_main_toolbar_add_back_button (self);
photos_main_toolbar_add_selection_button (self);
photos_main_toolbar_add_search_button (self);
@@ -452,6 +472,7 @@ photos_main_toolbar_populate_for_collections (PhotosMainToolbar *self)
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (self->header_bar), self->stack_switcher);
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
+ photos_main_toolbar_add_primary_menu_button (self);
photos_main_toolbar_add_devices_button (self);
photos_main_toolbar_add_selection_button (self);
photos_main_toolbar_add_search_button (self);
@@ -483,6 +504,7 @@ photos_main_toolbar_populate_for_favorites (PhotosMainToolbar *self)
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (self->header_bar), self->stack_switcher);
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
+ photos_main_toolbar_add_primary_menu_button (self);
photos_main_toolbar_add_devices_button (self);
photos_main_toolbar_add_selection_button (self);
photos_main_toolbar_add_search_button (self);
@@ -522,6 +544,7 @@ photos_main_toolbar_populate_for_overview (PhotosMainToolbar *self)
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (self->header_bar), self->stack_switcher);
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (self->header_bar), TRUE);
+ photos_main_toolbar_add_primary_menu_button (self);
photos_main_toolbar_add_devices_button (self);
photos_main_toolbar_add_selection_button (self);
photos_main_toolbar_add_search_button (self);
@@ -547,7 +570,7 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
photos_main_toolbar_add_back_button (self);
preview_menu = photos_main_toolbar_create_preview_menu (self);
- image = gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_BUTTON);
+ image = gtk_image_new_from_icon_name ("view-more-symbolic", GTK_ICON_SIZE_BUTTON);
menu_button = gtk_menu_button_new ();
gtk_actionable_set_action_name (GTK_ACTIONABLE (menu_button), "app.gear-menu");
gtk_button_set_image (GTK_BUTTON (menu_button), image);
diff --git a/src/photos-preview-menu.ui b/src/photos-preview-menu.ui
index b72ff3bd..a257c6b8 100644
--- a/src/photos-preview-menu.ui
+++ b/src/photos-preview-menu.ui
@@ -36,6 +36,10 @@
<attribute name="action">app.properties</attribute>
<attribute name="label" translatable="yes">Properties</attribute>
</item>
+ <item>
+ <attribute name="action">app.fullscreen</attribute>
+ <attribute name="label" translatable="yes">Fullscreen</attribute>
+ </item>
</section>
</menu>
</interface>
diff --git a/src/photos-primary-menu.ui b/src/photos-primary-menu.ui
new file mode 100644
index 00000000..ae7c8e84
--- /dev/null
+++ b/src/photos-primary-menu.ui
@@ -0,0 +1,18 @@
+<interface>
+ <menu id="primary-menu">
+ <section>
+ <item>
+ <attribute name="action">win.show-help-overlay</attribute>
+ <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.help</attribute>
+ <attribute name="label" translatable="yes">_Help</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.about</attribute>
+ <attribute name="label" translatable="yes">About Photos</attribute>
+ </item>
+ </section>
+ </menu>
+</interface>
diff --git a/src/photos.gresource.xml b/src/photos.gresource.xml
index 76a81df4..ac868e75 100644
--- a/src/photos.gresource.xml
+++ b/src/photos.gresource.xml
@@ -28,6 +28,7 @@
<file alias="main-toolbar.ui" preprocess="xml-stripblanks"
compressed="true">photos-main-toolbar.ui</file>
<file alias="main-window.ui" preprocess="xml-stripblanks" compressed="true">photos-main-window.ui</file>
<file alias="preview-menu.ui" preprocess="xml-stripblanks"
compressed="true">photos-preview-menu.ui</file>
+ <file alias="primary-menu.ui" preprocess="xml-stripblanks"
compressed="true">photos-primary-menu.ui</file>
<file alias="removable-device-widget.ui" preprocess="xml-stripblanks"
compressed="true">photos-removable-device-widget.ui</file>
<file alias="removable-devices-button.ui" preprocess="xml-stripblanks"
compressed="true">photos-removable-devices-button.ui</file>
<file alias="selection-menu.ui" preprocess="xml-stripblanks"
compressed="true">photos-selection-menu.ui</file>
@@ -38,7 +39,6 @@
<gresource prefix="/org/gnome/Photos/gtk">
<file alias="help-overlay.ui" preprocess="xml-stripblanks"
compressed="true">photos-help-overlay.ui</file>
- <file alias="menus.ui" preprocess="xml-stripblanks" compressed="true">photos-menus.ui</file>
</gresource>
<gresource prefix="/org/gnome/Photos/icons">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]