[gthumb] shortcuts: use F10 to show the main menu



commit 6ada8faf9a3dc900ff72441a1b8eb6f7a274f9f2
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Jan 15 09:23:44 2020 +0100

    shortcuts: use F10 to show the main menu

 gthumb/gth-browser-actions-callbacks.c | 9 +++++++++
 gthumb/gth-browser-actions-callbacks.h | 1 +
 gthumb/gth-browser-actions-entries.h   | 2 ++
 gthumb/gth-browser.c                   | 7 +++++++
 gthumb/gth-browser.h                   | 1 +
 5 files changed, 20 insertions(+)
---
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index 35ac42cd..6ca6b7ae 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -605,3 +605,12 @@ gth_browser_activate_unselect_all (GSimpleAction *action,
        file_view = gth_browser_get_file_list_view (browser);
        gth_file_selection_unselect_all (GTH_FILE_SELECTION (file_view));
 }
+
+
+void
+gth_browser_activate_show_menu (GSimpleAction *action,
+                               GVariant      *state,
+                               gpointer       user_data)
+{
+       gth_browser_show_menu (GTH_BROWSER (user_data));
+}
diff --git a/gthumb/gth-browser-actions-callbacks.h b/gthumb/gth-browser-actions-callbacks.h
index d30dee43..b632724c 100644
--- a/gthumb/gth-browser-actions-callbacks.h
+++ b/gthumb/gth-browser-actions-callbacks.h
@@ -69,5 +69,6 @@ DEF_ACTION_CALLBACK (gth_browser_activate_show_next_image)
 DEF_ACTION_CALLBACK (gth_browser_activate_apply_editor_changes)
 DEF_ACTION_CALLBACK (gth_browser_activate_select_all)
 DEF_ACTION_CALLBACK (gth_browser_activate_unselect_all)
+DEF_ACTION_CALLBACK (gth_browser_activate_show_menu)
 
 #endif /* GTH_BROWSER_ACTIONS_CALLBACK_H */
diff --git a/gthumb/gth-browser-actions-entries.h b/gthumb/gth-browser-actions-entries.h
index 7a0dd26f..5eb38180 100644
--- a/gthumb/gth-browser-actions-entries.h
+++ b/gthumb/gth-browser-actions-entries.h
@@ -35,6 +35,7 @@ static const GActionEntry gth_browser_actions[] = {
        { "help", gth_browser_activate_show_help },
        { "about", gth_browser_activate_about },
        { "quit", gth_browser_activate_quit },
+       { "show-menu", gth_browser_activate_show_menu },
 
        { "browser-mode", gth_browser_activate_browser_mode },
        { "browser-edit-file", gth_browser_activate_browser_edit_file },
@@ -93,6 +94,7 @@ static const GthShortcut gth_browser_shortcuts[] = {
        { "help", N_("Help"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER | GTH_SHORTCUT_CONTEXT_FIXED, 
GTH_SHORTCUT_CATEGORY_GENERAL, "F1" },
        { "shortcuts", N_("Keyboard Shortcuts"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER | 
GTH_SHORTCUT_CONTEXT_FIXED, GTH_SHORTCUT_CATEGORY_GENERAL, "<Primary>F1" },
        { "quit", N_("Quit"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER | GTH_SHORTCUT_CONTEXT_FIXED, 
GTH_SHORTCUT_CATEGORY_GENERAL, "<Primary>q" },
+       { "show-menu", NULL, GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER | GTH_SHORTCUT_CONTEXT_FIXED, 
GTH_SHORTCUT_CATEGORY_GENERAL, "F10" },
 
        { "browser-mode", N_("Show browser"), GTH_SHORTCUT_CONTEXT_VIEWER | GTH_SHORTCUT_CONTEXT_INTERNAL, 
GTH_SHORTCUT_CATEGORY_GENERAL, "Escape" },
        { "close", N_("Close window"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_GENERAL, 
"<Primary>w" },
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index f9847060..f9399cec 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -7005,3 +7005,10 @@ gth_browser_keep_mouse_visible (GthBrowser *browser,
 {
        browser->priv->keep_mouse_visible = value;
 }
+
+
+void
+gth_browser_show_menu (GthBrowser *browser)
+{
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (browser->priv->menu_button), TRUE);
+}
diff --git a/gthumb/gth-browser.h b/gthumb/gth-browser.h
index d3dab8ad..9a1ec17c 100644
--- a/gthumb/gth-browser.h
+++ b/gthumb/gth-browser.h
@@ -286,6 +286,7 @@ GtkWidget *      gth_browser_get_fullscreen_headerbar
                                                    (GthBrowser       *browser);
 void             gth_browser_keep_mouse_visible     (GthBrowser              *browser,
                                                     gboolean          value);
+void             gth_browser_show_menu              (GthBrowser              *browser);
 
 /* utilities */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]