[gthumb] toolbar: show the metadata tools in browser mode as well



commit 63becb812d3e60e5bf3257e56a25609335dd33f4
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Feb 1 10:13:42 2020 +0100

    toolbar: show the metadata tools in browser mode as well

 extensions/edit_metadata/callbacks.c | 17 +++++++++++++++--
 extensions/list_tools/callbacks.c    |  2 +-
 gthumb/gth-browser.c                 | 11 ++++++++---
 gthumb/gth-browser.h                 |  2 ++
 4 files changed, 26 insertions(+), 6 deletions(-)
---
diff --git a/extensions/edit_metadata/callbacks.c b/extensions/edit_metadata/callbacks.c
index a4c0c469..aed0ad94 100644
--- a/extensions/edit_metadata/callbacks.c
+++ b/extensions/edit_metadata/callbacks.c
@@ -83,13 +83,26 @@ edit_metadata__gth_browser_construct_cb (GthBrowser *browser)
                                         G_N_ELEMENTS (file_list_actions));
 
        gth_browser_add_header_bar_button (browser,
-                                          GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT,
+                                          GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT_METADATA,
                                           "comment-symbolic",
                                           _("Comment"),
                                           "win.edit-metadata",
                                           NULL);
        gth_browser_add_header_bar_button (browser,
-                                          GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT,
+                                          GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT_METADATA,
+                                          "tag-symbolic",
+                                          _("Tags"),
+                                          "win.edit-tags",
+                                          NULL);
+
+       gth_browser_add_header_bar_button (browser,
+                                          GTH_BROWSER_HEADER_SECTION_BROWSER_METADATA_TOOLS,
+                                          "comment-symbolic",
+                                          _("Comment"),
+                                          "win.edit-metadata",
+                                          NULL);
+       gth_browser_add_header_bar_button (browser,
+                                          GTH_BROWSER_HEADER_SECTION_BROWSER_METADATA_TOOLS,
                                           "tag-symbolic",
                                           _("Tags"),
                                           "win.edit-tags",
diff --git a/extensions/list_tools/callbacks.c b/extensions/list_tools/callbacks.c
index 4b330e07..a6dff6b2 100644
--- a/extensions/list_tools/callbacks.c
+++ b/extensions/list_tools/callbacks.c
@@ -149,7 +149,7 @@ list_tools__gth_browser_construct_cb (GthBrowser *browser)
        gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
        gtk_widget_set_halign (GTK_WIDGET (gtk_menu_button_get_popup (GTK_MENU_BUTTON (button))), 
GTK_ALIGN_CENTER);
        gtk_widget_show (button);
-       gtk_box_pack_start (GTK_BOX (gth_browser_get_headerbar_section (browser, 
GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)), button, FALSE, FALSE, 0);
+       gtk_box_pack_end (GTK_BOX (gth_browser_get_headerbar_section (browser, 
GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)), button, FALSE, FALSE, 0);
 
        /* viewer edit */
 
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index e9925142..e62002a7 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2370,6 +2370,7 @@ _gth_browser_update_header_bar_content (GthBrowser *browser)
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS, 
section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW, 
section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS, 
section_visible);
+       _gth_browser_update_header_section_visibility (browser, 
GTH_BROWSER_HEADER_SECTION_BROWSER_METADATA_TOOLS, section_visible);
 
        active_tool = _gth_browser_file_tool_is_active (browser);
        section_visible = (page == GTH_BROWSER_PAGE_VIEWER) && ! active_tool;
@@ -2377,6 +2378,7 @@ _gth_browser_update_header_bar_content (GthBrowser *browser)
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_COMMANDS, 
section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_VIEW, 
section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT, 
section_visible);
+       _gth_browser_update_header_section_visibility (browser, 
GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT_METADATA, section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_SIDEBAR, 
section_visible);
        _gth_browser_update_header_section_visibility (browser, 
GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_COMMANDS, section_visible);
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW, 
section_visible);
@@ -4423,10 +4425,10 @@ gth_browser_init (GthBrowser *browser)
        for (i = 0; i < GTH_BROWSER_N_HEADER_SECTIONS; i++) {
                gboolean separated_buttons;
 
-               separated_buttons = ((i == GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)
+               separated_buttons = (/*(i == GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS)*/
                                     /*|| (i == GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_COMMANDS)*/
                                     /*|| (i == GTH_BROWSER_HEADER_SECTION_VIEWER_SIDEBAR)*/
-                                    || (i == GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW)
+                                    (i == GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW)
                                     /*|| (i == GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT)*/
                                     || (i == GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS));
 
@@ -4450,7 +4452,8 @@ gth_browser_init (GthBrowser *browser)
                gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS], 
GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
                gtk_widget_set_margin_start 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS], 
GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
                gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
-               gtk_widget_set_margin_start 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
+               gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
+               gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_SIDEBAR], 
GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
                gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT], GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
                gtk_widget_set_margin_start 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW], 
GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
                gtk_widget_set_margin_end 
(browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW], 
GTH_BROWSER_HEADER_BAR_BIG_MARGIN);
@@ -4495,9 +4498,11 @@ gth_browser_init (GthBrowser *browser)
                g_object_unref (builder);
 
                gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS]);
+               gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_METADATA_TOOLS]);
                gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW]);
 
                gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT]);
+               gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT_METADATA]);
                gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_VIEWER_SIDEBAR]);
 
                gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), 
browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_EDITOR_APPLY]);
diff --git a/gthumb/gth-browser.h b/gthumb/gth-browser.h
index 9a1ec17c..f3119802 100644
--- a/gthumb/gth-browser.h
+++ b/gthumb/gth-browser.h
@@ -86,6 +86,7 @@ typedef enum { /*< skip >*/
        GTH_BROWSER_HEADER_SECTION_BROWSER_LOCATIONS,
        GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS,
        GTH_BROWSER_HEADER_SECTION_BROWSER_TOOLS,
+       GTH_BROWSER_HEADER_SECTION_BROWSER_METADATA_TOOLS,
        GTH_BROWSER_HEADER_SECTION_BROWSER_VIEW,
        GTH_BROWSER_HEADER_SECTION_VIEWER_NAVIGATION,
        GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_VIEW,
@@ -95,6 +96,7 @@ typedef enum { /*< skip >*/
        GTH_BROWSER_HEADER_SECTION_VIEWER_OTHER_COMMANDS,
        GTH_BROWSER_HEADER_SECTION_VIEWER_SIDEBAR,
        GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT,
+       GTH_BROWSER_HEADER_SECTION_VIEWER_EDIT_METADATA,
        GTH_BROWSER_HEADER_SECTION_EDITOR_NAVIGATION,
        GTH_BROWSER_HEADER_SECTION_EDITOR_VIEW,
        GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS,


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