From a777361f0e24dbf226d309babdd93a968b9f8148 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 10 Nov 2006 02:16:49 +0000 Subject: implemented trayicon notification with eggtrayicon. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1288 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 10 ++++++++++ ChangeLog.ja | 10 ++++++++++ configure.in | 2 +- src/eggtrayicon.c | 6 +++--- src/eggtrayicon.h | 5 +++-- src/trayicon.c | 23 ++++++++++++----------- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1194f40..29d299f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-11-10 + + * version 2.3.0beta5 + +2006-11-10 + + * src/trayicon.[ch]: implemented trayicon_set_notify() with + eggtrayicon. Don't compile eggtrayicon with GTK+ >= 2.10.0. + Some code cleanups. + 2006-11-09 * src/inc.c diff --git a/ChangeLog.ja b/ChangeLog.ja index 25df5055..a30ac049 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,13 @@ +2006-11-10 + + * version 2.3.0beta5 + +2006-11-10 + + * src/trayicon.c: eggtrayicon 版で trayicon_set_notify() を実装。 + GTK+ >= 2.10.0 で eggtrayicon をコンパイルしないようにした。 + コードの整理。 + 2006-11-09 * src/inc.c diff --git a/configure.in b/configure.in index cef75efe..019b676f 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+svn +EXTRA_VERSION=beta5 BUILD_REVISION=0 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION diff --git a/src/eggtrayicon.c b/src/eggtrayicon.c index b1c93e3d..d913736d 100644 --- a/src/eggtrayicon.c +++ b/src/eggtrayicon.c @@ -20,12 +20,12 @@ /* Added WINDOWING ifdef 2005-07-09 by Yoichi Imai */ #include -#include -#include #include "eggtrayicon.h" -#ifdef GDK_WINDOWING_X11 +#if !GTK_CHECK_VERSION(2, 10, 0) && defined(GDK_WINDOWING_X11) +#include +#include #include #include diff --git a/src/eggtrayicon.h b/src/eggtrayicon.h index 7bbfe8bf..c0abfc0a 100644 --- a/src/eggtrayicon.h +++ b/src/eggtrayicon.h @@ -21,10 +21,11 @@ #ifndef __EGG_TRAY_ICON_H__ #define __EGG_TRAY_ICON_H__ -#include +#include #include -#ifdef GDK_WINDOWING_X11 +#if !GTK_CHECK_VERSION(2, 10, 0) && defined(GDK_WINDOWING_X11) +#include #include G_BEGIN_DECLS diff --git a/src/trayicon.c b/src/trayicon.c index 677c4f29..51d9f47c 100644 --- a/src/trayicon.c +++ b/src/trayicon.c @@ -213,12 +213,10 @@ 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); + trayicon_set_stock_icon(TRAYICON_NEW_IMAGE); 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); + trayicon_set_stock_icon(TRAYICON_IMAGE); on_notify = FALSE; } @@ -234,13 +232,9 @@ void trayicon_set_notify(gboolean enabled) void trayicon_set_stock_icon(StockPixmap icon) { GdkPixbuf *pixbuf; - GdkPixbuf *scaled_pixbuf; stock_pixbuf_gdk(NULL, icon, &pixbuf); - scaled_pixbuf = gdk_pixbuf_scale_simple(pixbuf, 24, 24, - GDK_INTERP_HYPER); - gtk_status_icon_set_from_pixbuf(trayicon.status_icon, scaled_pixbuf); - g_object_unref(scaled_pixbuf); + gtk_status_icon_set_from_pixbuf(trayicon.status_icon, pixbuf); } static void trayicon_activated(GtkStatusIcon *status_icon, gpointer data) @@ -257,7 +251,7 @@ static void trayicon_popup_menu_cb(GtkStatusIcon *status_icon, guint button, button, activate_time); } -#else +#else /* GTK_CHECK_VERSION(2, 10, 0) */ void trayicon_show(TrayIcon *tray_icon) { @@ -294,6 +288,13 @@ void trayicon_set_tooltip(const gchar *text) void trayicon_set_notify(gboolean enabled) { + if (enabled && !on_notify) { + trayicon_set_stock_icon(TRAYICON_NEW_IMAGE); + on_notify = TRUE; + } else if (!enabled && on_notify) { + trayicon_set_stock_icon(TRAYICON_IMAGE); + on_notify = FALSE; + } } void trayicon_set_stock_icon(StockPixmap icon) @@ -337,7 +338,7 @@ static void trayicon_destroy_cb(GtkWidget *widget, gpointer data) g_idle_add(trayicon_restore, data); } -#endif +#endif /* GTK_CHECK_VERSION(2, 10, 0) */ static void trayicon_present(GtkWidget *widget, gpointer data) { -- cgit v1.2.3