/pidgin/main: 4fd6fe073c8f: Migrate some bits to GTK3 API.

Jorge Villase?or salinasv at pidgin.im
Fri Sep 28 19:40:21 EDT 2012


Changeset: 4fd6fe073c8fea791e3e3d0bc6d81542e782af5b
Author:	 Jorge Villase?or <salinasv at pidgin.im>
Date:	 2012-09-28 17:47 -0500
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/4fd6fe073c8f

Description:

Migrate some bits to GTK3 API.

diffstat:

 pidgin/gtksmiley.c |  34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diffs (80 lines):

diff --git a/pidgin/gtksmiley.c b/pidgin/gtksmiley.c
--- a/pidgin/gtksmiley.c
+++ b/pidgin/gtksmiley.c
@@ -417,21 +417,40 @@ pidgin_smiley_edit(GtkWidget *widget, Pu
 	g_signal_connect(window, "response", G_CALLBACK(do_add_select_cb), s);
 
 	/* The vbox */
+#if GTK_CHECK_VERSION(3,0,0)
+	vbox = gtk_grid_new();
+	gtk_grid_set_row_spacing(GTK_GRID(vbox), PIDGIN_HIG_BORDER);
+#else
 	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
+#endif
 	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(window))),
                     vbox);
 	gtk_widget_show(vbox);
 
 	/* The hbox */
+#if GTK_CHECK_VERSION(3,0,0)
+	hbox = gtk_grid_new();
+	gtk_grid_set_column_spacing(GTK_GRID(hbox), PIDGIN_HIG_BORDER);
+	gtk_grid_attach(GTK_GRID(vbox), hbox, 0, 0, 1, 1);
+#else
 	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
 	gtk_container_add(GTK_CONTAINER(GTK_VBOX(vbox)), hbox);
+#endif
 
 	label = gtk_label_new_with_mnemonic(_("_Image:"));
+#if GTK_CHECK_VERSION(3,0,0)
+	gtk_grid_attach(GTK_GRID(hbox), label, 0, 0, 1, 1);
+#else
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+#endif
 	gtk_widget_show(label);
 
 	filech = gtk_button_new();
+#if GTK_CHECK_VERSION(3,0,0)
+	gtk_grid_attach_next_to(GTK_GRID(hbox), filech, NULL, GTK_POS_RIGHT, 1, 1);
+#else
 	gtk_box_pack_end(GTK_BOX(hbox), filech, FALSE, FALSE, 0);
+#endif
 	pidgin_set_accessible_label(filech, label);
 
 	s->smiley_image = gtk_image_new();
@@ -453,12 +472,23 @@ pidgin_smiley_edit(GtkWidget *widget, Pu
 	gtk_widget_show_all(hbox);
 
 	/* info */
+#if GTK_CHECK_VERSION(3,0,0)
+	hbox = gtk_grid_new();
+	gtk_grid_set_column_spacing(GTK_GRID(hbox), PIDGIN_HIG_BORDER);
+
+	gtk_grid_attach_next_to(GTK_GRID(vbox), hbox, NULL, GTK_POS_BOTTOM, 1, 1);
+#else
 	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
 	gtk_container_add(GTK_CONTAINER(GTK_VBOX(vbox)),hbox);
+#endif
 
 	/* Shortcut text */
 	label = gtk_label_new_with_mnemonic(_("S_hortcut text:"));
+#if GTK_CHECK_VERSION(3,0,0)
+	gtk_grid_attach(GTK_GRID(hbox), label, 0, 0, 1, 1);
+#else
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+#endif
 	gtk_widget_show(label);
 
 	s->smile = gtk_entry_new();
@@ -476,7 +506,11 @@ pidgin_smiley_edit(GtkWidget *widget, Pu
 	g_signal_connect(G_OBJECT(s->smile), "insert-text", G_CALLBACK(smiley_name_insert_cb), s);
 	g_signal_connect(G_OBJECT(s->smile), "delete-text", G_CALLBACK(smiley_name_delete_cb), s);
 
+#if GTK_CHECK_VERSION(3,0,0)
+	gtk_grid_attach_next_to(GTK_GRID(hbox), s->smile, NULL, GTK_POS_RIGHT, 1, 1);
+#else
 	gtk_box_pack_end(GTK_BOX(hbox), s->smile, FALSE, FALSE, 0);
+#endif
 	gtk_widget_show(s->smile);
 
 	gtk_widget_show(hbox);



More information about the Commits mailing list