mac statusicon: Let the toolkit colour the icon

This commit is contained in:
Hylke Bons 2014-11-06 18:39:31 +00:00
parent 320c74c9f4
commit fad6a6dd77
12 changed files with 9 additions and 42 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

View file

@ -170,14 +170,9 @@
<BundleResource Include="Resources\tutorial-slide-3.png">
<Link>Resources\tutorial-slide-3.png</Link>
</BundleResource>
<BundleResource Include="Resources\process-syncing-active.png" />
<BundleResource Include="Resources\process-syncing-down-active.png" />
<BundleResource Include="Resources\process-syncing-down.png" />
<BundleResource Include="Resources\process-syncing-error-active.png" />
<BundleResource Include="Resources\process-syncing-error.png" />
<BundleResource Include="Resources\process-syncing-idle-active.png" />
<BundleResource Include="Resources\process-syncing-idle.png" />
<BundleResource Include="Resources\process-syncing-up-active.png" />
<BundleResource Include="Resources\process-syncing-up.png" />
<BundleResource Include="Resources\process-syncing.png" />
<BundleResource Include="..\Common\Pixmaps\user-icon-default.png">
@ -186,14 +181,9 @@
<BundleResource Include="..\Common\Pixmaps\side-splash%402x.png">
<Link>Resources\side-splash%402x.png</Link>
</BundleResource>
<BundleResource Include="Resources\process-syncing-active%402x.png" />
<BundleResource Include="Resources\process-syncing-down-active%402x.png" />
<BundleResource Include="Resources\process-syncing-down%402x.png" />
<BundleResource Include="Resources\process-syncing-error-active%402x.png" />
<BundleResource Include="Resources\process-syncing-error%402x.png" />
<BundleResource Include="Resources\process-syncing-idle-active%402x.png" />
<BundleResource Include="Resources\process-syncing-idle%402x.png" />
<BundleResource Include="Resources\process-syncing-up-active%402x.png" />
<BundleResource Include="Resources\process-syncing-up%402x.png" />
<BundleResource Include="Resources\process-syncing%402x.png" />
<BundleResource Include="..\Common\Pixmaps\about%402x.png">

View file

@ -45,12 +45,6 @@ namespace SparkleShare {
private NSImage syncing_image = NSImage.ImageNamed ("process-syncing");
private NSImage syncing_error_image = NSImage.ImageNamed ("process-syncing-error");
private NSImage syncing_idle_image_active = NSImage.ImageNamed ("process-syncing-idle-active");
private NSImage syncing_up_image_active = NSImage.ImageNamed ("process-syncing-up-active");
private NSImage syncing_down_image_active = NSImage.ImageNamed ("process-syncing-down-active");
private NSImage syncing_image_active = NSImage.ImageNamed ("process-syncing-active");
private NSImage syncing_error_image_active = NSImage.ImageNamed ("process-syncing-error-active");
private NSImage folder_image = NSImage.ImageNamed ("NSFolder");
private NSImage caution_image = NSImage.ImageNamed ("NSCaution");
private NSImage sparkleshare_image = NSImage.ImageNamed ("sparkleshare-folder");
@ -60,39 +54,22 @@ namespace SparkleShare {
{
this.status_item.HighlightMode = true;
this.status_item.Image = this.syncing_idle_image;
this.status_item.AlternateImage = this.syncing_idle_image_active;
this.status_item.Image.Template = true;
CreateMenu ();
Controller.UpdateIconEvent += delegate (IconState state) {
Program.Controller.Invoke (() => {
switch (state) {
case IconState.Idle: {
this.status_item.Image = this.syncing_idle_image;
this.status_item.AlternateImage = this.syncing_idle_image_active;
break;
}
case IconState.SyncingUp: {
this.status_item.Image = this.syncing_up_image;
this.status_item.AlternateImage = this.syncing_up_image_active;
break;
}
case IconState.SyncingDown: {
this.status_item.Image = this.syncing_down_image;
this.status_item.AlternateImage = this.syncing_down_image_active;
break;
}
case IconState.Syncing: {
this.status_item.Image = this.syncing_image;
this.status_item.AlternateImage = this.syncing_image_active;
break;
}
case IconState.Error: {
this.status_item.Image = this.syncing_error_image;
this.status_item.AlternateImage = this.syncing_error_image_active;
break;
}
case IconState.Idle: { this.status_item.Image = this.syncing_idle_image; break; }
case IconState.SyncingUp: { this.status_item.Image = this.syncing_up_image; break; }
case IconState.SyncingDown: { this.status_item.Image = this.syncing_down_image; break; }
case IconState.Syncing: { this.status_item.Image = this.syncing_image; break; }
case IconState.Error: { this.status_item.Image = this.syncing_error_image; break; }
}
this.status_item.Image.Template = true;
});
};