comparison pidgin/gtkstatusbox.c @ 15397:a8ee645e7fb4

A lot of status icon changes: - Added Tango icons to blist - Added tooltip changes A work in progress. TODO: - desaturate and tranparentify status icons in list - protocol icon in tooltip - statusbox icon changes - Add emblems
author Sean Egan <seanegan@gmail.com>
date Wed, 24 Jan 2007 09:30:54 +0000
parents 5fe8042783c1
children 74ab783e3676
comparison
equal deleted inserted replaced
15396:eb93d03ed6c7 15397:a8ee645e7fb4
516 GdkPixbuf *pixbuf; 516 GdkPixbuf *pixbuf;
517 GtkTreePath *path; 517 GtkTreePath *path;
518 gboolean account_status = FALSE; 518 gboolean account_status = FALSE;
519 GaimAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account; 519 GaimAccount *acct = (status_box->token_status_account) ? status_box->token_status_account : status_box->account;
520 520
521 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); 521 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_TANGO_EXTRA_SMALL);
522 522
523 style = gtk_widget_get_style(GTK_WIDGET(status_box)); 523 style = gtk_widget_get_style(GTK_WIDGET(status_box));
524 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x", 524 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
525 style->text_aa[GTK_STATE_NORMAL].red >> 8, 525 style->text_aa[GTK_STATE_NORMAL].red >> 8,
526 style->text_aa[GTK_STATE_NORMAL].green >> 8, 526 style->text_aa[GTK_STATE_NORMAL].green >> 8,
816 list = gaim_savedstatuses_get_popular(6); 816 list = gaim_savedstatuses_get_popular(6);
817 if (list == NULL) 817 if (list == NULL)
818 /* Odd... oh well, nothing we can do about it. */ 818 /* Odd... oh well, nothing we can do about it. */
819 return; 819 return;
820 820
821 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); 821 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_TANGO_EXTRA_SMALL);
822 822
823 gtk_gaim_status_box_add_separator(statusbox); 823 gtk_gaim_status_box_add_separator(statusbox);
824 824
825 for (cur = list; cur != NULL; cur = cur->next) 825 for (cur = list; cur != NULL; cur = cur->next)
826 { 826 {
954 gtk_gaim_status_box_regenerate(GtkGaimStatusBox *status_box) 954 gtk_gaim_status_box_regenerate(GtkGaimStatusBox *status_box)
955 { 955 {
956 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4; 956 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4;
957 GtkIconSize icon_size; 957 GtkIconSize icon_size;
958 958
959 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); 959 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_TANGO_EXTRA_SMALL);
960 960
961 /* Unset the model while clearing it */ 961 /* Unset the model while clearing it */
962 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL); 962 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL);
963 gtk_list_store_clear(status_box->dropdown_store); 963 gtk_list_store_clear(status_box->dropdown_store);
964 /* Don't set the model until the new statuses have been added to the box. 964 /* Don't set the model until the new statuses have been added to the box.
1084 cache_pixbufs(GtkGaimStatusBox *status_box) 1084 cache_pixbufs(GtkGaimStatusBox *status_box)
1085 { 1085 {
1086 GtkIconSize icon_size; 1086 GtkIconSize icon_size;
1087 1087
1088 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); 1088 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL);
1089 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); 1089 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_TANGO_EXTRA_SMALL);
1090 1090
1091 if (status_box->connecting_pixbufs[0] != NULL) 1091 if (status_box->connecting_pixbufs[0] != NULL)
1092 gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); 1092 gdk_pixbuf_unref(status_box->connecting_pixbufs[0]);
1093 if (status_box->connecting_pixbufs[1] != NULL) 1093 if (status_box->connecting_pixbufs[1] != NULL)
1094 gdk_pixbuf_unref(status_box->connecting_pixbufs[1]); 1094 gdk_pixbuf_unref(status_box->connecting_pixbufs[1]);
1671 gint border_width = GTK_CONTAINER (widget)->border_width; 1671 gint border_width = GTK_CONTAINER (widget)->border_width;
1672 1672
1673 gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->toggle_button, requisition); 1673 gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->toggle_button, requisition);
1674 1674
1675 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ 1675 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */
1676 requisition->height = MAX(requisition->height, 30 + (border_width*2)); 1676 requisition->height = MAX(requisition->height, 32 + (border_width*2));
1677 1677
1678 /* If the gtkimhtml is visible, then add some additional padding */ 1678 /* If the gtkimhtml is visible, then add some additional padding */
1679 gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req); 1679 gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req);
1680 if (box_req.height > 1) 1680 if (box_req.height > 1)
1681 requisition->height += box_req.height + border_width * 2; 1681 requisition->height += box_req.height + border_width * 2;
1733 gint border_width = GTK_CONTAINER (widget)->border_width; 1733 gint border_width = GTK_CONTAINER (widget)->border_width;
1734 1734
1735 gtk_widget_size_request(status_box->toggle_button, &req); 1735 gtk_widget_size_request(status_box->toggle_button, &req);
1736 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ 1736 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */
1737 1737
1738 req.height = MAX(req.height, 30 + (border_width*2)); 1738 req.height = MAX(req.height, 32 + (border_width*2));
1739 1739
1740 box_alc = *allocation; 1740 box_alc = *allocation;
1741 1741
1742 box_alc.width -= (border_width * 2); 1742 box_alc.width -= (border_width * 2);
1743 box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2))); 1743 box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2)));
1949 } 1949 }
1950 1950
1951 if (status_box->buddy_icon != NULL) { 1951 if (status_box->buddy_icon != NULL) {
1952 gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); 1952 gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon);
1953 status_box->buddy_icon_hover = gdk_pixbuf_copy(status_box->buddy_icon); 1953 status_box->buddy_icon_hover = gdk_pixbuf_copy(status_box->buddy_icon);
1954 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); 1954 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 32);
1955 } 1955 }
1956 } 1956 }
1957 1957
1958 void 1958 void
1959 gtk_gaim_status_box_set_buddy_icon(GtkGaimStatusBox *status_box, const char *filename) 1959 gtk_gaim_status_box_set_buddy_icon(GtkGaimStatusBox *status_box, const char *filename)