changeset 30678:5ec2d3617538

pidgin: Re-arrange media window. Layout remote and local video side-by-side. Prevent local video to not scale up when resizing. Refs #11675
author Marcus Lundblad <ml@update.uu.se>
date Wed, 07 Jul 2010 20:04:06 +0000
parents 16738cb6bb6b
children 74541f1faf3c
files ChangeLog pidgin/gtkmedia.c
diffstat 2 files changed, 26 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 30 21:38:27 2010 +0000
+++ b/ChangeLog	Wed Jul 07 20:04:06 2010 +0000
@@ -6,6 +6,7 @@
 
 	Pidgin:
 	* Re-focus the input area after clicking the attention toolbar button.
+	* Re-arrange media window to make it more netbook-friendly.
 
 	Finch:
 	* Rebindable 'suggest-next-page' and 'suggest-prev-page' actions for
--- a/pidgin/gtkmedia.c	Wed Jun 30 21:38:27 2010 +0000
+++ b/pidgin/gtkmedia.c	Wed Jul 07 20:04:06 2010 +0000
@@ -333,7 +333,7 @@
 	gtk_box_pack_start(GTK_BOX(vbox), media->priv->menubar,
 			FALSE, TRUE, 0);
 
-	media->priv->display = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	media->priv->display = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
 	gtk_container_set_border_width(GTK_CONTAINER(media->priv->display),
 			PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start(GTK_BOX(vbox), media->priv->display,
@@ -629,29 +629,29 @@
 		gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display),
 				recv_widget, TRUE, TRUE, 0);
 		gtk_widget_show(recv_widget);
-	} else
+	} else {
 		recv_widget = gtkmedia->priv->recv_widget;
+	}
 	if (gtkmedia->priv->send_widget == NULL
 			&& type & (PURPLE_MEDIA_SEND_VIDEO |
 			PURPLE_MEDIA_SEND_AUDIO)) {
 		send_widget = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
 		gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display),
-				send_widget, TRUE, TRUE, 0);
+				send_widget, FALSE, TRUE, 0);
 		button_widget = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
-		gtk_box_pack_end(GTK_BOX(send_widget), button_widget,
-				FALSE, FALSE, 0);
-		gtk_widget_show(GTK_WIDGET(button_widget));
+		gtk_box_pack_end(GTK_BOX(recv_widget), button_widget,
+				FALSE, TRUE, 0);
 		gtk_widget_show(send_widget);
 
 		/* Hold button */
 		gtkmedia->priv->hold =
 				gtk_toggle_button_new_with_mnemonic("_Hold");
+		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->hold,
+				FALSE, FALSE, 0);
+		gtk_widget_show(gtkmedia->priv->hold);
 		g_signal_connect(gtkmedia->priv->hold, "toggled",
 				G_CALLBACK(pidgin_media_hold_toggled),
 				gtkmedia);
-		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->hold,
-				FALSE, FALSE, 0);
-		gtk_widget_show(gtkmedia->priv->hold);
 	} else {
 		send_widget = gtkmedia->priv->send_widget;
 		button_widget = gtkmedia->priv->button_widget;
@@ -663,7 +663,7 @@
 		GtkWidget *remote_video;
 		GdkColor color = {0, 0, 0, 0};
 
-		aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE);
+		aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, FALSE);
 		gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
 		gtk_box_pack_start(GTK_BOX(recv_widget), aspect, TRUE, TRUE, 0);
 
@@ -683,15 +683,16 @@
 
 		gtkmedia->priv->remote_video = remote_video;
 	}
+
 	if (type & PURPLE_MEDIA_SEND_VIDEO) {
 		PidginMediaRealizeData *data;
 		GtkWidget *aspect;
 		GtkWidget *local_video;
 		GdkColor color = {0, 0, 0, 0};
 
-		aspect = gtk_aspect_frame_new(NULL, 0.5, 0.5, 4.0/3.0, FALSE);
+		aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, TRUE);
 		gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
-		gtk_box_pack_start(GTK_BOX(send_widget), aspect, TRUE, TRUE, 0);
+		gtk_box_pack_start(GTK_BOX(send_widget), aspect, FALSE, TRUE, 0);
 
 		data = g_new0(PidginMediaRealizeData, 1);
 		data->gtkmedia = gtkmedia;
@@ -703,44 +704,43 @@
 		g_signal_connect(G_OBJECT(local_video), "realize",
 				G_CALLBACK(realize_cb), data);
 		gtk_container_add(GTK_CONTAINER(aspect), local_video);
-		gtk_widget_set_size_request (GTK_WIDGET(local_video), 160, 120);
+		gtk_widget_set_size_request (GTK_WIDGET(local_video), 80, 60);
 
 		gtk_widget_show(local_video);
 		gtk_widget_show(aspect);
 
 		gtkmedia->priv->pause =
 				gtk_toggle_button_new_with_mnemonic(_("_Pause"));
+		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->pause,
+				FALSE, FALSE, 0);
+		gtk_widget_show(gtkmedia->priv->pause);
 		g_signal_connect(gtkmedia->priv->pause, "toggled",
 				G_CALLBACK(pidgin_media_pause_toggled),
 				gtkmedia);
-		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->pause,
-				FALSE, FALSE, 0);
-		gtk_widget_show(gtkmedia->priv->pause);
 
 		gtkmedia->priv->local_video = local_video;
 	}
-
 	if (type & PURPLE_MEDIA_RECV_AUDIO) {
 		gtk_box_pack_end(GTK_BOX(recv_widget),
 				pidgin_media_add_audio_widget(gtkmedia,
 				PURPLE_MEDIA_RECV_AUDIO), FALSE, FALSE, 0);
 	}
+
 	if (type & PURPLE_MEDIA_SEND_AUDIO) {
 		gtkmedia->priv->mute =
 				gtk_toggle_button_new_with_mnemonic("_Mute");
+		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->mute,
+				FALSE, FALSE, 0);
+		gtk_widget_show(gtkmedia->priv->mute);
 		g_signal_connect(gtkmedia->priv->mute, "toggled",
 				G_CALLBACK(pidgin_media_mute_toggled),
 				gtkmedia);
-		gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->mute,
-				FALSE, FALSE, 0);
-		gtk_widget_show(gtkmedia->priv->mute);
 
-		gtk_box_pack_end(GTK_BOX(send_widget),
+		gtk_box_pack_end(GTK_BOX(recv_widget),
 				pidgin_media_add_audio_widget(gtkmedia,
 				PURPLE_MEDIA_SEND_AUDIO), FALSE, FALSE, 0);
 	}
 
-
 	if (type & PURPLE_MEDIA_AUDIO &&
 			gtkmedia->priv->level_handler_id == 0) {
 		gtkmedia->priv->level_handler_id = g_signal_connect(
@@ -752,8 +752,10 @@
 		gtkmedia->priv->send_widget = send_widget;
 	if (recv_widget != NULL)
 		gtkmedia->priv->recv_widget = recv_widget;
-	if (button_widget != NULL)
+	if (button_widget != NULL) {
 		gtkmedia->priv->button_widget = button_widget;
+		gtk_widget_show(GTK_WIDGET(button_widget));
+	}
 
 	if (purple_media_is_initiator(media, sid, NULL) == FALSE) {
 		if (gtkmedia->priv->timeout_id != 0)