windows statusicon: new icons

This commit is contained in:
Hylke Bons 2012-09-13 18:31:56 +01:00
parent fef748e5f1
commit 3013ef1ee6
12 changed files with 45 additions and 47 deletions

View file

@ -109,7 +109,7 @@ namespace SparkleShare {
Sensitive = false
};
continue_button.Clicked += delegate (object o, EventArgs args) {
continue_button.Clicked += delegate {
Controller.SetupPageCompleted (name_entry.Text, email_entry.Text);
};

View file

@ -153,8 +153,6 @@ namespace SparkleShare {
UpdateMenuEvent (CurrentState);
};
int periods = 3;
Program.Controller.OnSyncing += delegate {
int repos_syncing_up = 0;
int repos_syncing_down = 0;
@ -182,14 +180,6 @@ namespace SparkleShare {
StateText = "Receiving changes";
}
periods++;
for (int i = 0; i < periods; i++)
StateText += ".";
if (periods == 3)
periods = 0;
StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
UpdateIconEvent (CurrentState);

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

View file

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

View file

@ -34,7 +34,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<Optimize>False</Optimize>
<OutputPath>..\..\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -103,7 +103,7 @@
<MonoDevelop>
<Properties>
<MonoDevelop.Autotools.MakefileInfo RelativeMakefileName="Makefile.am">
<BuildFilesVar Sync="true" Name="SOURCES" />
<BuildFilesVar Sync="True" Name="SOURCES" />
<DeployFilesVar />
<ResourcesVar />
<OthersVar />
@ -206,6 +206,10 @@
<EmbeddedResource Include="..\Linux\Pixmaps\icons\process-working-22.png">
<Link>Pixmaps\process-working-22.png</Link>
</EmbeddedResource>
<EmbeddedResource Include="Pixmaps\process-syncing-down.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-idle.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-up.png" />
<EmbeddedResource Include="Pixmaps\process-syncing.png" />
</ItemGroup>
<ItemGroup>
<None Include="..\Common\Plugins\github.png">
@ -260,11 +264,6 @@
<ItemGroup>
<EmbeddedResource Include="Pixmaps\folder.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-error.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-i.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-ii.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-iii.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-iiii.png" />
<EmbeddedResource Include="Pixmaps\process-syncing-iiiii.png" />
<EmbeddedResource Include="Pixmaps\sparkleshare-app.ico" />
<EmbeddedResource Include="Pixmaps\sparkleshare-folder.png" />
</ItemGroup>

View file

@ -32,9 +32,12 @@ namespace SparkleShare {
public class SparkleStatusIcon : Control {
public SparkleStatusIconController Controller = new SparkleStatusIconController();
private Drawing.Bitmap [] animation_frames;
private Drawing.Bitmap error_icon;
private Drawing.Bitmap syncing_idle_image;
private Drawing.Bitmap syncing_up_image;
private Drawing.Bitmap syncing_down_image;
private Drawing.Bitmap syncing_image;
private Drawing.Bitmap syncing_error_image;
private ContextMenu context_menu;
@ -45,25 +48,45 @@ namespace SparkleShare {
private SparkleNotifyIcon notify_icon = new SparkleNotifyIcon ();
public SparkleStatusIcon ()
{
CreateAnimationFrames ();
this.notify_icon.Icon = animation_frames [0];
this.syncing_idle_image = SparkleUIHelpers.GetBitmap ("process-syncing-idle"),
this.syncing_up_image = SparkleUIHelpers.GetBitmap ("process-syncing-up"),
this.syncing_down_image = SparkleUIHelpers.GetBitmap ("process-syncing-down"),
this.syncing_image = SparkleUIHelpers.GetBitmap ("process-syncing"),
this.syncing_error_image = SparkleUIHelpers.GetBitmap ("process-syncing-error")
this.notify_icon.Icon = this.syncing_idle_image;
this.notify_icon.HeaderText = "SparkleShare";
CreateMenu ();
Controller.UpdateIconEvent += delegate (int icon_frame) {
Controller.UpdateIconEvent += delegate (IconState state) {
Dispatcher.BeginInvoke ((Action) delegate {
if (icon_frame > -1)
this.notify_icon.Icon = animation_frames [icon_frame];
else
this.notify_icon.Icon = this.error_icon;
});
switch (state) {
case IconState.Idle: {
this.notify_icon.Icon = this.syncing_idle_image;
break;
}
case IconState.SyncingUp: {
this.notify_icon.Icon = this.syncing_up_image;
break;
}
case IconState.SyncingDown: {
this.notify_icon.Icon = this.syncing_down_image;
break;
}
case IconState.Syncing: {
this.notify_icon.Icon = this.syncing_image_image;
break;
}
case IconState.Error: {
this.notify_icon.Icon = this.syncing_error_image;
break;
}
}
});
};
Controller.UpdateStatusItemEvent += delegate (string state_text) {
@ -277,20 +300,6 @@ namespace SparkleShare {
{
this.notify_icon.Dispose ();
}
private void CreateAnimationFrames ()
{
this.animation_frames = new Drawing.Bitmap [] {
SparkleUIHelpers.GetBitmap ("process-syncing-i"),
SparkleUIHelpers.GetBitmap ("process-syncing-ii"),
SparkleUIHelpers.GetBitmap ("process-syncing-iii"),
SparkleUIHelpers.GetBitmap ("process-syncing-iiii"),
SparkleUIHelpers.GetBitmap ("process-syncing-iiiii")
};
this.error_icon = SparkleUIHelpers.GetBitmap ("process-syncing-error");
}
// A method reference that makes sure that opening the