[gthumb] rename: optionally use the header-bar
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] rename: optionally use the header-bar
- Date: Mon, 28 Dec 2015 14:59:30 +0000 (UTC)
commit bc444b87ecd651725c033348bee7098752fef8a6
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Dec 28 15:48:02 2015 +0100
rename: optionally use the header-bar
extensions/rename_series/dlg-rename-series.c | 21 +++++++++++++++++--
.../rename_series/gth-template-editor-dialog.c | 7 +++++-
2 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/extensions/rename_series/dlg-rename-series.c b/extensions/rename_series/dlg-rename-series.c
index 54f61d9..0a98de6 100644
--- a/extensions/rename_series/dlg-rename-series.c
+++ b/extensions/rename_series/dlg-rename-series.c
@@ -468,7 +468,7 @@ load_file_data_task_completed_cb (GthTask *task,
gtk_widget_hide (GET_WIDGET ("task_box"));
gtk_widget_set_sensitive (GET_WIDGET ("options_table"), TRUE);
- gtk_widget_set_sensitive (GET_WIDGET ("ok_button"), TRUE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK, TRUE);
data->tasks = g_list_remove (data->tasks, update_data->task);
@@ -518,7 +518,7 @@ update_file_list (DialogData *data,
GtkWidget *child;
gtk_widget_set_sensitive (GET_WIDGET ("options_table"), FALSE);
- gtk_widget_set_sensitive (GET_WIDGET ("ok_button"), FALSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK, FALSE);
gtk_widget_show (GET_WIDGET ("task_box"));
update_data->task = gth_load_file_data_task_new (data->file_list,
data->required_attributes);
@@ -840,7 +840,22 @@ dlg_rename_series (GthBrowser *browser,
/* Get the widgets. */
- data->dialog = _gtk_builder_get_widget (data->builder, "rename_series_dialog");
+ data->dialog = g_object_new (GTK_TYPE_DIALOG,
+ "title", _("Rename"),
+ "transient-for", GTK_WINDOW (browser),
+ "modal", FALSE,
+ "destroy-with-parent", FALSE,
+ "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+ NULL);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (data->dialog))),
+ _gtk_builder_get_widget (data->builder, "dialog_content"));
+ gtk_dialog_add_buttons (GTK_DIALOG (data->dialog),
+ _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
+ _("_Rename"), GTK_RESPONSE_OK,
+ NULL);
+ gtk_style_context_add_class (gtk_widget_get_style_context (gtk_dialog_get_widget_for_response
(GTK_DIALOG (data->dialog), GTK_RESPONSE_OK)),
+ GTK_STYLE_CLASS_SUGGESTED_ACTION);
+
gth_browser_set_dialog (browser, "rename_series", data->dialog);
g_object_set_data (G_OBJECT (data->dialog), "dialog_data", data);
diff --git a/extensions/rename_series/gth-template-editor-dialog.c
b/extensions/rename_series/gth-template-editor-dialog.c
index f29122e..7ea681f 100644
--- a/extensions/rename_series/gth-template-editor-dialog.c
+++ b/extensions/rename_series/gth-template-editor-dialog.c
@@ -165,6 +165,9 @@ gth_template_editor_dialog_construct (GthTemplateEditorDialog *self,
gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (self), _GTK_LABEL_OK, GTK_RESPONSE_OK);
+ gtk_style_context_add_class (gtk_widget_get_style_context (gtk_dialog_get_widget_for_response
(GTK_DIALOG (self), GTK_RESPONSE_OK)),
+ GTK_STYLE_CLASS_SUGGESTED_ACTION);
+
self->priv->content = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (self->priv->content), 5);
gtk_widget_show (self->priv->content);
@@ -234,7 +237,9 @@ gth_template_editor_dialog_new (GthTemplateCode *allowed_codes,
{
GthTemplateEditorDialog *self;
- self = g_object_new (GTH_TYPE_TEMPLATE_EDITOR_DIALOG, NULL);
+ self = g_object_new (GTH_TYPE_TEMPLATE_EDITOR_DIALOG,
+ "use-header-bar", _gtk_settings_get_dialogs_use_header (),
+ NULL);
gth_template_editor_dialog_construct (self, allowed_codes, n_codes, title, parent);
return (GtkWidget *) self;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]