示例#1
0
 public StatusIconTray(GtkApplicationBase application) : base(application)
 {
     tray            = new StatusIcon(Utilities.GetIcon(IconName, 24));
     tray.Visible    = true;
     tray.Activate  += delegate { ToggleTaskWindowAction.Activate(); };
     tray.PopupMenu += (sender, e) => {
         var popupMenu = Menu;
         popupMenu.ShowAll();                  // shows everything
         tray.PresentMenu(popupMenu, (uint)e.Args [0], (uint)e.Args [1]);
     };
 }
示例#2
0
		public AppIndicatorTray (GtkApplicationBase application) : base  (application)
		{
			appIndicator = new ApplicationIndicator ("TasqueTray", IconName, Category.ApplicationStatus);
			appIndicator.Status = Status.Active;

			var menu = Menu;
			var toggleTaskWindowMenuItem = new MenuItem ();
			ToggleTaskWindowAction.ConnectProxy (toggleTaskWindowMenuItem);
			menu.Insert (toggleTaskWindowMenuItem, 0);
			menu.Insert (new SeparatorMenuItem (), 1);

			tooltipProxyMenuItem = new MenuItem (Tooltip);
			tooltipProxyMenuItem.Sensitive = false;
			menu.Insert (tooltipProxyMenuItem, 2);
			menu.Insert (new SeparatorMenuItem (), 3);

			menu.ShowAll ();
			
			appIndicator.Menu = menu;
		}