[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.
|
Get the Mono Framework, Monodevelop, and MacPorts.
|
||||||
|
|
||||||
Install git-core, automake and intltool using 'port install'.
|
Install git-core, automake and intltool using 'port install'.
|
||||||
Make sure that git or a symbolic link to git is in /usr/bin.
|
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)
|
public override void MenuWillOpen (NSMenu menu)
|
||||||
{
|
{
|
||||||
|
|
||||||
Console.WriteLine ("OPENED");
|
|
||||||
|
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
|
|
||||||
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
||||||
log.OrderFrontRegardless ();
|
log.OrderFrontRegardless ();
|
||||||
|
|
||||||
|
SparkleUI.NewEvents = 0;
|
||||||
|
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public static SparkleStatusIcon StatusIcon;
|
public static SparkleStatusIcon StatusIcon;
|
||||||
public static List <SparkleLog> OpenLogs;
|
public static List <SparkleLog> OpenLogs;
|
||||||
|
public static int NewEvents;
|
||||||
|
|
||||||
|
|
||||||
public SparkleUI ()
|
public SparkleUI ()
|
||||||
|
@ -50,6 +50,19 @@ namespace SparkleShare {
|
||||||
OpenLogs = new List <SparkleLog> ();
|
OpenLogs = new List <SparkleLog> ();
|
||||||
StatusIcon = new SparkleStatusIcon ();
|
StatusIcon = new SparkleStatusIcon ();
|
||||||
|
|
||||||
|
NewEvents = 0;
|
||||||
|
|
||||||
|
SparkleShare.Controller.NotificationRaised += delegate {
|
||||||
|
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
|
||||||
|
NewEvents++;
|
||||||
|
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue