[osx] use a dock emblem to indicate new events
This commit is contained in:
parent
7719df2b06
commit
68a5b174c1
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.
|
||||
|
||||
|
|
|
@ -152,4 +152,4 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -380,13 +380,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,9 +36,9 @@ namespace SparkleShare {
|
|||
|
||||
public static SparkleStatusIcon StatusIcon;
|
||||
public static List <SparkleLog> OpenLogs;
|
||||
public static int NewEvents;
|
||||
|
||||
|
||||
|
||||
public SparkleUI ()
|
||||
{
|
||||
|
||||
|
@ -49,9 +49,22 @@ namespace SparkleShare {
|
|||
|
||||
OpenLogs = new List <SparkleLog> ();
|
||||
StatusIcon = new SparkleStatusIcon ();
|
||||
|
||||
NewEvents = 0;
|
||||
|
||||
SparkleShare.Controller.NotificationRaised += delegate {
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
NewEvents++;
|
||||
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Run ()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue