/pidgin/main: 56f47d847aa3: Replace GtkTable with GtkGrid in req...

Elliott Sales de Andrade qulogic at pidgin.im
Tue Nov 11 01:10:00 EST 2014


Changeset: 56f47d847aa3f919ac9654ad2044ddd13439b370
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2014-11-11 00:21 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/56f47d847aa3

Description:

Replace GtkTable with GtkGrid in requests.

diffstat:

 pidgin/gtkrequest.c |  79 ++++++++++++++++++++++++----------------------------
 1 files changed, 36 insertions(+), 43 deletions(-)

diffs (130 lines):

diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1966,7 +1966,7 @@ pidgin_request_fields(const char *title,
 	GtkWidget *hbox, *vbox;
 	GtkWidget *frame;
 	GtkWidget *label;
-	GtkWidget *table;
+	GtkWidget *grid;
 	GtkWidget *button;
 	GtkWidget *img;
 	GtkSizeGroup *sg, *datasheet_buttons_sg;
@@ -2246,15 +2246,15 @@ pidgin_request_fields(const char *title,
 		}
 
 		if (compact)
-			table = gtk_table_new(rows, cols, FALSE);
+			grid = gtk_grid_table_new(rows, cols);
 		else
-			table = gtk_table_new(rows, 2 * cols, FALSE);
-		gtk_table_set_row_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
-		gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
+			grid = gtk_grid_table_new(rows, 2 * cols);
+		gtk_grid_set_row_spacing(GTK_GRID(grid), PIDGIN_HIG_BOX_SPACE);
+		gtk_grid_set_column_spacing(GTK_GRID(grid), PIDGIN_HIG_BOX_SPACE);
 
 		frame_fill = (notebook == NULL || contains_resizable);
-		gtk_box_pack_start(GTK_BOX(frame), table, frame_fill, frame_fill, 0);
-		gtk_widget_show(table);
+		gtk_box_pack_start(GTK_BOX(frame), grid, frame_fill, frame_fill, 0);
+		gtk_widget_show(grid);
 
 		for (row_num = 0, fl = field_list;
 			 row_num < rows && fl != NULL;
@@ -2322,9 +2322,8 @@ pidgin_request_fields(const char *title,
 							row_num++;
 #endif
 
-						gtk_table_attach_defaults(GTK_TABLE(table), label,
-												  0, 2 * cols,
-												  row_num, row_num + 1);
+						gtk_grid_attach_defaults(GTK_GRID(grid), label,
+							0, row_num, 2 * cols, 1);
 
 						row_num++;
 #if 0
@@ -2333,9 +2332,8 @@ pidgin_request_fields(const char *title,
 					}
 					else
 					{
-						gtk_table_attach_defaults(GTK_TABLE(table), label,
-												  col_offset, col_offset + 1,
-												  row_num, row_num + 1);
+						gtk_grid_attach_defaults(GTK_GRID(grid), label,
+							col_offset, row_num, 1, 1);
 					}
 
 					gtk_widget_show(label);
@@ -2376,46 +2374,41 @@ pidgin_request_fields(const char *title,
 				if (type == PURPLE_REQUEST_FIELD_STRING &&
 					purple_request_field_string_is_multiline(field))
 				{
-					gtk_table_attach(GTK_TABLE(table), widget,
-									 0, 2 * cols,
-									 row_num, row_num + 1,
-									 GTK_FILL | GTK_EXPAND,
-									 GTK_FILL | GTK_EXPAND,
-									 5, 0);
+					gtk_grid_attach_full(GTK_GRID(grid), widget,
+						0, row_num, 2 * cols, 1,
+						GTK_FILL | GTK_EXPAND,
+						GTK_FILL | GTK_EXPAND,
+						5, 0);
 				}
 				else if (type == PURPLE_REQUEST_FIELD_LIST)
 				{
-									gtk_table_attach(GTK_TABLE(table), widget,
-									0, 2 * cols,
-									row_num, row_num + 1,
-									GTK_FILL | GTK_EXPAND,
-									GTK_FILL | GTK_EXPAND,
-									5, 0);
+					gtk_grid_attach_full(GTK_GRID(grid), widget,
+						0, row_num, 2 * cols, 1,
+						GTK_FILL | GTK_EXPAND,
+						GTK_FILL | GTK_EXPAND,
+						5, 0);
 				}
 				else if (type == PURPLE_REQUEST_FIELD_BOOLEAN)
 				{
-					gtk_table_attach(GTK_TABLE(table), widget,
-									 col_offset, col_offset + 1,
-									 row_num, row_num + 1,
-									 GTK_FILL | GTK_EXPAND,
-									 GTK_FILL | GTK_EXPAND,
-									 5, 0);
+					gtk_grid_attach_full(GTK_GRID(grid), widget,
+						col_offset, row_num, 1, 1,
+						GTK_FILL | GTK_EXPAND,
+						GTK_FILL | GTK_EXPAND,
+						5, 0);
 				}
 				else if (compact) {
 					row_num++;
-					gtk_table_attach(GTK_TABLE(table), widget,
-									 0, 2 * cols,
-									 row_num, row_num + 1,
-									 GTK_FILL | GTK_EXPAND,
-									 GTK_FILL | GTK_EXPAND,
-									 5, 0);
+					gtk_grid_attach_full(GTK_GRID(grid), widget,
+						0, row_num, 2 * cols, 1,
+						GTK_FILL | GTK_EXPAND,
+						GTK_FILL | GTK_EXPAND,
+						5, 0);
 				} else {
-					gtk_table_attach(GTK_TABLE(table), widget,
-							 		 1, 2 * cols,
-									 row_num, row_num + 1,
-									 GTK_FILL | GTK_EXPAND,
-									 GTK_FILL | GTK_EXPAND,
-									 5, 0);
+					gtk_grid_attach_full(GTK_GRID(grid), widget,
+						1, row_num, 2 * cols - 1, 1,
+						GTK_FILL | GTK_EXPAND,
+						GTK_FILL | GTK_EXPAND,
+						5, 0);
 				}
 
 				gtk_widget_show(widget);



More information about the Commits mailing list