Mercurial > pidgin
changeset 15772:79144a15ea78
16px tray icons. These are used if the tray is shorter than 22px, and in Windows where all tray icons are 16x16. I still need to attach to a resizing signal to make them automatically update when the tray resizes.
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 05 Mar 2007 21:36:57 +0000 |
parents | 52ee22ba2cd2 |
children | 037c51958cc6 |
files | configure.ac pidgin/gaimstock.c pidgin/gtkdocklet-x11.c pidgin/pixmaps/tray/16/Makefile.am pidgin/pixmaps/tray/16/Makefile.mingw pidgin/pixmaps/tray/16/tray-away.png pidgin/pixmaps/tray/16/tray-busy.png pidgin/pixmaps/tray/16/tray-connecting.png pidgin/pixmaps/tray/16/tray-extended-away.png pidgin/pixmaps/tray/16/tray-message.png pidgin/pixmaps/tray/16/tray-offline.png pidgin/pixmaps/tray/16/tray-online.png pidgin/pixmaps/tray/Makefile.am pidgin/win32/gtkdocklet-win32.c |
diffstat | 14 files changed, 57 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac Mon Mar 05 01:58:25 2007 +0000 +++ b/configure.ac Mon Mar 05 21:36:57 2007 +0000 @@ -1943,6 +1943,7 @@ pidgin/pixmaps/toolbar/16/Makefile pidgin/pixmaps/toolbar/16/scalable/Makefile pidgin/pixmaps/tray/Makefile + pidgin/pixmaps/tray/16/Makefile pidgin/pixmaps/tray/22/Makefile pidgin/plugins/Makefile pidgin/plugins/cap/Makefile
--- a/pidgin/gaimstock.c Mon Mar 05 01:58:25 2007 +0000 +++ b/pidgin/gaimstock.c Mon Mar 05 21:36:57 2007 +0000 @@ -166,13 +166,13 @@ { PIDGIN_STOCK_TOOLBAR_TYPING, "toolbar", "typing.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE }, { PIDGIN_STOCK_TOOLBAR_PENDING, "status", "message-pending.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_BUSY, "tray", "tray-busy.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_XA, "tray", "tray-extended-away.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_OFFLINE, "tray", "tray-offline.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_CONNECT, "tray", "tray-connecting.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE }, - { PIDGIN_STOCK_TRAY_PENDING, "tray", "tray-message.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE } + { PIDGIN_STOCK_TRAY_AVAILABLE, "tray", "tray-online.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_AWAY, "tray", "tray-away.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_BUSY, "tray", "tray-busy.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_XA, "tray", "tray-extended-away.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_OFFLINE, "tray", "tray-offline.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_CONNECT, "tray", "tray-connecting.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE }, + { PIDGIN_STOCK_TRAY_PENDING, "tray", "tray-message.png", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE } }; static gchar *
--- a/pidgin/gtkdocklet-x11.c Mon Mar 05 01:58:25 2007 +0000 +++ b/pidgin/gtkdocklet-x11.c Mon Mar 05 21:36:57 2007 +0000 @@ -115,37 +115,16 @@ break; } - if(icon_name) - gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL)); - -#if 0 - GdkPixbuf *p; - GdkBitmap *mask = NULL; - - p = gtk_widget_render_icon(GTK_WIDGET(image), icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL); - - if (p && (gdk_pixbuf_get_colorspace(p) == GDK_COLORSPACE_RGB) && (gdk_pixbuf_get_bits_per_sample(p) == 8) - && (gdk_pixbuf_get_has_alpha(p)) && (gdk_pixbuf_get_n_channels(p) == 4)) { - int len = gdk_pixbuf_get_width(p) * gdk_pixbuf_get_height(p); - guchar *data = gdk_pixbuf_get_pixels(p); - guchar *bitmap = g_malloc((len / 8) + 1); - int i; - - for (i = 0; i < len; i++) - if (data[i*4 + 3] > 55) - bitmap[i/8] |= 1 << i % 8; - else - bitmap[i/8] &= ~(1 << i % 8); - - mask = gdk_bitmap_create_from_data(GDK_DRAWABLE(GTK_WIDGET(image)->window), bitmap, gdk_pixbuf_get_width(p), gdk_pixbuf_get_height(p)); - g_free(bitmap); + if(icon_name) { + int icon_size; + GtkAllocation alloc = GTK_WIDGET(docklet)->allocation; + printf("height: %d\n", alloc.height); + if (alloc.height < 22) + icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); + else + icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); + gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, icon_size); } - - if (mask) - gdk_window_shape_combine_mask(image->window, mask, 0, 0); - - g_object_unref(G_OBJECT(p)); -#endif } static void
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/tray/16/Makefile.am Mon Mar 05 21:36:57 2007 +0000 @@ -0,0 +1,18 @@ +TRAY_ICONS = tray-away.png \ + tray-busy.png \ + tray-connecting.png \ + tray-extended-away.png \ + tray-message.png \ + tray-offline.png \ + tray-online.png + +EXTRA_DIST = tray-away.ico \ + tray-busy.ico \ + tray-connecting.ico \ + tray-extended-away.ico \ + tray-message.ico \ + tray-offline.ico \ + tray-online.ico + +pidgintraypixdir = $(datadir)/pixmaps/pidgin/tray/16 +pidgintraypix_DATA = $(TRAY_ICONS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/tray/16/Makefile.mingw Mon Mar 05 21:36:57 2007 +0000 @@ -0,0 +1,20 @@ +# +# Makefile.mingw +# +# Description: Makefile for win32 (mingw) version of Pidgin pixmaps +# + +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libpurple/win32/global.mak + +datadir = $(GAIM_INSTALL_DIR) +include ./Makefile.am + +.PHONY: install + +install: + if test '$(pidgintraypix_DATA)'; then \ + mkdir -p $(pidgintraypixdir); \ + cp $(pidgintraypix_DATA) $(pidgintraypixdir); \ + fi; +
--- a/pidgin/pixmaps/tray/Makefile.am Mon Mar 05 01:58:25 2007 +0000 +++ b/pidgin/pixmaps/tray/Makefile.am Mon Mar 05 21:36:57 2007 +0000 @@ -1,4 +1,4 @@ -SUBDIRS = 22 +SUBDIRS = 16 22 EXTRA_DIST = \ Makefile.mingw \
--- a/pidgin/win32/gtkdocklet-win32.c Mon Mar 05 01:58:25 2007 +0000 +++ b/pidgin/win32/gtkdocklet-win32.c Mon Mar 05 21:36:57 2007 +0000 @@ -443,7 +443,7 @@ static HICON load_hicon_from_stock(const char *stock) { HICON hicon = NULL; GdkPixbuf *pixbuf = gtk_widget_render_icon(image, stock, - gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), NULL); + gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL); if (pixbuf) { hicon = pixbuf_to_hicon(pixbuf);