167
168
protected override void OnPopupMenu (uint button, uint activate_time)
170
GuiUtils.PopupMenu (MakeRightClickMenu (),
171
GuiUtils.PopupMenu (GetRightClickMenu (),
172
173
new Gtk.MenuPositionFunc (GetTrayMenuPosition));
176
177
public void ShowMenu (bool select_first_item)
179
if (context_menu != null)
180
context_menu.Hide ();
178
182
TomboyTrayUtils.UpdateTomboyTrayMenu (tray, null);
179
183
if (select_first_item)
180
184
tray.TomboyTrayMenu.SelectFirst (false);
222
Gtk.Menu MakeRightClickMenu ()
226
Gtk.Menu GetRightClickMenu ()
224
Gtk.Menu menu = new Gtk.Menu ();
228
if (tray.TomboyTrayMenu != null)
229
tray.TomboyTrayMenu.Hide ();
231
if (context_menu != null) {
232
context_menu.Hide ();
236
context_menu = new Gtk.Menu ();
226
238
Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
227
menu.AccelGroup = accel_group;
239
context_menu.AccelGroup = accel_group;
229
241
Gtk.ImageMenuItem item;
231
243
item = new Gtk.ImageMenuItem (Catalog.GetString ("_Preferences"));
232
244
item.Image = new Gtk.Image (Gtk.Stock.Preferences, Gtk.IconSize.Menu);
233
245
item.Activated += ShowPreferences;
246
context_menu.Append (item);
236
248
item = new Gtk.ImageMenuItem (Catalog.GetString ("_Help"));
237
249
item.Image = new Gtk.Image (Gtk.Stock.Help, Gtk.IconSize.Menu);
238
250
item.Activated += ShowHelpContents;
251
context_menu.Append (item);
241
253
item = new Gtk.ImageMenuItem (Catalog.GetString ("_About Tomboy"));
242
254
item.Image = new Gtk.Image (Gtk.Stock.About, Gtk.IconSize.Menu);
243
255
item.Activated += ShowAbout;
256
context_menu.Append (item);
246
menu.Append (new Gtk.SeparatorMenuItem ());
258
context_menu.Append (new Gtk.SeparatorMenuItem ());
248
260
item = new Gtk.ImageMenuItem (Catalog.GetString ("_Quit"));
249
261
item.Image = new Gtk.Image (Gtk.Stock.Quit, Gtk.IconSize.Menu);
250
262
item.Activated += Quit;
263
context_menu.Append (item);
265
context_menu.ShowAll ();
257
269
void ShowPreferences (object sender, EventArgs args)