Commit 19a9828e authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

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

parent 35e2aba4
......@@ -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;
......
......@@ -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);*/
......@@ -247,6 +249,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)
{
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment