private void SetupTrayIcon() { Logger.Debug("Creating TrayIcon"); EventBox eb = new EventBox(); appPixBuf = GetIcon("banter-22", 22); eb.Add(new Image(appPixBuf)); //new Image(Gtk.Stock.DialogWarning, IconSize.Menu)); // using stock icon // hooking event eb.ButtonPressEvent += new ButtonPressEventHandler(this.OnImageClick); trayIcon = new Egg.TrayIcon("RtcApplication"); trayIcon.Add(eb); // showing the trayicon trayIcon.ShowAll(); }
private void OnEnableTrayToggled(object sender, EventArgs args) { prefSettings.EnableTray = enableTrayCheckButton.Active; if (!prefSettings.EnableTray) { trayIcon.HideAll(); prefSettings.QuitOnClose = prefSettings.EnableTray; minimizeTrayCheckButton.Active = prefSettings.EnableTray; enableNotificationsCheckButton.Active = prefSettings.EnableTray; prefSettings.EnableNotifications = prefSettings.EnableTray; } else { trayIcon.ShowAll(); } enableNotificationsCheckButton.Sensitive = prefSettings.EnableTray; minimizeTrayCheckButton.Sensitive = prefSettings.EnableTray; }
private void BuildTray() { EventBox eventBox = new EventBox (); trayMenu = new Menu (); //Tooltips trayTip = new Tooltips(); //trayTip.SetTip(eventBox, "MonoTorrent", null); //trayTip.Enable(); quitItem = new ImageMenuItem ("Quit"); quitItem.Image = new Image (Stock.Quit, IconSize.Menu); trayMenu.Append (quitItem); trayMenu.ShowAll (); quitItem.Activated += delegate(object sender, EventArgs args) { OnDeleteEvent (null,new DeleteEventArgs ()); }; eventBox.Add (new Image (Stock.GoDown, IconSize.Menu)); eventBox.ButtonPressEvent += OnTrayClicked; trayIcon = new Egg.TrayIcon ("MonoTorrent"); trayIcon.Add (eventBox); if(prefSettings.EnableTray) trayIcon.ShowAll (); }