Notification toggling: conform to Apple HIG
This commit is contained in:
parent
ea86134083
commit
e5ad0acee1
|
@ -195,6 +195,7 @@ namespace SparkleShare {
|
|||
|
||||
foreach (string path in SparkleShare.Controller.Folders) {
|
||||
|
||||
// TODO
|
||||
// if (repo.HasUnsyncedChanges)
|
||||
// folder_action.IconName = "dialog-error";
|
||||
|
||||
|
@ -246,21 +247,25 @@ namespace SparkleShare {
|
|||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||
|
||||
|
||||
NotificationsMenuItem = new NSMenuItem () {
|
||||
Title = "Show Notifications"
|
||||
};
|
||||
NotificationsMenuItem = new NSMenuItem ();
|
||||
|
||||
if (SparkleShare.Controller.NotificationsEnabled)
|
||||
NotificationsMenuItem.State = NSCellStateValue.On;
|
||||
NotificationsMenuItem.Title = "Turn Notifications Off";
|
||||
else
|
||||
NotificationsMenuItem.Title = "Turn Notifications On";
|
||||
|
||||
NotificationsMenuItem.Activated += delegate {
|
||||
|
||||
SparkleShare.Controller.ToggleNotifications ();
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
if (SparkleShare.Controller.NotificationsEnabled)
|
||||
NotificationsMenuItem.State = NSCellStateValue.On;
|
||||
NotificationsMenuItem.Title = "Turn Notifications Off";
|
||||
else
|
||||
NotificationsMenuItem.State = NSCellStateValue.Off;
|
||||
NotificationsMenuItem.Title = "Turn Notifications On";
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue