[osx] use a dock emblem to indicate new events
This commit is contained in:
parent
dc83498767
commit
23bb5da18c
1
README
1
README
|
@ -93,6 +93,7 @@ Build on OSX:
|
|||
=============
|
||||
|
||||
Get the Mono Framework, Monodevelop, and MacPorts.
|
||||
|
||||
Install git-core, automake and intltool using 'port install'.
|
||||
Make sure that git or a symbolic link to git is in /usr/bin.
|
||||
|
||||
|
|
|
@ -381,13 +381,14 @@ namespace SparkleShare {
|
|||
public override void MenuWillOpen (NSMenu menu)
|
||||
{
|
||||
|
||||
Console.WriteLine ("OPENED");
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
||||
log.OrderFrontRegardless ();
|
||||
|
||||
SparkleUI.NewEvents = 0;
|
||||
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace SparkleShare {
|
|||
|
||||
public static SparkleStatusIcon StatusIcon;
|
||||
public static List <SparkleLog> OpenLogs;
|
||||
|
||||
public static int NewEvents;
|
||||
|
||||
|
||||
public SparkleUI ()
|
||||
|
@ -50,6 +50,19 @@ namespace SparkleShare {
|
|||
OpenLogs = new List <SparkleLog> ();
|
||||
StatusIcon = new SparkleStatusIcon ();
|
||||
|
||||
NewEvents = 0;
|
||||
|
||||
SparkleShare.Controller.NotificationRaised += delegate {
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
NewEvents++;
|
||||
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue