diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-09-28 01:41:48 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-09-28 01:41:48 +0000 |
commit | e2f0220917ab5a0adf538fc8c2d3f5639b518a57 (patch) | |
tree | cf7a593d1490c33299baf35ac7d6a88d83119fc4 | |
parent | 0d504b6421ccc8c32c7d6ba0f9cd1bc3b3914b15 (diff) |
some code cleanups.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1195 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.ja | 4 | ||||
-rw-r--r-- | src/trayicon.c | 25 |
3 files changed, 22 insertions, 11 deletions
@@ -1,3 +1,7 @@ +2006-09-28 + + * src/trayicon.c: some code cleanups. + 2006-09-27 * src/summaryview.c: adjusted the width of icon columns for win32. diff --git a/ChangeLog.ja b/ChangeLog.ja index 910c4448..9fbc0abd 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,7 @@ +2006-09-28 + + * src/trayicon.c: コードの整理。 + 2006-09-27 * src/summaryview.c: win32 でアイコンカラムの幅を調整。 diff --git a/src/trayicon.c b/src/trayicon.c index ae9b0244..57eb7ab9 100644 --- a/src/trayicon.c +++ b/src/trayicon.c @@ -42,6 +42,7 @@ #include "main.h" #include "inc.h" #include "compose.h" +#include "gtkutils.h" #if GTK_CHECK_VERSION(2, 10, 0) || defined(GDK_WINDOWING_X11) @@ -77,6 +78,8 @@ static void trayicon_destroy_cb (GtkWidget *widget, #endif +static void trayicon_window_present (GtkWindow *window); + static void trayicon_present (GtkWidget *widget, gpointer data); static void trayicon_inc (GtkWidget *widget, @@ -222,10 +225,8 @@ void trayicon_set_stock_icon(StockPixmap icon) static void trayicon_activated(GtkStatusIcon *status_icon, gpointer data) { MainWindow *mainwin = (MainWindow *)data; - GtkWindow *window = GTK_WINDOW(mainwin->window); - gtk_window_set_skip_taskbar_hint(window, FALSE); - gtk_window_present(window); + trayicon_window_present(GTK_WINDOW(mainwin->window)); } static void trayicon_popup_menu_cb(GtkStatusIcon *status_icon, guint button, @@ -281,15 +282,13 @@ static void trayicon_button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer data) { MainWindow *mainwin = (MainWindow *)data; - GtkWindow *window = GTK_WINDOW(mainwin->window); if (!event) return; - if (event->button == 1) { - gtk_window_set_skip_taskbar_hint(window, FALSE); - gtk_window_present(window); - } else if (event->button == 3) { + if (event->button == 1) + trayicon_window_present(GTK_WINDOW(mainwin->window)); + else if (event->button == 3) { gtk_menu_popup(GTK_MENU(trayicon_menu), NULL, NULL, NULL, NULL, event->button, event->time); } @@ -310,13 +309,17 @@ static void trayicon_destroy_cb(GtkWidget *widget, gpointer data) #endif +static void trayicon_window_present(GtkWindow *window) +{ + gtk_window_set_skip_taskbar_hint(window, FALSE); + gtk_window_present(window); +} + static void trayicon_present(GtkWidget *widget, gpointer data) { MainWindow *mainwin = (MainWindow *)data; - GtkWindow *window = GTK_WINDOW(mainwin->window); - gtk_window_set_skip_taskbar_hint(window, FALSE); - gtk_window_present(window); + trayicon_window_present(GTK_WINDOW(mainwin->window)); } static void trayicon_inc(GtkWidget *widget, gpointer data) |