diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-24 10:31:28 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-24 10:31:28 +0000 |
commit | 1003322f977add069c7ec91546274ffe22de493e (patch) | |
tree | 4152d6d05ebca4f989292b5bbb9660521b392199 /src/mainwindow.c | |
parent | d99c5a9b8032f5290c640bcea7f406326c325c04 (diff) |
separated trayicon into another module, and notify new messages with trayicon on receive.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@510 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index 8ca82a33..4adb8de6 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -77,7 +77,7 @@ #include "alertpanel.h" #include "statusbar.h" #include "inputdialog.h" -#include "eggtrayicon.h" +#include "trayicon.h" #include "utils.h" #include "gtkutils.h" #include "codeconv.h" @@ -160,10 +160,6 @@ static void ac_label_button_pressed (GtkWidget *widget, static void ac_menu_popup_closed (GtkMenuShell *menu_shell, gpointer data); -static void tray_icon_button_pressed (GtkWidget *widget, - GdkEventButton *event, - gpointer data); - static gint main_window_close_cb (GtkWidget *widget, GdkEventAny *event, gpointer data); @@ -805,9 +801,6 @@ MainWindow *main_window_create(SeparateType type) GtkWidget *ac_label; GtkWidget *tray_icon; - GtkWidget *tray_icon_img; - GtkWidget *eventbox; - GtkTooltips *tray_icon_tip; FolderView *folderview; SummaryView *summaryview; @@ -914,20 +907,7 @@ MainWindow *main_window_create(SeparateType type) gtk_widget_show_all(statusbar); - tray_icon = GTK_WIDGET(egg_tray_icon_new("Sylpheed")); - - eventbox = gtk_event_box_new(); - gtk_container_add(GTK_CONTAINER(tray_icon), eventbox); - g_signal_connect(G_OBJECT(eventbox), "button_press_event", - G_CALLBACK(tray_icon_button_pressed), mainwin); - tray_icon_img = stock_pixbuf_widget_scale(NULL, STOCK_PIXMAP_SYLPHEED, - 24, 24); - gtk_container_add(GTK_CONTAINER(eventbox), tray_icon_img); - - tray_icon_tip = gtk_tooltips_new(); - gtk_tooltips_set_tip(tray_icon_tip, tray_icon, _("Sylpheed"), NULL); - - gtk_widget_show_all(tray_icon); + tray_icon = trayicon_create(mainwin); /* create views */ mainwin->folderview = folderview = folderview_create(); @@ -963,8 +943,6 @@ MainWindow *main_window_create(SeparateType type) mainwin->ac_label = ac_label; mainwin->tray_icon = tray_icon; - mainwin->tray_icon_img = tray_icon_img; - mainwin->tray_icon_tip = tray_icon_tip; /* set context IDs for status bar */ mainwin->mainwin_cid = gtk_statusbar_get_context_id @@ -2570,15 +2548,6 @@ static void ac_menu_popup_closed(GtkMenuShell *menu_shell, gpointer data) manage_window_focus_in(mainwin->window, NULL, NULL); } -static void tray_icon_button_pressed(GtkWidget *widget, GdkEventButton *event, - gpointer data) -{ - MainWindow *mainwin = (MainWindow *)data; - - if (event && event->button == 1) - gtk_window_present(GTK_WINDOW(mainwin->window)); -} - static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event, gpointer data) { |