Mercurial > pidgin.yaz
comparison gtk/gtkblist.c @ 14803:967c39d78bc4
[gaim-migrate @ 17568]
I'm an idiot.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 23 Oct 2006 19:43:45 +0000 |
parents | 4138063d89c9 |
children | 77c68f898389 |
comparison
equal
deleted
inserted
replaced
14802:4138063d89c9 | 14803:967c39d78bc4 |
---|---|
2076 struct tooltip_data { | 2076 struct tooltip_data { |
2077 PangoLayout *layout; | 2077 PangoLayout *layout; |
2078 GdkPixbuf *status_icon; | 2078 GdkPixbuf *status_icon; |
2079 GdkPixbuf *avatar; | 2079 GdkPixbuf *avatar; |
2080 int avatar_width; | 2080 int avatar_width; |
2081 int avatar_height; | |
2082 int width; | 2081 int width; |
2083 int height; | 2082 int height; |
2084 }; | 2083 }; |
2085 | 2084 |
2086 static struct tooltip_data * create_tip_for_node(GaimBlistNode *node, gboolean full) | 2085 static struct tooltip_data * create_tip_for_node(GaimBlistNode *node, gboolean full) |
2100 td->width = PANGO_PIXELS(td->width) + 38 + 8; | 2099 td->width = PANGO_PIXELS(td->width) + 38 + 8; |
2101 td->height = MAX(PANGO_PIXELS(td->height + 4) + 8, 38); | 2100 td->height = MAX(PANGO_PIXELS(td->height + 4) + 8, 38); |
2102 | 2101 |
2103 if(td->avatar) { | 2102 if(td->avatar) { |
2104 td->avatar_width = gdk_pixbuf_get_width(td->avatar); | 2103 td->avatar_width = gdk_pixbuf_get_width(td->avatar); |
2105 td->avatar_height = gdk_pixbuf_get_height(td->avatar); | |
2106 td->width += td->avatar_width + 8; | 2104 td->width += td->avatar_width + 8; |
2107 td->height = MAX(td->height, gdk_pixbuf_get_height(td->avatar) + 8); | 2105 td->height = MAX(td->height, gdk_pixbuf_get_height(td->avatar) + 8); |
2108 } | 2106 } |
2109 | 2107 |
2110 g_free(tooltip_text); | 2108 g_free(tooltip_text); |
2133 | 2131 |
2134 current_height = 4; | 2132 current_height = 4; |
2135 for(l = gtkblist->tooltipdata; l; l = l->next) | 2133 for(l = gtkblist->tooltipdata; l; l = l->next) |
2136 { | 2134 { |
2137 struct tooltip_data *td = l->data; | 2135 struct tooltip_data *td = l->data; |
2138 | |
2139 | |
2140 | 2136 |
2141 #if GTK_CHECK_VERSION(2,2,0) | 2137 #if GTK_CHECK_VERSION(2,2,0) |
2142 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, | 2138 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, |
2143 0, 0, 4, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); | 2139 0, 0, 4, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); |
2144 if(td->avatar) | 2140 if(td->avatar) |
2150 gdk_pixbuf_render_to_drawable(td->avatar, | 2146 gdk_pixbuf_render_to_drawable(td->avatar, |
2151 GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0, | 2147 GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0, |
2152 max_width - (td->avatar_width + 4), | 2148 max_width - (td->avatar_width + 4), |
2153 current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); | 2149 current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); |
2154 #endif | 2150 #endif |
2155 | 2151 |
2156 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, | 2152 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, |
2157 NULL, gtkblist->tipwindow, "tooltip", 38 + 4, current_height, td->layout); | 2153 NULL, gtkblist->tipwindow, "tooltip", 38 + 4, current_height, td->layout); |
2158 | 2154 |
2159 current_height += td->height; | 2155 current_height += td->height; |
2160 | 2156 |
3862 /* Add new error buttons */ | 3858 /* Add new error buttons */ |
3863 g_hash_table_foreach(gtkblist->connection_errors, | 3859 g_hash_table_foreach(gtkblist->connection_errors, |
3864 create_connection_error_buttons, NULL); | 3860 create_connection_error_buttons, NULL); |
3865 } | 3861 } |
3866 | 3862 |
3867 void gaim_gtk_blist_add_alert(GtkWidget *alert) { | |
3868 gtk_notebook_append_page(gtkblist->alert_notebook, alert, NULL); | |
3869 } | |
3870 | |
3871 /******************************************/ | 3863 /******************************************/ |
3872 /* End of connection error handling stuff */ | 3864 /* End of connection error handling stuff */ |
3873 /******************************************/ | 3865 /******************************************/ |
3874 | 3866 |
3875 static void gaim_gtk_blist_show(GaimBuddyList *list) | 3867 static void gaim_gtk_blist_show(GaimBuddyList *list) |
3878 GtkCellRenderer *rend; | 3870 GtkCellRenderer *rend; |
3879 GtkTreeViewColumn *column; | 3871 GtkTreeViewColumn *column; |
3880 GtkWidget *menu; | 3872 GtkWidget *menu; |
3881 GtkWidget *sw; | 3873 GtkWidget *sw; |
3882 GtkWidget *sep; | 3874 GtkWidget *sep; |
3883 GtkWidget *hbox; | |
3884 GtkWidget *label, *arrow; | |
3885 GtkAccelGroup *accel_group; | 3875 GtkAccelGroup *accel_group; |
3886 GtkTreeSelection *selection; | 3876 GtkTreeSelection *selection; |
3887 GtkTargetEntry dte[] = {{"GAIM_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, | 3877 GtkTargetEntry dte[] = {{"GAIM_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, |
3888 {"application/x-im-contact", 0, DRAG_BUDDY}, | 3878 {"application/x-im-contact", 0, DRAG_BUDDY}, |
3889 {"text/x-vcard", 0, DRAG_VCARD }, | 3879 {"text/x-vcard", 0, DRAG_VCARD }, |
4084 | 4074 |
4085 /* Create an empty vbox used for showing connection errors */ | 4075 /* Create an empty vbox used for showing connection errors */ |
4086 gtkblist->error_buttons = gtk_vbox_new(FALSE, 0); | 4076 gtkblist->error_buttons = gtk_vbox_new(FALSE, 0); |
4087 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0); | 4077 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0); |
4088 | 4078 |
4089 /* Create an area for showing buddy list alerts */ | |
4090 hbox = gtk_hbox_new(FALSE,0); | |
4091 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), hbox, FALSE, FALSE, 0); | |
4092 arrow = gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_NONE); | |
4093 gtk_box_pack_end(GTK_BOX(hbox),arrow,FALSE,FALSE,0); | |
4094 label = gtk_label_new(NULL); | |
4095 gtk_label_set_markup(GTK_LABEL(label), "<span size='smaller'><b>(2/3)</b></span>"); | |
4096 gtk_box_pack_end(GTK_BOX(hbox),label,FALSE,FALSE,0); | |
4097 arrow = gtk_arrow_new(GTK_ARROW_LEFT,GTK_SHADOW_NONE); | |
4098 gtk_box_pack_end(GTK_BOX(hbox),arrow,FALSE,FALSE,0); | |
4099 | |
4100 gtkblist->alert_notebook = gtk_notebook_new(); | |
4101 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkblist->alert_notebook), FALSE); | |
4102 gtk_notebook_set_show_border(GTK_NOTEBOOK(gtkblist->alert_notebook), FALSE); | |
4103 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->alert_notebook, FALSE, FALSE, 0); | |
4104 | |
4105 /* Add the statusbox */ | 4079 /* Add the statusbox */ |
4106 gtkblist->statusbox = gtk_gaim_status_box_new(); | 4080 gtkblist->statusbox = gtk_gaim_status_box_new(); |
4107 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); | 4081 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); |
4108 gtk_widget_set_name(gtkblist->statusbox, "gaim_gtkblist_statusbox"); | 4082 gtk_widget_set_name(gtkblist->statusbox, "gaim_gtkblist_statusbox"); |
4109 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->statusbox), 3); | 4083 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->statusbox), 3); |