changeset 3325:a6367446950d

[gaim-migrate @ 3343] Tie pixmaps and text labels together so when windows are expanded vertically they stay together--the labels and pixmaps, that is. (Thanks, Daniel Walls) committer: Tailor Script <tailor@pidgin.im>
author Jim Seymour <jseymour>
date Tue, 18 Jun 2002 00:35:23 +0000
parents edc8511fddff
children 03daf01a8000
files src/dialogs.c
diffstat 1 files changed, 52 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Mon Jun 17 02:47:49 2002 +0000
+++ b/src/dialogs.c	Tue Jun 18 00:35:23 2002 +0000
@@ -4288,23 +4288,60 @@
 	button_box_2 = gtk_vbox_new(FALSE, 0);
 
 	gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0);
+
 	gtk_widget_show(button_box_2);
 	gtk_widget_show(button_box);
-	if (dispstyle == 2 || dispstyle == 0) {
-		pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
-		pixmap = gtk_pixmap_new(pm, mask);
-		gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
-
-		gtk_widget_show(pixmap);
-
-		gdk_pixmap_unref(pm);
-		gdk_bitmap_unref(mask);
-	}
-
-	if (dispstyle == 2 || dispstyle == 1) {
-		label = gtk_label_new(text);
-		gtk_widget_show(label);
-		gtk_box_pack_end(GTK_BOX(button_box_2), label, FALSE, FALSE, 0);
+	
+	switch(dispstyle) {
+		case 0:
+			/* Display just pixmap */
+			pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
+			pixmap = gtk_pixmap_new(pm, mask);
+			gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0);
+			
+			gtk_widget_show(pixmap);
+			
+			gdk_pixmap_unref(pm);
+			gdk_bitmap_unref(mask);
+			break;
+
+		case 1:
+			/* Display just label */
+			label = gtk_label_new(text);
+			gtk_widget_show(label);
+			gtk_box_pack_start(GTK_BOX(button_box_2), label, FALSE, FALSE, 0);
+			break;
+
+		case 2:
+			/* Display pixmap and label */
+			{
+				GtkWidget *button_box_top = gtk_vbox_new(FALSE, 0);
+				GtkWidget *button_box_bottom = gtk_vbox_new(FALSE, 0); 
+				
+				pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm);
+				pixmap = gtk_pixmap_new(pm, mask);
+				gtk_box_pack_end(GTK_BOX(button_box_top), pixmap, FALSE, FALSE, 0);
+
+				gtk_widget_show(pixmap);
+
+				gdk_pixmap_unref(pm);
+				gdk_bitmap_unref(mask);
+
+				label = gtk_label_new(text);
+				gtk_widget_show(label);
+				gtk_box_pack_start(GTK_BOX(button_box_bottom), label, FALSE, FALSE, 0);
+						
+				gtk_box_pack_start(GTK_BOX(button_box_2), button_box_top, TRUE,
+							TRUE, 0);
+				gtk_box_pack_start(GTK_BOX(button_box_2), button_box_bottom, TRUE,
+							TRUE, 0);
+				gtk_widget_show(button_box_top);
+				gtk_widget_show(button_box_bottom);
+			}
+			break;
+
+		default:
+			break;
 	}
 
 	gtk_tooltips_set_tip(button_tips, button, text, "Gaim");