[gnome-photos/menu-retirement: 4/4] Refactor secondary menu action name
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/menu-retirement: 4/4] Refactor secondary menu action name
- Date: Fri, 18 Jan 2019 12:53:40 +0000 (UTC)
commit ca2b5c4ae3d9158f4818533063d0e665817774b0
Author: Yi-Soo An <yisooan gmail com>
Date: Tue Jan 15 14:06:55 2019 +0900
Refactor secondary menu action name
Since primary menu has been added and the F10 works as a accelerator key,
All the name of actions related to secondary menu should have
a prefix as secondary or secondary-menu instead of gear-menu.
The prefix has more readability for the secondary menu.
src/photos-application.c | 12 ++++++------
src/photos-main-toolbar.c | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 26a71af6..6dab79c4 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -91,7 +91,7 @@ struct _PhotosApplication
GSimpleAction *edit_done_action;
GSimpleAction *edit_revert_action;
GSimpleAction *fs_action;
- GSimpleAction *gear_action;
+ GSimpleAction *secondary_menu_action;
GSimpleAction *import_action;
GSimpleAction *import_cancel_action;
GSimpleAction *insta_action;
@@ -527,7 +527,7 @@ photos_application_actions_update (PhotosApplication *self)
g_simple_action_set_enabled (self->load_previous_action, enable);
enable = (load_state == PHOTOS_LOAD_STATE_FINISHED && mode == PHOTOS_WINDOW_MODE_PREVIEW);
- g_simple_action_set_enabled (self->gear_action, enable);
+ g_simple_action_set_enabled (self->secondary_menu_action, enable);
g_simple_action_set_enabled (self->set_bg_action, enable);
g_simple_action_set_enabled (self->set_ss_action, enable);
g_simple_action_set_enabled (self->zoom_begin_action, enable);
@@ -2728,8 +2728,8 @@ photos_application_startup (GApplication *application)
self);
state = g_variant_new ("b", FALSE);
- self->gear_action = g_simple_action_new_stateful ("gear-menu", NULL, state);
- g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->gear_action));
+ self->secondary_menu_action = g_simple_action_new_stateful ("secondary-menu", NULL, state);
+ g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->secondary_menu_action));
self->import_action = g_simple_action_new ("import-current", NULL);
g_signal_connect_swapped (self->import_action, "activate", G_CALLBACK (photos_application_import), self);
@@ -2882,7 +2882,7 @@ photos_application_startup (GApplication *application)
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.delete", delete_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.edit-current", edit_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.fullscreen", fullscreen_accels);
- gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.gear-menu", menu_accels);
+ gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.secondary-menu", menu_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.help", help_menu_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.primary-menu", menu_accels);
gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.print-current", print_current_accels);
@@ -2969,7 +2969,7 @@ photos_application_dispose (GObject *object)
g_clear_object (&self->edit_done_action);
g_clear_object (&self->edit_revert_action);
g_clear_object (&self->fs_action);
- g_clear_object (&self->gear_action);
+ g_clear_object (&self->secondary_menu_action);
g_clear_object (&self->import_action);
g_clear_object (&self->import_cancel_action);
g_clear_object (&self->insta_action);
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index d82796b9..3d714257 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -45,7 +45,7 @@ struct _PhotosMainToolbar
{
GtkBox parent_instance;
GAction *search;
- GSimpleAction *gear_menu;
+ GSimpleAction *secondary_menu;
GtkWidget *favorite_button;
GtkWidget *header_bar;
GtkWidget *remote_display_button;
@@ -382,7 +382,7 @@ photos_main_toolbar_clear_toolbar (PhotosMainToolbar *self)
context = gtk_widget_get_style_context (self->header_bar);
gtk_style_context_remove_class (context, "selection-mode");
- g_simple_action_set_enabled (self->gear_menu, FALSE);
+ g_simple_action_set_enabled (self->secondary_menu, FALSE);
}
@@ -573,12 +573,12 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
preview_menu = photos_main_toolbar_create_preview_menu (self);
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_actionable_set_action_name (GTK_ACTIONABLE (menu_button), "app.secondary-menu");
gtk_button_set_image (GTK_BUTTON (menu_button), image);
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), G_MENU_MODEL (preview_menu));
gtk_header_bar_pack_end (GTK_HEADER_BAR (self->header_bar), menu_button);
- g_simple_action_set_enabled (self->gear_menu, TRUE);
+ g_simple_action_set_enabled (self->secondary_menu, TRUE);
share_button = gtk_button_new_from_icon_name ("emblem-shared-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_actionable_set_action_name (GTK_ACTIONABLE (share_button), "app.share-current");
@@ -718,7 +718,7 @@ photos_main_toolbar_init (PhotosMainToolbar *self)
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
- self->gear_menu = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (app), "gear-menu"));
+ self->secondary_menu = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (app), "secondary-menu"));
self->search = g_action_map_lookup_action (G_ACTION_MAP (app), "search");
action = g_action_map_lookup_action (G_ACTION_MAP (app), "selection-mode");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]