From 61387133d979e53767055ac7339298f0450a4bb1 Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Sun, 23 Mar 2003 16:09:21 +0000 Subject: [PATCH 1/1] 0.8.11claws41 * src/plugins/trayicon/gnome-mail.xpm ** REMOVE ** * src/plugins/trayicon/gnome-nomail.xpm ** REMOVE ** * src/plugins/trayicon/newmail.xpm ** NEW ** * src/plugins/trayicon/nomail.xpm ** NEW ** * src/plugins/trayicon/trayicon.c * src/plugins/trayicon/unreadmail.xpm ** NEW ** o replace GBiff icons with KBiff icons resized to 16x16 pixel o add icon for unread mails o set transparency for window --- ChangeLog.claws | 12 ++++++++ configure.ac | 2 +- src/plugins/trayicon/gnome-mail.xpm | 26 ----------------- src/plugins/trayicon/gnome-nomail.xpm | 23 --------------- src/plugins/trayicon/newmail.xpm | 27 ++++++++++++++++++ src/plugins/trayicon/nomail.xpm | 27 ++++++++++++++++++ src/plugins/trayicon/trayicon.c | 41 ++++++++++++++++++++------- src/plugins/trayicon/unreadmail.xpm | 27 ++++++++++++++++++ 8 files changed, 125 insertions(+), 60 deletions(-) delete mode 100644 src/plugins/trayicon/gnome-mail.xpm delete mode 100644 src/plugins/trayicon/gnome-nomail.xpm create mode 100644 src/plugins/trayicon/newmail.xpm create mode 100644 src/plugins/trayicon/nomail.xpm create mode 100644 src/plugins/trayicon/unreadmail.xpm diff --git a/ChangeLog.claws b/ChangeLog.claws index 61b122733..7c367924f 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,15 @@ +2003-03-22 [christoph] 0.8.11claws41 + + * src/plugins/trayicon/gnome-mail.xpm ** REMOVE ** + * src/plugins/trayicon/gnome-nomail.xpm ** REMOVE ** + * src/plugins/trayicon/newmail.xpm ** NEW ** + * src/plugins/trayicon/nomail.xpm ** NEW ** + * src/plugins/trayicon/trayicon.c + * src/plugins/trayicon/unreadmail.xpm ** NEW ** + o replace GBiff icons with KBiff icons resized to 16x16 pixel + o add icon for unread mails + o set transparency for window + 2003-03-22 [christoph] 0.8.11claws40 * src/news.c diff --git a/configure.ac b/configure.ac index 73d5edc18..b81f6b528 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=11 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws40 +EXTRA_VERSION=claws41 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/plugins/trayicon/gnome-mail.xpm b/src/plugins/trayicon/gnome-mail.xpm deleted file mode 100644 index 703b18299..000000000 --- a/src/plugins/trayicon/gnome-mail.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -static char * mail_xpm[] = { -"28 16 7 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #CCCCCC", -"# c #00FFFF", -"$ c #0000FF", -"% c #999999", -"............................", -".++++++++++++++++++++++++++.", -".+++++++++++++@@+++@@+###$+.", -".+%....%+++++@++@@@++@###$+.", -".++++++++++++@++@++@@+###$+.", -".+%....%++++++@@+@@++@$$$$+.", -".++++++++++++++++++++++++++.", -".++++++++..........++++++++.", -".++++++++++++++++++++++++++.", -".++++++++........++++++++++.", -".++++++++++++++++++++++++++.", -".++++++++...........+++++++.", -".++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++.", -".++++++++++++++++++++++++++.", -"............................"}; diff --git a/src/plugins/trayicon/gnome-nomail.xpm b/src/plugins/trayicon/gnome-nomail.xpm deleted file mode 100644 index 15950fa73..000000000 --- a/src/plugins/trayicon/gnome-nomail.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static char * nomail_xpm[] = { -"28 16 4 1", -" c None", -". c #999999", -"+ c #FFFFFF", -"@ c #CCCCCC", -"............................", -".++++++++++++++++++++++++++.", -".+@@@@@@@@@@@@@@@@@@@@@@@.@.", -".+......@@@@@@@@@@@@@@@@@.+.", -".+@++++++@@@@@@@@@@@@@@@@.+.", -".+......@@@@@@@@@@@@@@....+.", -".+@++++++@@@@@@@@@@@@@@++++.", -".+@@@@@@@..........@@@@@@@@.", -".+@@@@@@@@++++++++++@@@@@@@.", -".+@@@@@@@........@@@@@@@@@@.", -".+@@@@@@@@++++++++@@@@@@@@@.", -".+@@@@@@@...........@@@@@@@.", -".+@@@@@@@@+++++++++++@@@@@@.", -".+@@@@@@@@@@@@@@@@@@@@@@@@@.", -".+@@@@@@@@@@@@@@@@@@@@@@@@@.", -"............................"}; diff --git a/src/plugins/trayicon/newmail.xpm b/src/plugins/trayicon/newmail.xpm new file mode 100644 index 000000000..6625fa0fd --- /dev/null +++ b/src/plugins/trayicon/newmail.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char * newmail_xpm[] = { +"16 16 8 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"@ c #FF0000", +"# c #A0A0A0", +"$ c #C3C3C3", +"% c #808080", +"& c #585858", +" .. ", +" .++. ", +" .++@+. ", +" .++@@@+. ", +" .++++@+++. ", +" .+++#+++#++. ", +" .+++#+++#+++.. ", +"....++++#+++....", +".+$#.++#+++.%%&.", +".+$#.+#+++..%%&.", +".+$#.++++.$.%%&.", +".+$#%......%%%&.", +".+$#%%%%%%%%%%&.", +".+$#%%%%%%%%%%&.", +" .$#%%%%%%%%%%. ", +" ............ "}; diff --git a/src/plugins/trayicon/nomail.xpm b/src/plugins/trayicon/nomail.xpm new file mode 100644 index 000000000..236e6d792 --- /dev/null +++ b/src/plugins/trayicon/nomail.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char * nomail_xpm[] = { +"16 16 8 1", +" c None", +". c #000000", +"+ c #A0A0A0", +"@ c #DCDCDC", +"# c #808080", +"$ c #C3C3C3", +"% c #FFFFFF", +"& c #585858", +" ", +" ", +" ", +" ........ ", +" .++@@@@#$. ", +" .+#########. ", +" .+++$$$$$$###. ", +"....+$$$$$$#....", +".%$+.$$$$$$.##&.", +".%$+.$$$$$$.##&.", +".%$+.$$$$$$.##&.", +".%$+#......###&.", +".%$+##########&.", +".%$+##########&.", +" .$+##########. ", +" ............ "}; diff --git a/src/plugins/trayicon/trayicon.c b/src/plugins/trayicon/trayicon.c index 9f2eebcff..2326fd166 100644 --- a/src/plugins/trayicon/trayicon.c +++ b/src/plugins/trayicon/trayicon.c @@ -26,15 +26,19 @@ #include "hooks.h" #include "folder.h" #include "mainwindow.h" +#include "gtkutils.h" #include "eggtrayicon.h" -#include "gnome-mail.xpm" -#include "gnome-nomail.xpm" +#include "newmail.xpm" +#include "unreadmail.xpm" +#include "nomail.xpm" static gint hook_id; -static GdkPixmap *mail_pixmap; -static GdkPixmap *mail_bitmap; +static GdkPixmap *newmail_pixmap; +static GdkPixmap *newmail_bitmap; +static GdkPixmap *unreadmail_pixmap; +static GdkPixmap *unreadmail_bitmap; static GdkPixmap *nomail_pixmap; static GdkPixmap *nomail_bitmap; @@ -78,8 +82,13 @@ static void set_trayicon_pixmap(TrayIconType icontype) switch(icontype) { case TRAYICON_NEW: - pixmap = mail_pixmap; - bitmap = mail_bitmap; + pixmap = newmail_pixmap; + bitmap = newmail_bitmap; + break; + case TRAYICON_UNREAD: + case TRAYICON_UNREADMARKED: + pixmap = unreadmail_pixmap; + bitmap = unreadmail_bitmap; break; default: pixmap = nomail_pixmap; @@ -88,9 +97,10 @@ static void set_trayicon_pixmap(TrayIconType icontype) } gtk_pixmap_set(GTK_PIXMAP(image), pixmap, bitmap); + gtk_widget_shape_combine_mask(trayicon, bitmap, 0, 3); } -static gboolean folder_item_update_hook(gpointer source, gpointer data) +static void update() { gint new, unread, unreadmarked, total; gchar *buf; @@ -101,11 +111,16 @@ static gboolean folder_item_update_hook(gpointer source, gpointer data) gtk_tooltips_set_tip(tooltips, eventbox, buf, ""); g_free(buf); - set_trayicon_pixmap(new > 0 ? TRAYICON_NEW : TRAYICON_NOTHING); + set_trayicon_pixmap(new > 0 ? TRAYICON_NEW : (unread > 0 ? TRAYICON_UNREAD : TRAYICON_NOTHING)); return FALSE; } +static gboolean folder_item_update_hook(gpointer source, gpointer data) +{ + update(); +} + int plugin_init(gchar **error) { hook_id = hooks_register_hook (FOLDER_ITEM_UPDATE_HOOKLIST, folder_item_update_hook, NULL); @@ -115,10 +130,14 @@ int plugin_init(gchar **error) } trayicon = egg_tray_icon_new("Sylpheed-Claws"); + gtk_widget_set_usize(GTK_WIDGET(trayicon), 16, 16); gtk_container_set_border_width(GTK_CONTAINER(trayicon), 0); - nomail_pixmap = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(trayicon)->window, &nomail_bitmap, NULL, nomail_xpm); - mail_pixmap = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(trayicon)->window, &mail_bitmap, NULL, mail_xpm); + PIXMAP_CREATE(GTK_WIDGET(trayicon), nomail_pixmap, nomail_bitmap, nomail_xpm); + PIXMAP_CREATE(GTK_WIDGET(trayicon), unreadmail_pixmap, unreadmail_bitmap, unreadmail_xpm); + PIXMAP_CREATE(GTK_WIDGET(trayicon), newmail_pixmap, newmail_bitmap, newmail_xpm); + + printf("%p\n", nomail_bitmap->user_data); eventbox = gtk_event_box_new(); gtk_container_set_border_width(eventbox, 0); @@ -135,6 +154,8 @@ int plugin_init(gchar **error) gtk_widget_show_all(GTK_WIDGET(trayicon)); + update(); + return 0; } diff --git a/src/plugins/trayicon/unreadmail.xpm b/src/plugins/trayicon/unreadmail.xpm new file mode 100644 index 000000000..15b2e6456 --- /dev/null +++ b/src/plugins/trayicon/unreadmail.xpm @@ -0,0 +1,27 @@ +/* XPM */ +static char * unreadmail_xpm[] = { +"16 16 8 1", +" c None", +". c #000000", +"+ c #C3C3C3", +"@ c #FFFFFF", +"# c #808080", +"$ c #FF0000", +"% c #A0A0A0", +"& c #636363", +" ........... ", +" .+++++++++++. ", +" .............. ", +" .@@@@@@@@@@@@. ", +" .@####@@@@$$@. ", +" .@@@@@@@@@$$@. ", +" .@@@@@@@@@@@@. ", +"....@@####@@....", +".@+%.@@@@@@.##&.", +".@+%.@@@##@.##&.", +".@+%.@@@@@@.##&.", +".@+%#......###&.", +".@+%##########&.", +".@+%##########&.", +" .+%##########. ", +" ............ "}; -- 2.25.1