changeset 26130:525aa65805b9

Rearrange the Pidgin media GUI.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 14 Jan 2009 09:20:07 +0000
parents f09107a80608
children 6eeb500ce9a2
files pidgin/gtkconv.c pidgin/gtkconv.h pidgin/gtkmedia.c
diffstat 3 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Tue Jan 13 13:46:06 2009 +0000
+++ b/pidgin/gtkconv.c	Wed Jan 14 09:20:07 2009 +0000
@@ -4803,7 +4803,7 @@
 static GtkWidget *
 setup_common_pane(PidginConversation *gtkconv)
 {
-	GtkWidget *vbox, *hpaned, *frame, *imhtml_sw, *event_box;
+	GtkWidget *vbox, *frame, *imhtml_sw, *event_box;
 	GtkCellRenderer *rend;
 	GtkTreePath *path;
 	PurpleConversation *conv = gtkconv->active_conv;
@@ -4813,7 +4813,10 @@
 	int buddyicon_size = 0;
 
 	/* Setup the top part of the pane */
-	gtkconv->topvbox = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtkconv->tophbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtk_widget_show(gtkconv->tophbox);
+	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtk_box_pack_start(GTK_BOX(gtkconv->tophbox), vbox, TRUE, TRUE, 0);
 	gtk_widget_show(vbox);
 
 	/* Setup the info pane */
@@ -4883,21 +4886,23 @@
 	/* Setup the gtkimhtml widget */
 	frame = pidgin_create_imhtml(FALSE, &gtkconv->imhtml, NULL, &imhtml_sw);
 	gtk_widget_set_size_request(gtkconv->imhtml, -1, 0);
-
-	/* Add the gtkimhtml frame */
-	gtkconv->middle_hpaned = hpaned = gtk_hpaned_new();
-	gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 0);
-	gtk_widget_show(hpaned);
-	gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE);
-
 	if (chat) {
+		GtkWidget *hpaned;
+
 		/* Add the topic */
 		setup_chat_topic(gtkconv, vbox);
 
+		/* Add the gtkimhtml frame */
+		hpaned = gtk_hpaned_new();
+		gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 0);
+		gtk_widget_show(hpaned);
+		gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE);
+
 		/* Now add the userlist */
 		setup_chat_userlist(gtkconv, hpaned);
-	}
-
+	} else {
+		gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+	}
 	gtk_widget_show(frame);
 
 	gtk_widget_set_name(gtkconv->imhtml, "pidgin_conv_imhtml");
@@ -4960,7 +4965,7 @@
 	default_formatize(gtkconv);
 	g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear",
 	                       G_CALLBACK(clear_formatting_cb), gtkconv);
-	return vbox;
+	return gtkconv->tophbox;
 }
 
 static void
@@ -7822,7 +7827,7 @@
 	gtkmedia = pidgin_media_new(media, screenname);
 	g_object_unref(media);
 
-	gtk_box_pack_start(GTK_BOX(gtkconv->topvbox), gtkmedia, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(gtkconv->tophbox), gtkmedia, FALSE, FALSE, 0);
 	gtk_widget_show(gtkmedia);
 	g_signal_connect(G_OBJECT(gtkmedia), "message", G_CALLBACK(pidgin_gtkmedia_message_cb), conv);
 	g_signal_connect(G_OBJECT(gtkmedia), "error", G_CALLBACK(pidgin_gtkmedia_error_cb), conv);
@@ -7831,8 +7836,9 @@
 	g_signal_connect(G_OBJECT(gtkmedia), "destroy", G_CALLBACK(
 			pidgin_conv_gtkmedia_destroyed), gtkconv);
 
-	gtk_paned_pack2(GTK_PANED(gtkconv->middle_hpaned),
-			pidgin_media_get_display_widget(gtkmedia), FALSE, TRUE);
+	gtk_box_pack_start(GTK_BOX(gtkmedia),
+			pidgin_media_get_display_widget(gtkmedia),
+			TRUE, TRUE, PIDGIN_HIG_BOX_SPACE);
 
 	pidgin_conv_update_buttons_by_protocol(conv);
 	return TRUE;
--- a/pidgin/gtkconv.h	Tue Jan 13 13:46:06 2009 +0000
+++ b/pidgin/gtkconv.h	Wed Jan 14 09:20:07 2009 +0000
@@ -150,7 +150,6 @@
 	gpointer depr1;
 #endif
 
-	GtkWidget *middle_hpaned;
 	GtkWidget *lower_hbox;
 
 	GtkWidget *toolbar;
@@ -170,7 +169,7 @@
 	GtkWidget *infopane;
 	GtkListStore *infopane_model;
 	GtkTreeIter infopane_iter;
-	GtkWidget *topvbox;
+	GtkWidget *tophbox;
 	GtkWidget *gtkmedia;
 
 	/* Used when attaching a PidginConversation to a PurpleConversation
--- a/pidgin/gtkmedia.c	Tue Jan 13 13:46:06 2009 +0000
+++ b/pidgin/gtkmedia.c	Wed Jan 14 09:20:07 2009 +0000
@@ -120,7 +120,7 @@
 			(GInstanceInitFunc) pidgin_media_init,
 			NULL
 		};
-		type = g_type_register_static(GTK_TYPE_HBOX, "PidginMedia", &info, 0);
+		type = g_type_register_static(GTK_TYPE_VBOX, "PidginMedia", &info, 0);
 	}
 	return type;
 }
@@ -195,11 +195,11 @@
 	g_signal_connect(media->priv->mute, "toggled",
 			G_CALLBACK(pidgin_media_mute_toggled), media);
 
-	gtk_box_pack_start(GTK_BOX(media), media->priv->calling, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(media), media->priv->hangup, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(media), media->priv->accept, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(media), media->priv->reject, FALSE, FALSE, 0);
+	gtk_box_pack_end(GTK_BOX(media), media->priv->reject, FALSE, FALSE, 0);
+	gtk_box_pack_end(GTK_BOX(media), media->priv->accept, FALSE, FALSE, 0);
+	gtk_box_pack_end(GTK_BOX(media), media->priv->hangup, FALSE, FALSE, 0);
 	gtk_box_pack_end(GTK_BOX(media), media->priv->mute, FALSE, FALSE, 0);
+	gtk_box_pack_end(GTK_BOX(media), media->priv->calling, FALSE, FALSE, 0);
 
 	gtk_widget_show_all(media->priv->accept);
 	gtk_widget_show_all(media->priv->reject);
@@ -307,11 +307,6 @@
 	PidginMedia *gtkmedia = PIDGIN_MEDIA(media);
 	purple_debug_info("gtkmedia", "pidgin_media_finalize\n");
 
-	if (gtkmedia->priv->display) {
-		gtk_widget_destroy(gtkmedia->priv->display);
-		gtkmedia->priv->display = NULL;
-	}
-
 	G_OBJECT_CLASS(parent_class)->finalize(media);
 }