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