[gthumb] usa a Close button if the image tool doesn't change the image



commit 19a9828e2359f8cabe90fe2c4634931a4d101fbb
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Feb 26 11:29:28 2017 +0100

    usa a Close button if the image tool doesn't change the image

 gthumb/gth-browser.c   |    6 ++++++
 gthumb/gth-file-tool.c |   17 +++++++++++++++++
 gthumb/gth-file-tool.h |    3 +++
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 54993fc..d86a32d 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -183,6 +183,7 @@ struct _GthBrowserPrivate {
        GthICCProfile      screen_profile;
        GtkTreePath       *folder_tree_last_dest_row; /* used to open a folder during D&D */
        guint              folder_tree_open_folder_id;
+       GtkWidget         *apply_editor_changes_button;
 
        /* settings */
 
@@ -2417,8 +2418,11 @@ _gth_browser_update_header_bar_content (GthBrowser *browser)
                toolbox = gth_sidebar_get_toolbox (GTH_SIDEBAR (browser->priv->file_properties));
                file_tool = gth_toolbox_get_active_tool (GTH_TOOLBOX (toolbox));
                section_visible = gth_file_tool_get_zoomable (GTH_FILE_TOOL (file_tool));
+               gtk_button_set_label (GTK_BUTTON (browser->priv->apply_editor_changes_button),
+                                     gth_file_tool_get_changes_image (GTH_FILE_TOOL (file_tool)) ? 
_("Accept") : _("_Close"));
        }
        _gth_browser_update_header_section_visibility (browser, GTH_BROWSER_HEADER_SECTION_VIEWER_ZOOM, 
section_visible);
+
        gtk_widget_set_visible (browser->priv->menu_button, ! ((page == GTH_BROWSER_PAGE_VIEWER) && 
active_tool));
 
        gth_browser_update_title (browser);
@@ -4608,6 +4612,7 @@ gth_browser_init (GthBrowser *browser)
 #ifdef GTK_STYLE_CLASS_SUGGESTED_ACTION
                gtk_style_context_add_class (gtk_widget_get_style_context (button), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
 #endif
+               browser->priv->apply_editor_changes_button = button;
        }
 
        /* fullscreen toolbar */
@@ -5375,6 +5380,7 @@ gth_browser_add_header_bar_label_button (GthBrowser                       *browser,
        g_return_val_if_fail (label != NULL, NULL);
 
        button = gtk_button_new_with_label (label);
+       gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
        _gth_browser_setup_header_bar_button (browser, section, tooltip, action_name, accelerator, button);
 
        return button;
diff --git a/gthumb/gth-file-tool.c b/gthumb/gth-file-tool.c
index d92a99b..1f44d73 100644
--- a/gthumb/gth-file-tool.c
+++ b/gthumb/gth-file-tool.c
@@ -40,6 +40,7 @@ struct _GthFileToolPrivate {
        GthToolboxSection        section;
        gboolean                 cancelled;
        gboolean                 zoomable;
+       gboolean                 changes_image;
 };
 
 
@@ -154,6 +155,7 @@ gth_file_tool_init (GthFileTool *self)
        self->priv->options_title = NULL;
        self->priv->cancelled = FALSE;
        self->priv->zoomable = FALSE;
+       self->priv->changes_image = TRUE;
        self->priv->section = GTH_TOOLBOX_SECTION_COLORS;
 
        /*gtk_button_set_relief (GTK_BUTTON (self), GTK_RELIEF_NONE);*/
@@ -248,6 +250,21 @@ gth_file_tool_get_zoomable (GthFileTool *self)
 
 
 void
+gth_file_tool_set_changes_image (GthFileTool *self,
+                                gboolean     value)
+{
+       self->priv->changes_image = value;
+}
+
+
+gboolean
+gth_file_tool_get_changes_image (GthFileTool *self)
+{
+       return self->priv->changes_image;
+}
+
+
+void
 gth_file_tool_update_sensitivity (GthFileTool *self)
 {
        GTH_FILE_TOOL_GET_CLASS (self)->update_sensitivity (self);
diff --git a/gthumb/gth-file-tool.h b/gthumb/gth-file-tool.h
index a4af3ba..5fd6faa 100644
--- a/gthumb/gth-file-tool.h
+++ b/gthumb/gth-file-tool.h
@@ -77,6 +77,9 @@ gboolean              gth_file_tool_is_cancelled              (GthFileTool            
*self);
 void                   gth_file_tool_set_zoomable              (GthFileTool            *self,
                                                                 gboolean                zoomable);
 gboolean               gth_file_tool_get_zoomable              (GthFileTool            *self);
+void                   gth_file_tool_set_changes_image         (GthFileTool            *self,
+                                                                gboolean                value);
+gboolean               gth_file_tool_get_changes_image         (GthFileTool            *self);
 void                   gth_file_tool_update_sensitivity        (GthFileTool            *self);
 GtkWidget *            gth_file_tool_get_options               (GthFileTool            *self);
 const char *           gth_file_tool_get_options_title         (GthFileTool            *self);


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