statusicon: Animate elipsis in menu when syncing
This commit is contained in:
parent
efae41176a
commit
ffe227003f
|
@ -161,6 +161,8 @@ namespace SparkleShare {
|
||||||
UpdateMenuEvent (CurrentState);
|
UpdateMenuEvent (CurrentState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int periods = 3;
|
||||||
|
|
||||||
Program.Controller.OnSyncing += delegate {
|
Program.Controller.OnSyncing += delegate {
|
||||||
int repos_syncing_up = 0;
|
int repos_syncing_up = 0;
|
||||||
int repos_syncing_down = 0;
|
int repos_syncing_down = 0;
|
||||||
|
@ -177,23 +179,32 @@ namespace SparkleShare {
|
||||||
repos_syncing_down > 0) {
|
repos_syncing_down > 0) {
|
||||||
|
|
||||||
CurrentState = IconState.Syncing;
|
CurrentState = IconState.Syncing;
|
||||||
StateText = "Syncing changes…";
|
StateText = "Syncing changes";
|
||||||
|
|
||||||
} else if (repos_syncing_down == 0) {
|
} else if (repos_syncing_down == 0) {
|
||||||
CurrentState = IconState.SyncingUp;
|
CurrentState = IconState.SyncingUp;
|
||||||
StateText = "Sending changes…";
|
StateText = "Sending changes";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
CurrentState = IconState.SyncingDown;
|
CurrentState = IconState.SyncingDown;
|
||||||
StateText = "Receiving changes…";
|
StateText = "Receiving changes";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
periods++;
|
||||||
|
|
||||||
|
for (int i = 0; i < periods; i++)
|
||||||
|
StateText += ".";
|
||||||
|
|
||||||
|
if (periods == 3)
|
||||||
|
periods = 0;
|
||||||
|
|
||||||
StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
|
StateText += " " + ProgressPercentage + "% " + ProgressSpeed;
|
||||||
|
|
||||||
UpdateStatusItemEvent (StateText);
|
UpdateStatusItemEvent (StateText);
|
||||||
UpdateQuitItemEvent (QuitItemEnabled);
|
UpdateQuitItemEvent (QuitItemEnabled);
|
||||||
|
|
||||||
this.animation.Start ();
|
if (!this.animation.Enabled)
|
||||||
|
this.animation.Start ();
|
||||||
};
|
};
|
||||||
|
|
||||||
Program.Controller.OnError += delegate {
|
Program.Controller.OnError += delegate {
|
||||||
|
|
Loading…
Reference in a new issue