| 34 |
34 |
#include "utils.h"
|
| 35 |
35 |
|
| 36 |
36 |
#define NOTIFICATIONWINDOW_NOTIFY_PERIOD 10000
|
| 37 |
|
#define NOTIFICATIONWINDOW_WIDTH 280
|
| 38 |
|
#define NOTIFICATIONWINDOW_HEIGHT 96
|
|
37 |
#define NOTIFICATIONWINDOW_WIDTH 300
|
|
38 |
#define NOTIFICATIONWINDOW_HEIGHT 64
|
| 39 |
39 |
#define FADE_REFRESH_RATE 50
|
| 40 |
40 |
#define FADE_SPEED 5
|
| 41 |
41 |
|
| ... | ... | |
| 54 |
54 |
gint height;
|
| 55 |
55 |
gint fade_length;
|
| 56 |
56 |
gint fade_count;
|
|
57 |
gint notify_event_count;
|
| 57 |
58 |
guint timeout;
|
| 58 |
59 |
};
|
| 59 |
60 |
|
| ... | ... | |
| 95 |
96 |
#endif
|
| 96 |
97 |
}
|
| 97 |
98 |
|
| 98 |
|
gint notification_window_create(const gchar *message, const gchar *submessage,
|
| 99 |
|
guint timeout)
|
|
99 |
gint notification_window_open(const gchar *message, const gchar *submessage,
|
|
100 |
guint timeout)
|
| 100 |
101 |
{
|
| 101 |
102 |
GtkWidget *window;
|
| 102 |
103 |
GtkWidget *vbox;
|
| ... | ... | |
| 172 |
173 |
notify_window.y = y;
|
| 173 |
174 |
notify_window.fade_length = 0;
|
| 174 |
175 |
notify_window.fade_count = 0;
|
|
176 |
notify_window.notify_event_count = 0;
|
| 175 |
177 |
notify_window.timeout = timeout;
|
| 176 |
178 |
|
| 177 |
179 |
return 0;
|
| ... | ... | |
| 258 |
260 |
static gboolean nwin_motion_notify(GtkWidget *widget, GdkEventMotion *event,
|
| 259 |
261 |
gpointer data)
|
| 260 |
262 |
{
|
|
263 |
if (notify_window.fade_count > 0 &&
|
|
264 |
notify_window.notify_event_count == 0) {
|
|
265 |
notify_window.notify_event_count++;
|
|
266 |
return FALSE;
|
|
267 |
}
|
|
268 |
|
| 261 |
269 |
if (notify_window.notify_tag > 0) {
|
| 262 |
270 |
g_source_remove(notify_window.notify_tag);
|
| 263 |
271 |
notify_window.notify_tag = 0;
|
| 264 |
272 |
}
|
| 265 |
273 |
notify_window.fade_count = 0;
|
|
274 |
notify_window.notify_event_count = 0;
|
| 266 |
275 |
gtk_window_move(GTK_WINDOW(notify_window.window),
|
| 267 |
276 |
notify_window.x, notify_window.y);
|
| 268 |
277 |
notify_window.notify_tag = g_timeout_add(notify_window.timeout * 1000,
|