0.8.11claws41
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 23 Mar 2003 16:09:21 +0000 (16:09 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 23 Mar 2003 16:09:21 +0000 (16:09 +0000)
* 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
configure.ac
src/plugins/trayicon/gnome-mail.xpm [deleted file]
src/plugins/trayicon/gnome-nomail.xpm [deleted file]
src/plugins/trayicon/newmail.xpm [new file with mode: 0644]
src/plugins/trayicon/nomail.xpm [new file with mode: 0644]
src/plugins/trayicon/trayicon.c
src/plugins/trayicon/unreadmail.xpm [new file with mode: 0644]

index 61b1227..7c36792 100644 (file)
@@ -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
index 73d5edc..b81f6b5 100644 (file)
@@ -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 (file)
index 703b182..0000000
+++ /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 (file)
index 15950fa..0000000
+++ /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 (file)
index 0000000..6625fa0
--- /dev/null
@@ -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 (file)
index 0000000..236e6d7
--- /dev/null
@@ -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",
+"                ",
+"                ",
+"                ",
+"    ........    ",
+"   .++@@@@#$.   ",
+"  .+#########.  ",
+" .+++$$$$$$###. ",
+"....+$$$$$$#....",
+".%$+.$$$$$$.##&.",
+".%$+.$$$$$$.##&.",
+".%$+.$$$$$$.##&.",
+".%$+#......###&.",
+".%$+##########&.",
+".%$+##########&.",
+" .$+##########. ",
+"  ............  "};
index 9f2eebc..2326fd1 100644 (file)
 #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 (file)
index 0000000..15b2e64
--- /dev/null
@@ -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",
+"   ...........  ",
+"  .+++++++++++. ",
+" .............. ",
+" .@@@@@@@@@@@@. ",
+" .@####@@@@$$@. ",
+" .@@@@@@@@@$$@. ",
+" .@@@@@@@@@@@@. ",
+"....@@####@@....",
+".@+%.@@@@@@.##&.",
+".@+%.@@@##@.##&.",
+".@+%.@@@@@@.##&.",
+".@+%#......###&.",
+".@+%##########&.",
+".@+%##########&.",
+" .+%##########. ",
+"  ............  "};