diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-11-08 08:52:10 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-11-08 08:52:10 +0000 |
commit | a677da5952b975fe9163de56db0a956c3d11d94f (patch) | |
tree | ce7b2986eb1cb7472d7a087efc70328eaaa95347 | |
parent | 6605977726961165229e7bc654b12e115f06bed0 (diff) |
added icons for notifying the arrival of new mail.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1281 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLog.ja | 8 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/icons/Makefile.am | 4 | ||||
-rw-r--r-- | src/icons/stock_sylpheed_newmail.png | bin | 0 -> 2483 bytes | |||
-rw-r--r-- | src/icons/stock_sylpheed_newmail_16.png | bin | 0 -> 685 bytes | |||
-rw-r--r-- | src/stock_pixmap.c | 4 | ||||
-rw-r--r-- | src/stock_pixmap.h | 2 | ||||
-rw-r--r-- | src/trayicon.c | 38 |
9 files changed, 55 insertions, 12 deletions
@@ -1,3 +1,12 @@ +2006-11-08 + + * src/trayicon.c + src/icons/stock_sylpheed_newmail.png + src/icons/stock_sylpheed_newmail_16.png + src/icons/Makefile.am + src/stock_pixmap.[ch]: added icons for notifying the arrival of new + mail. + 2006-11-06 * src/undo.c: fixed a bug that text was not redrawn on the undo of diff --git a/ChangeLog.ja b/ChangeLog.ja index 58c57b49..26083a73 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,11 @@ +2006-11-08 + + * src/trayicon.c + src/icons/stock_sylpheed_newmail.png + src/icons/stock_sylpheed_newmail_16.png + src/icons/Makefile.am + src/stock_pixmap.[ch]: 新着メールの到着を知らせるアイコンを追加。 + 2006-11-06 * src/undo.c: 大きなテキストのアンドゥでテキストが再描画されない diff --git a/configure.in b/configure.in index 77632181..cef75efe 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ MINOR_VERSION=3 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=beta4 +EXTRA_VERSION=beta4+svn BUILD_REVISION=0 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am index 390137e0..4dc4a2f1 100644 --- a/src/icons/Makefile.am +++ b/src/icons/Makefile.am @@ -21,6 +21,8 @@ BUILT_SOURCES = \ stock_sylpheed.h \ stock_sylpheed_16.h \ stock_sylpheed_32.h \ + stock_sylpheed_newmail.h \ + stock_sylpheed_newmail_16.h \ sylpheed-logo.h EXTRA_DIST = \ @@ -46,6 +48,8 @@ EXTRA_DIST = \ stock_sylpheed.png \ stock_sylpheed_16.png \ stock_sylpheed_32.png \ + stock_sylpheed_newmail.png \ + stock_sylpheed_newmail_16.png \ sylpheed-logo.png \ clip.xpm \ deleted.xpm \ diff --git a/src/icons/stock_sylpheed_newmail.png b/src/icons/stock_sylpheed_newmail.png Binary files differnew file mode 100644 index 00000000..58f3b4c7 --- /dev/null +++ b/src/icons/stock_sylpheed_newmail.png diff --git a/src/icons/stock_sylpheed_newmail_16.png b/src/icons/stock_sylpheed_newmail_16.png Binary files differnew file mode 100644 index 00000000..7f29ea2e --- /dev/null +++ b/src/icons/stock_sylpheed_newmail_16.png diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c index 755fc029..e8de2926 100644 --- a/src/stock_pixmap.c +++ b/src/stock_pixmap.c @@ -73,6 +73,8 @@ #include "icons/stock_sylpheed.h" #include "icons/stock_sylpheed_16.h" #include "icons/stock_sylpheed_32.h" +#include "icons/stock_sylpheed_newmail.h" +#include "icons/stock_sylpheed_newmail_16.h" #include "icons/sylpheed-logo.h" typedef struct _StockPixmapData StockPixmapData; @@ -139,6 +141,8 @@ static StockPixmapData pixmaps[] = {NULL, NULL, NULL, NULL, stock_sylpheed, sizeof(stock_sylpheed), NULL, 0}, {NULL, NULL, NULL, NULL, stock_sylpheed_16, sizeof(stock_sylpheed_16), NULL, 0}, {NULL, NULL, NULL, NULL, stock_sylpheed_32, sizeof(stock_sylpheed_32), NULL, 0}, + {NULL, NULL, NULL, NULL, stock_sylpheed_newmail, sizeof(stock_sylpheed_newmail), NULL, 0}, + {NULL, NULL, NULL, NULL, stock_sylpheed_newmail_16, sizeof(stock_sylpheed_newmail_16), NULL, 0}, {NULL, NULL, NULL, NULL, sylpheed_logo, sizeof(sylpheed_logo), NULL, 0}, }; diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h index b3cdc849..236dbe27 100644 --- a/src/stock_pixmap.h +++ b/src/stock_pixmap.h @@ -73,6 +73,8 @@ typedef enum STOCK_PIXMAP_SYLPHEED, STOCK_PIXMAP_SYLPHEED_SMALL, STOCK_PIXMAP_SYLPHEED_32, + STOCK_PIXMAP_SYLPHEED_NEWMAIL, + STOCK_PIXMAP_SYLPHEED_NEWMAIL_SMALL, STOCK_PIXMAP_SYLPHEED_LOGO, N_STOCK_PIXMAPS diff --git a/src/trayicon.c b/src/trayicon.c index ae5b7db9..1e8e3d98 100644 --- a/src/trayicon.c +++ b/src/trayicon.c @@ -47,13 +47,24 @@ #if GTK_CHECK_VERSION(2, 10, 0) || defined(GDK_WINDOWING_X11) #if GTK_CHECK_VERSION(2, 10, 0) - #include <gtk/gtkstatusicon.h> +#endif + +#ifdef G_OS_WIN32 +#define TRAYICON_IMAGE STOCK_PIXMAP_SYLPHEED_SMALL +#define TRAYICON_NEW_IMAGE STOCK_PIXMAP_SYLPHEED_NEWMAIL_SMALL +#else +#define TRAYICON_IMAGE STOCK_PIXMAP_SYLPHEED +#define TRAYICON_NEW_IMAGE STOCK_PIXMAP_SYLPHEED_NEWMAIL +#endif static TrayIcon trayicon; static GtkWidget *trayicon_menu; +static gboolean on_notify = FALSE; static gboolean default_tooltip = FALSE; +#if GTK_CHECK_VERSION(2, 10, 0) + static void trayicon_activated (GtkStatusIcon *status_icon, gpointer data); static void trayicon_popup_menu_cb (GtkStatusIcon *status_icon, @@ -63,12 +74,9 @@ static void trayicon_popup_menu_cb (GtkStatusIcon *status_icon, #else -static TrayIcon trayicon; static GtkWidget *trayicon_img; static GtkWidget *eventbox; static GtkTooltips *trayicon_tip; -static GtkWidget *trayicon_menu; -static gboolean default_tooltip = FALSE; static void trayicon_button_pressed (GtkWidget *widget, GdkEventButton *event, @@ -98,11 +106,7 @@ TrayIcon *trayicon_create(MainWindow *mainwin) #if GTK_CHECK_VERSION(2, 10, 0) GdkPixbuf *pixbuf; -#ifdef G_OS_WIN32 - stock_pixbuf_gdk(NULL, STOCK_PIXMAP_SYLPHEED_SMALL, &pixbuf); -#else - stock_pixbuf_gdk(NULL, STOCK_PIXMAP_SYLPHEED, &pixbuf); -#endif + stock_pixbuf_gdk(NULL, TRAYICON_IMAGE, &pixbuf); trayicon.status_icon = gtk_status_icon_new_from_pixbuf(pixbuf); g_signal_connect(G_OBJECT(trayicon.status_icon), "activate", @@ -119,13 +123,13 @@ TrayIcon *trayicon_create(MainWindow *mainwin) gtk_container_add(GTK_CONTAINER(trayicon.widget), eventbox); g_signal_connect(G_OBJECT(eventbox), "button_press_event", G_CALLBACK(trayicon_button_pressed), mainwin); - trayicon_img = stock_pixbuf_widget_scale(NULL, STOCK_PIXMAP_SYLPHEED, - 24, 24); + trayicon_img = stock_pixbuf_widget_scale(NULL, TRAYICON_IMAGE, 24, 24); gtk_widget_show(trayicon_img); gtk_container_add(GTK_CONTAINER(eventbox), trayicon_img); trayicon_tip = gtk_tooltips_new(); #endif + on_notify = FALSE; default_tooltip = FALSE; trayicon_set_tooltip(NULL); @@ -207,6 +211,18 @@ gboolean notify_timeout_cb(gpointer data) void trayicon_set_notify(gboolean enabled) { + GdkPixbuf *pixbuf; + + if (enabled && !on_notify) { + stock_pixbuf_gdk(NULL, TRAYICON_NEW_IMAGE, &pixbuf); + gtk_status_icon_set_from_pixbuf(trayicon.status_icon, pixbuf); + on_notify = TRUE; + } else if (!enabled && on_notify) { + stock_pixbuf_gdk(NULL, TRAYICON_IMAGE, &pixbuf); + gtk_status_icon_set_from_pixbuf(trayicon.status_icon, pixbuf); + on_notify = FALSE; + } + if (enabled && notify_tag == 0) { gtk_status_icon_set_blinking(trayicon.status_icon, enabled); notify_tag = g_timeout_add(5000, notify_timeout_cb, NULL); |