[Commits] [SCM] claws branch, master, updated. 3.16.0-154-ga9b219b

wwp at claws-mail.org wwp at claws-mail.org
Sat May 5 23:56:37 CEST 2018


The branch, master has been updated
       via  a9b219b3c46c56042206e699344f0d486e0c615d (commit)
      from  19db831c415e9b60f7ef0bc6d28ecf761e847d6f (commit)

Summary of changes:
 src/action.c       |   30 +++++++++++++++++++++++++++---
 src/prefs_common.c |    5 +++++
 src/prefs_common.h |    2 ++
 3 files changed, 34 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit a9b219b3c46c56042206e699344f0d486e0c615d
Author: wwp <wwp at free.fr>
Date:   Sat May 5 23:56:13 2018 +0200

    Save and reuse Actions input/output dialog size.

diff --git a/src/action.c b/src/action.c
index a60a6b7..c6dd10f 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1255,6 +1255,18 @@ static void update_io_dialog(Children *children)
 	}
 }
 
+/*!
+ *\brief	Save Gtk object size to prefs dataset
+ */
+static void actions_io_size_allocate_cb(GtkWidget *widget,
+					 GtkAllocation *allocation)
+{
+	cm_return_if_fail(allocation != NULL);
+
+	prefs_common.actionsiodialog_width = allocation->width;
+	prefs_common.actionsiodialog_height = allocation->height;
+}
+
 static void create_io_dialog(Children *children)
 {
 	GtkWidget *dialog;
@@ -1269,6 +1281,7 @@ static void create_io_dialog(Children *children)
 	GtkWidget *progress_bar = NULL;
 	GtkWidget *abort_button;
 	GtkWidget *close_button;
+	static GdkGeometry geometry;
 
 	debug_print("Creating action IO dialog\n");
 
@@ -1284,6 +1297,8 @@ static void create_io_dialog(Children *children)
 	g_signal_connect(G_OBJECT(dialog), "destroy",
 			 G_CALLBACK(hide_io_dialog_cb),
 			 children);
+	g_signal_connect(G_OBJECT(dialog), "size_allocate",
+			 G_CALLBACK(actions_io_size_allocate_cb), NULL);
 
 	vbox = gtk_vbox_new(FALSE, 8);
 	gtk_container_add(GTK_CONTAINER(
@@ -1302,7 +1317,6 @@ static void create_io_dialog(Children *children)
 	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
 					    GTK_SHADOW_IN);
 	gtk_box_pack_start(GTK_BOX(vbox), scrolledwin, TRUE, TRUE, 0);
-	gtk_widget_set_size_request(scrolledwin, 560, 200);
 	gtk_widget_hide(scrolledwin);
 
 	text = gtk_text_view_new();
@@ -1391,6 +1405,18 @@ static void create_io_dialog(Children *children)
 	gtk_container_add(GTK_CONTAINER(
 			gtk_dialog_get_action_area(GTK_DIALOG(dialog))), hbox);
 
+	if (!geometry.min_height) {
+		geometry.min_width = 582;
+		geometry.min_height = 310;
+	}
+
+	gtk_window_set_geometry_hints(GTK_WINDOW(dialog), NULL, &geometry,
+				      GDK_HINT_MIN_SIZE);
+	gtk_widget_set_size_request(dialog, prefs_common.actionsiodialog_width,
+				    prefs_common.actionsiodialog_height);
+
+	gtk_widget_show(dialog);
+
 	children->dialog       = dialog;
 	children->scrolledwin  = scrolledwin;
 	children->text         = text;
@@ -1399,8 +1425,6 @@ static void create_io_dialog(Children *children)
 	children->progress_bar = progress_bar;
 	children->abort_btn    = abort_button;
 	children->close_btn    = close_button;
-
-	gtk_widget_show(dialog);
 }
 
 static void catch_status(GPid pid, gint status, gpointer data)
diff --git a/src/prefs_common.c b/src/prefs_common.c
index f9754bf..d28153b 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1024,6 +1024,11 @@ static PrefParam param[] = {
 	{"templateswin_height", "-1", &prefs_common.templateswin_height, P_INT,
 	 NULL, NULL, NULL},
 
+	{"actionsiodialog_width", "582", &prefs_common.actionsiodialog_width, P_INT,
+	 NULL, NULL, NULL},
+	{"actionsiodialog_height", "310", &prefs_common.actionsiodialog_height, P_INT,
+	 NULL, NULL, NULL},
+
 	{"actionswin_width", "486", &prefs_common.actionswin_width, P_INT,
 	 NULL, NULL, NULL},
 	{"actionswin_height", "-1", &prefs_common.actionswin_height, P_INT,
diff --git a/src/prefs_common.h b/src/prefs_common.h
index e4b38a8..10c21b7 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -485,6 +485,8 @@ struct _PrefsCommon
 	gint templateswin_height;
 	gint actionswin_width;
 	gint actionswin_height;
+	gint actionsiodialog_width;
+	gint actionsiodialog_height;
 	gint tagswin_width;
 	gint tagswin_height;
 	gint addressbookwin_width;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list