statusicon: rearrange menu a bit so it looks less messy
This commit is contained in:
parent
a728cbdcaf
commit
ff3e9f7630
|
@ -44,6 +44,7 @@ namespace SparkleShare {
|
||||||
private NSMenuItem AboutMenuItem;
|
private NSMenuItem AboutMenuItem;
|
||||||
private NSMenuItem NotificationsMenuItem;
|
private NSMenuItem NotificationsMenuItem;
|
||||||
private NSMenuItem RecentEventsMenuItem;
|
private NSMenuItem RecentEventsMenuItem;
|
||||||
|
private NSMenuItem QuitMenuItem;
|
||||||
|
|
||||||
private delegate void Task ();
|
private delegate void Task ();
|
||||||
private EventHandler [] Tasks;
|
private EventHandler [] Tasks;
|
||||||
|
@ -150,26 +151,7 @@ namespace SparkleShare {
|
||||||
Title = StateText
|
Title = StateText
|
||||||
};
|
};
|
||||||
|
|
||||||
Menu.AddItem (StateMenuItem);
|
Menu.AddItem (StateMenuItem);
|
||||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
|
||||||
|
|
||||||
RecentEventsMenuItem = new NSMenuItem () {
|
|
||||||
Title = "Show Recent Events"
|
|
||||||
};
|
|
||||||
|
|
||||||
RecentEventsMenuItem.Activated +=delegate {
|
|
||||||
InvokeOnMainThread (delegate {
|
|
||||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
|
||||||
|
|
||||||
if (SparkleUI.EventLog == null)
|
|
||||||
SparkleUI.EventLog = new SparkleEventLog ();
|
|
||||||
|
|
||||||
SparkleUI.EventLog.OrderFrontRegardless ();
|
|
||||||
SparkleUI.EventLog.MakeKeyAndOrderFront (this);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Menu.AddItem (RecentEventsMenuItem);
|
|
||||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||||
|
|
||||||
FolderMenuItem = new NSMenuItem () {
|
FolderMenuItem = new NSMenuItem () {
|
||||||
|
@ -253,6 +235,23 @@ namespace SparkleShare {
|
||||||
Menu.AddItem (SyncMenuItem);
|
Menu.AddItem (SyncMenuItem);
|
||||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||||
|
|
||||||
|
RecentEventsMenuItem = new NSMenuItem () {
|
||||||
|
Title = "Show Recent Events"
|
||||||
|
};
|
||||||
|
|
||||||
|
RecentEventsMenuItem.Activated +=delegate {
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||||
|
|
||||||
|
if (SparkleUI.EventLog == null)
|
||||||
|
SparkleUI.EventLog = new SparkleEventLog ();
|
||||||
|
|
||||||
|
SparkleUI.EventLog.OrderFrontRegardless ();
|
||||||
|
SparkleUI.EventLog.MakeKeyAndOrderFront (this);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Menu.AddItem (RecentEventsMenuItem);
|
||||||
|
|
||||||
NotificationsMenuItem = new NSMenuItem ();
|
NotificationsMenuItem = new NSMenuItem ();
|
||||||
|
|
||||||
|
@ -275,28 +274,28 @@ namespace SparkleShare {
|
||||||
Menu.AddItem (NotificationsMenuItem);
|
Menu.AddItem (NotificationsMenuItem);
|
||||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||||
|
|
||||||
|
|
||||||
AboutMenuItem = new NSMenuItem () {
|
AboutMenuItem = new NSMenuItem () {
|
||||||
Title = "About SparkleShare"
|
Title = "About SparkleShare"
|
||||||
};
|
};
|
||||||
|
|
||||||
AboutMenuItem.Activated += delegate {
|
AboutMenuItem.Activated += delegate {
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||||
|
|
||||||
if (SparkleUI.About == null)
|
if (SparkleUI.About == null)
|
||||||
SparkleUI.About = new SparkleAbout ();
|
SparkleUI.About = new SparkleAbout ();
|
||||||
|
|
||||||
SparkleUI.About.OrderFrontRegardless ();
|
SparkleUI.About.OrderFrontRegardless ();
|
||||||
SparkleUI.About.MakeKeyAndOrderFront (this);
|
SparkleUI.About.MakeKeyAndOrderFront (this);
|
||||||
SparkleUI.About.CheckForNewVersion ();
|
SparkleUI.About.CheckForNewVersion ();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Menu.AddItem (AboutMenuItem);
|
Menu.AddItem (AboutMenuItem);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
StatusItem.Menu = Menu;
|
StatusItem.Menu = Menu;
|
||||||
StatusItem.Menu.Update ();
|
StatusItem.Menu.Update ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,5 +185,5 @@ namespace SparkleShare {
|
||||||
string path = NSBundle.MainBundle.PathForResource ("Growl", "plist");
|
string path = NSBundle.MainBundle.PathForResource ("Growl", "plist");
|
||||||
return NSDictionary.FromFile (path);
|
return NSDictionary.FromFile (path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue