diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-02-13 08:09:40 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-02-13 08:09:40 +0000 |
commit | def6dee82e3ddfbaaba95255f08e196575444f58 (patch) | |
tree | 77017fe65127eb83dc5211ab39c0afe6c3c4c34f /src | |
parent | 5ce784ecf14a06f6e84f39a3cfd20f4c2292cbc2 (diff) |
modified notification window.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3216 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/inc.c | 2 | ||||
-rw-r--r-- | src/notificationwindow.c | 17 | ||||
-rw-r--r-- | src/notificationwindow.h | 2 |
3 files changed, 15 insertions, 6 deletions
@@ -250,7 +250,7 @@ static void inc_finished(MainWindow *mainwin, IncResult *result) } } - notification_window_create(buf, str->str, 5); + notification_window_open(buf, str->str, 5); } g_string_free(str, TRUE); diff --git a/src/notificationwindow.c b/src/notificationwindow.c index 7c8b0258..51c7d4ae 100644 --- a/src/notificationwindow.c +++ b/src/notificationwindow.c @@ -34,8 +34,8 @@ #include "utils.h" #define NOTIFICATIONWINDOW_NOTIFY_PERIOD 10000 -#define NOTIFICATIONWINDOW_WIDTH 280 -#define NOTIFICATIONWINDOW_HEIGHT 96 +#define NOTIFICATIONWINDOW_WIDTH 300 +#define NOTIFICATIONWINDOW_HEIGHT 64 #define FADE_REFRESH_RATE 50 #define FADE_SPEED 5 @@ -54,6 +54,7 @@ struct _NotificationWindow gint height; gint fade_length; gint fade_count; + gint notify_event_count; guint timeout; }; @@ -95,8 +96,8 @@ static void get_work_area(GdkRectangle *rect) #endif } -gint notification_window_create(const gchar *message, const gchar *submessage, - guint timeout) +gint notification_window_open(const gchar *message, const gchar *submessage, + guint timeout) { GtkWidget *window; GtkWidget *vbox; @@ -172,6 +173,7 @@ gint notification_window_create(const gchar *message, const gchar *submessage, notify_window.y = y; notify_window.fade_length = 0; notify_window.fade_count = 0; + notify_window.notify_event_count = 0; notify_window.timeout = timeout; return 0; @@ -258,11 +260,18 @@ static gboolean nwin_entered(GtkWidget *widget, GdkEventCrossing *event, static gboolean nwin_motion_notify(GtkWidget *widget, GdkEventMotion *event, gpointer data) { + if (notify_window.fade_count > 0 && + notify_window.notify_event_count == 0) { + notify_window.notify_event_count++; + return FALSE; + } + if (notify_window.notify_tag > 0) { g_source_remove(notify_window.notify_tag); notify_window.notify_tag = 0; } notify_window.fade_count = 0; + notify_window.notify_event_count = 0; gtk_window_move(GTK_WINDOW(notify_window.window), notify_window.x, notify_window.y); notify_window.notify_tag = g_timeout_add(notify_window.timeout * 1000, diff --git a/src/notificationwindow.h b/src/notificationwindow.h index d724af27..c2c2c53d 100644 --- a/src/notificationwindow.h +++ b/src/notificationwindow.h @@ -25,7 +25,7 @@ typedef struct _NotificationWindow NotificationWindow; -gint notification_window_create (const gchar *message, +gint notification_window_open (const gchar *message, const gchar *submessage, guint timeout); void notification_window_set_message (const gchar *message, |