[gthumb] fixed showing/hiding interface parts



commit 3c590964e84605d6c70330898bc70f4fb60395dc
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Nov 13 17:13:19 2019 +0100

    fixed showing/hiding interface parts

 gthumb/gth-browser-actions-callbacks.c | 39 ++++++++++++++++++++++++++++++++++
 gthumb/gth-browser-actions-callbacks.h |  3 +++
 gthumb/gth-browser-actions-entries.h   |  7 ++++++
 3 files changed, 49 insertions(+)
---
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index f6bb5c40..c3949d68 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -496,6 +496,19 @@ gth_browser_activate_show_statusbar (GSimpleAction *action,
 }
 
 
+void
+gth_browser_activate_toggle_statusbar (GSimpleAction *action,
+                                      GVariant      *state,
+                                      gpointer       user_data)
+{
+       GSettings *settings;
+
+       settings = g_settings_new (GTHUMB_BROWSER_SCHEMA);
+       g_settings_set_boolean (settings, PREF_BROWSER_STATUSBAR_VISIBLE, ! g_settings_get_boolean (settings, 
PREF_BROWSER_STATUSBAR_VISIBLE));
+       g_object_unref (settings);
+}
+
+
 void
 gth_browser_activate_show_sidebar (GSimpleAction *action,
                                   GVariant      *state,
@@ -511,6 +524,19 @@ gth_browser_activate_show_sidebar (GSimpleAction *action,
 }
 
 
+void
+gth_browser_activate_toggle_sidebar (GSimpleAction *action,
+                                    GVariant      *state,
+                                    gpointer       user_data)
+{
+       GSettings *settings;
+
+       settings = g_settings_new (GTHUMB_BROWSER_SCHEMA);
+       g_settings_set_boolean (settings, PREF_BROWSER_SIDEBAR_VISIBLE, ! g_settings_get_boolean (settings, 
PREF_BROWSER_SIDEBAR_VISIBLE));
+       g_object_unref (settings);
+}
+
+
 void
 gth_browser_activate_show_thumbnail_list (GSimpleAction *action,
                                          GVariant      *state,
@@ -526,6 +552,19 @@ gth_browser_activate_show_thumbnail_list (GSimpleAction *action,
 }
 
 
+void
+gth_browser_activate_toggle_thumbnail_list (GSimpleAction *action,
+                                           GVariant      *state,
+                                           gpointer       user_data)
+{
+       GSettings *settings;
+
+       settings = g_settings_new (GTHUMB_BROWSER_SCHEMA);
+       g_settings_set_boolean (settings, PREF_BROWSER_THUMBNAIL_LIST_VISIBLE, ! g_settings_get_boolean 
(settings, PREF_BROWSER_THUMBNAIL_LIST_VISIBLE));
+       g_object_unref (settings);
+}
+
+
 void
 gth_browser_activate_show_first_image (GSimpleAction *action,
                                       GVariant      *state,
diff --git a/gthumb/gth-browser-actions-callbacks.h b/gthumb/gth-browser-actions-callbacks.h
index fd979777..98c78703 100644
--- a/gthumb/gth-browser-actions-callbacks.h
+++ b/gthumb/gth-browser-actions-callbacks.h
@@ -59,6 +59,9 @@ DEF_ACTION_CALLBACK (gth_browser_activate_sort_by)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_statusbar)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_sidebar)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_thumbnail_list)
+DEF_ACTION_CALLBACK (gth_browser_activate_toggle_statusbar)
+DEF_ACTION_CALLBACK (gth_browser_activate_toggle_sidebar)
+DEF_ACTION_CALLBACK (gth_browser_activate_toggle_thumbnail_list)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_first_image)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_last_image)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_previous_image)
diff --git a/gthumb/gth-browser-actions-entries.h b/gthumb/gth-browser-actions-entries.h
index 0c26f98b..74bad7c0 100644
--- a/gthumb/gth-browser-actions-entries.h
+++ b/gthumb/gth-browser-actions-entries.h
@@ -60,6 +60,10 @@ static const GActionEntry gth_browser_actions[] = {
        { "show-sidebar", toggle_action_activated, NULL, "false", gth_browser_activate_show_sidebar },
        { "show-thumbnail-list", toggle_action_activated, NULL, "false", 
gth_browser_activate_show_thumbnail_list },
 
+       { "toggle-statusbar", gth_browser_activate_toggle_statusbar },
+       { "toggle-sidebar", gth_browser_activate_toggle_sidebar },
+       { "toggle-thumbnail-list", gth_browser_activate_toggle_thumbnail_list },
+
        { "show-first-image", gth_browser_activate_show_first_image },
        { "show-last-image", gth_browser_activate_show_last_image },
        { "show-previous-image", gth_browser_activate_show_previous_image },
@@ -83,6 +87,9 @@ static const GthShortcut gth_browser_shortcuts[] = {
        { "open-location", N_("Open location"), GTH_SHORTCUT_CONTEXT_BROWSER, 
GTH_SHORTCUT_CATEGORY_NAVIGATION, "o" },
        { "fullscreen", N_("Fullscreen"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_VIEWER, 
"f" },
        { "revert-to-saved", N_("Revert image to saved"), GTH_SHORTCUT_CONTEXT_BROWSER, 
GTH_SHORTCUT_CATEGORY_FILE_MANAGER, "F4" },
+       { "toggle-sidebar", N_("Sidebar"), GTH_SHORTCUT_CONTEXT_BROWSER, GTH_SHORTCUT_CATEGORY_UI, "F9" },
+       { "toggle-statusbar", N_("Statusbar"), GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER, GTH_SHORTCUT_CATEGORY_UI, 
"F7" },
+       { "toggle-thumbnail-list", N_("Thumbnails list"), GTH_SHORTCUT_CONTEXT_VIEWER, 
GTH_SHORTCUT_CATEGORY_UI, "F8" },
 
        { "go-back", N_("Load previuos location"), GTH_SHORTCUT_CONTEXT_BROWSER, 
GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Left" },
        { "go-forward", N_("Load next location"), GTH_SHORTCUT_CONTEXT_BROWSER, 
GTH_SHORTCUT_CATEGORY_NAVIGATION, "<Alt>Right" },


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