Mercurial > pidgin.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
914:215fe9039ae1 | 915:378c862a2381 |
---|---|
938 | 938 |
939 return button; | 939 return button; |
940 } | 940 } |
941 | 941 |
942 static GtkTooltips *tips = NULL; | 942 static GtkTooltips *tips = NULL; |
943 GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short showtext) | 943 GtkWidget *picture_button2(GtkWidget *window, char *text, char **xpm, short dispstyle) |
944 { | 944 { |
945 GtkWidget *button; | 945 GtkWidget *button; |
946 GtkWidget *button_box, *button_box_2; | 946 GtkWidget *button_box, *button_box_2; |
947 GdkBitmap *mask; | 947 GdkBitmap *mask; |
948 GdkPixmap *pm; | 948 GdkPixmap *pm; |
958 gtk_container_add(GTK_CONTAINER(button), button_box); | 958 gtk_container_add(GTK_CONTAINER(button), button_box); |
959 | 959 |
960 button_box_2 = gtk_vbox_new(FALSE, 0); | 960 button_box_2 = gtk_vbox_new(FALSE, 0); |
961 | 961 |
962 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0); | 962 gtk_box_pack_start(GTK_BOX(button_box), button_box_2, TRUE, TRUE, 0); |
963 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm); | 963 if (dispstyle == 2 || dispstyle == 0) { |
964 pixmap = gtk_pixmap_new(pm, mask); | 964 pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm); |
965 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0); | 965 pixmap = gtk_pixmap_new(pm, mask); |
966 | 966 gtk_box_pack_start(GTK_BOX(button_box_2), pixmap, FALSE, FALSE, 0); |
967 if (showtext) | 967 |
968 gtk_widget_show(pixmap); | |
969 | |
970 } | |
971 | |
972 if (dispstyle == 2 || dispstyle == 1) | |
968 { | 973 { |
969 label = gtk_label_new(text); | 974 label = gtk_label_new(text); |
970 gtk_widget_show(label); | 975 gtk_widget_show(label); |
971 gtk_box_pack_end(GTK_BOX(button_box_2), label, FALSE, FALSE, 0); | 976 gtk_box_pack_end(GTK_BOX(button_box_2), label, FALSE, FALSE, 0); |
972 } | 977 } |
973 | 978 |
974 gtk_widget_show(pixmap); | |
975 gtk_widget_show(button_box_2); | 979 gtk_widget_show(button_box_2); |
976 gtk_widget_show(button_box); | 980 gtk_widget_show(button_box); |
977 gtk_widget_show(button); | 981 gtk_widget_show(button); |
978 gdk_pixmap_unref(pm); | 982 if (dispstyle == 2 || dispstyle == 0) { |
979 gdk_bitmap_unref(mask); | 983 gdk_pixmap_unref(pm); |
984 gdk_bitmap_unref(mask); | |
985 } | |
980 | 986 |
981 gtk_tooltips_set_tip(tips, button, text, "Gaim"); | 987 gtk_tooltips_set_tip(tips, button, text, "Gaim"); |
982 return button; | 988 return button; |
983 } | 989 } |
984 | 990 |
1152 strcpy(buf, tmp); | 1158 strcpy(buf, tmp); |
1153 } | 1159 } |
1154 | 1160 |
1155 return buf; | 1161 return buf; |
1156 } | 1162 } |
1163 | |
1164 int set_dispstyle (int chat) | |
1165 { | |
1166 int dispstyle; | |
1167 | |
1168 if (chat) { | |
1169 switch (display_options & (OPT_DISP_CHAT_BUTTON_TEXT | | |
1170 OPT_DISP_CHAT_BUTTON_XPM)) { | |
1171 case OPT_DISP_CHAT_BUTTON_TEXT: | |
1172 dispstyle = 1; | |
1173 break; | |
1174 case OPT_DISP_CHAT_BUTTON_XPM: | |
1175 dispstyle = 0; | |
1176 break; | |
1177 default: /* both or neither */ | |
1178 dispstyle = 2; | |
1179 break; | |
1180 } | |
1181 } else { | |
1182 switch (display_options & (OPT_DISP_CONV_BUTTON_TEXT | | |
1183 OPT_DISP_CONV_BUTTON_XPM)) { | |
1184 case OPT_DISP_CONV_BUTTON_TEXT: | |
1185 dispstyle = 1; | |
1186 break; | |
1187 case OPT_DISP_CONV_BUTTON_XPM: | |
1188 dispstyle = 0; | |
1189 break; | |
1190 default: /* both or neither */ | |
1191 dispstyle = 2; | |
1192 break; | |
1193 } | |
1194 } | |
1195 return dispstyle; | |
1196 } |