Revision 510 src/mainwindow.c

mainwindow.c (revision 510)
77 77
#include "alertpanel.h"
78 78
#include "statusbar.h"
79 79
#include "inputdialog.h"
80
#include "eggtrayicon.h"
80
#include "trayicon.h"
81 81
#include "utils.h"
82 82
#include "gtkutils.h"
83 83
#include "codeconv.h"
......
160 160
static void ac_menu_popup_closed		(GtkMenuShell	*menu_shell,
161 161
						 gpointer	 data);
162 162

  
163
static void tray_icon_button_pressed		(GtkWidget	*widget,
164
						 GdkEventButton	*event,
165
						 gpointer	 data);
166

  
167 163
static gint main_window_close_cb		(GtkWidget	*widget,
168 164
						 GdkEventAny	*event,
169 165
						 gpointer	 data);
......
805 801
	GtkWidget *ac_label;
806 802

  
807 803
	GtkWidget *tray_icon;
808
	GtkWidget *tray_icon_img;
809
	GtkWidget *eventbox;
810
	GtkTooltips *tray_icon_tip;
811 804

  
812 805
	FolderView *folderview;
813 806
	SummaryView *summaryview;
......
914 907

  
915 908
	gtk_widget_show_all(statusbar);
916 909

  
917
	tray_icon = GTK_WIDGET(egg_tray_icon_new("Sylpheed"));
910
	tray_icon = trayicon_create(mainwin);
918 911

  
919
	eventbox = gtk_event_box_new();
920
	gtk_container_add(GTK_CONTAINER(tray_icon), eventbox);
921
	g_signal_connect(G_OBJECT(eventbox), "button_press_event",
922
			 G_CALLBACK(tray_icon_button_pressed), mainwin);
923
	tray_icon_img = stock_pixbuf_widget_scale(NULL, STOCK_PIXMAP_SYLPHEED,
924
						  24, 24);
925
	gtk_container_add(GTK_CONTAINER(eventbox), tray_icon_img);
926

  
927
	tray_icon_tip = gtk_tooltips_new();
928
	gtk_tooltips_set_tip(tray_icon_tip, tray_icon, _("Sylpheed"), NULL);
929

  
930
	gtk_widget_show_all(tray_icon);
931

  
932 912
	/* create views */
933 913
	mainwin->folderview  = folderview  = folderview_create();
934 914
	mainwin->summaryview = summaryview = summary_create();
......
963 943
	mainwin->ac_label       = ac_label;
964 944

  
965 945
	mainwin->tray_icon      = tray_icon;
966
	mainwin->tray_icon_img  = tray_icon_img;
967
	mainwin->tray_icon_tip  = tray_icon_tip;
968 946

  
969 947
	/* set context IDs for status bar */
970 948
	mainwin->mainwin_cid = gtk_statusbar_get_context_id
......
2570 2548
	manage_window_focus_in(mainwin->window, NULL, NULL);
2571 2549
}
2572 2550

  
2573
static void tray_icon_button_pressed(GtkWidget *widget, GdkEventButton *event,
2574
				     gpointer data)
2575
{
2576
	MainWindow *mainwin = (MainWindow *)data;
2577

  
2578
	if (event && event->button == 1)
2579
		gtk_window_present(GTK_WINDOW(mainwin->window));
2580
}
2581

  
2582 2551
static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
2583 2552
				 gpointer data)
2584 2553
{

Also available in: Unified diff