Mercurial > pidgin
diff src/util.c @ 915:378c862a2381
[gaim-migrate @ 925]
bmiller is damn cool. he did everything i asked for, the next day even.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Fri, 15 Sep 2000 18:24:32 +0000 |
| parents | b389c4221c89 |
| children | f6aa60716419 |
line wrap: on
line diff
--- a/src/util.c Fri Sep 15 16:51:31 2000 +0000 +++ b/src/util.c Fri Sep 15 18:24:32 2000 +0000 @@ -940,7 +940,7 @@ } static GtkTooltips *tips = NULL; -GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short showtext) +GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short dispstyle) { GtkWidget *button; GtkWidget *button_box, *button_box_2; @@ -960,23 +960,29 @@ button_box_2 = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 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); + 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); - if (showtext) + gtk_widget_show(pixmap); + + } + + 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); } - gtk_widget_show(pixmap); gtk_widget_show(button_box_2); gtk_widget_show(button_box); gtk_widget_show(button); - gdk_pixmap_unref(pm); - gdk_bitmap_unref(mask); + if (dispstyle == 2 || dispstyle == 0) { + gdk_pixmap_unref(pm); + gdk_bitmap_unref(mask); + } gtk_tooltips_set_tip(tips, button, text, "Gaim"); return button; @@ -1154,3 +1160,37 @@ return buf; } + +int set_dispstyle (int chat) +{ + int dispstyle; + + if (chat) { + switch (display_options & (OPT_DISP_CHAT_BUTTON_TEXT | + OPT_DISP_CHAT_BUTTON_XPM)) { + case OPT_DISP_CHAT_BUTTON_TEXT: + dispstyle = 1; + break; + case OPT_DISP_CHAT_BUTTON_XPM: + dispstyle = 0; + break; + default: /* both or neither */ + dispstyle = 2; + break; + } + } else { + switch (display_options & (OPT_DISP_CONV_BUTTON_TEXT | + OPT_DISP_CONV_BUTTON_XPM)) { + case OPT_DISP_CONV_BUTTON_TEXT: + dispstyle = 1; + break; + case OPT_DISP_CONV_BUTTON_XPM: + dispstyle = 0; + break; + default: /* both or neither */ + dispstyle = 2; + break; + } + } + return dispstyle; +}
