# HG changeset patch # User Jim Seymour # Date 1024360523 0 # Node ID a6367446950d6fe66d85053bcff50065021cfbc0 # Parent edc8511fddff59118461de017f1bb7a960be8296 [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 diff -r edc8511fddff -r a6367446950d src/dialogs.c --- 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");