changeset 25688:9c6915254610

Move the audio progress bar widgets to be beside the video displays.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 19 Jun 2008 17:38:04 +0000
parents ddbea813862e
children c17d26b6f236
files pidgin/gtkmedia.c
diffstat 1 files changed, 35 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Thu Jun 12 03:59:26 2008 +0000
+++ b/pidgin/gtkmedia.c	Thu Jun 19 17:38:04 2008 +0000
@@ -166,23 +166,12 @@
 	media->priv->hangup = gtk_button_new_with_label("Hangup");
 	media->priv->accept = gtk_button_new_with_label("Accept");
 	media->priv->reject = gtk_button_new_with_label("Reject");
-	media->priv->send_progress = gtk_progress_bar_new();
-	media->priv->recv_progress = gtk_progress_bar_new();
-
-	gtk_widget_set_size_request(media->priv->send_progress, 70, 5);
-	gtk_widget_set_size_request(media->priv->recv_progress, 70, 5);
 
 	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_start(GTK_BOX(media), media->priv->send_progress, FALSE, FALSE, 6);
-	gtk_box_pack_start(GTK_BOX(media), media->priv->recv_progress, FALSE, FALSE, 6);
-
-	gtk_widget_show(media->priv->send_progress);
-	gtk_widget_show(media->priv->recv_progress);
-
 	gtk_widget_show_all(media->priv->accept);
 	gtk_widget_show_all(media->priv->reject);
 
@@ -330,6 +319,7 @@
 pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia)
 {
 	GstElement *element = purple_media_get_pipeline(media);
+	GtkWidget *send_widget = NULL, *recv_widget = NULL;
 
 	GstElement *audiosendbin = NULL, *audiosendlevel = NULL;
 	GstElement *audiorecvbin = NULL, *audiorecvlevel = NULL;
@@ -364,6 +354,15 @@
 				       NULL);
 	}
 
+	send_widget = gtk_hbox_new(FALSE, 0);
+	recv_widget = gtk_hbox_new(FALSE, 0);
+
+	gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), send_widget, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), recv_widget, TRUE, TRUE, 0);
+
+	gtk_widget_show(send_widget);
+	gtk_widget_show(recv_widget);
+
 	if (videorecvbin || videosendbin) {
 		GtkWidget *aspect;
 		GtkWidget *remote_video;
@@ -373,7 +372,7 @@
 
 		aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE);
 		gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
-		gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), aspect, TRUE, TRUE, 0);
+		gtk_box_pack_start(GTK_BOX(send_widget), aspect, TRUE, TRUE, 0);
 
 		remote_video = gtk_drawing_area_new();
 		gtk_container_add(GTK_CONTAINER(aspect), remote_video);
@@ -383,7 +382,7 @@
 
 		aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE);
 		gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
-		gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), aspect, TRUE, TRUE, 0);
+		gtk_box_pack_start(GTK_BOX(recv_widget), aspect, TRUE, TRUE, 0);
 
 		local_video = gtk_drawing_area_new();
 		gtk_container_add(GTK_CONTAINER(aspect), local_video);
@@ -394,6 +393,29 @@
 		gtkmedia->priv->remote_video = remote_video;
 	}
 
+	if (audiorecvbin || audiosendbin) {
+		gtk_widget_show(gtkmedia->priv->display);
+
+		gtkmedia->priv->send_progress = gtk_progress_bar_new();
+		gtkmedia->priv->recv_progress = gtk_progress_bar_new();
+
+		gtk_widget_set_size_request(gtkmedia->priv->send_progress, 5, 70);
+		gtk_widget_set_size_request(gtkmedia->priv->recv_progress, 5, 70);
+
+		gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(gtkmedia->priv->send_progress),
+						 GTK_PROGRESS_BOTTOM_TO_TOP);
+		gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(gtkmedia->priv->recv_progress),
+						 GTK_PROGRESS_BOTTOM_TO_TOP);
+
+		gtk_box_pack_start(GTK_BOX(send_widget),
+				   gtkmedia->priv->send_progress, FALSE, FALSE, 0);
+		gtk_box_pack_start(GTK_BOX(recv_widget),
+				   gtkmedia->priv->recv_progress, FALSE, FALSE, 0);
+
+		gtk_widget_show(gtkmedia->priv->send_progress);
+		gtk_widget_show(gtkmedia->priv->recv_progress);
+	}
+
 	bus = gst_pipeline_get_bus(GST_PIPELINE(element));
 	gst_bus_add_signal_watch(GST_BUS(bus));
 	g_signal_connect(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))),