linux: change status icons
Before Width: | Height: | Size: 917 KiB After Width: | Height: | Size: 809 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 458 KiB After Width: | Height: | Size: 458 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
2479
SparkleShare/Common/Pixmaps/Sources/status-icons.svg
Normal file
After Width: | Height: | Size: 828 KiB |
|
@ -17,11 +17,10 @@
|
|||
|
||||
using System;
|
||||
|
||||
using Gtk;
|
||||
#if HAVE_APP_INDICATOR
|
||||
using AppIndicator;
|
||||
#endif
|
||||
using Gtk;
|
||||
using Mono.Unix;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
|
@ -38,8 +37,13 @@ namespace SparkleShare {
|
|||
private ApplicationIndicator indicator;
|
||||
#else
|
||||
private StatusIcon status_icon;
|
||||
private Gdk.Pixbuf [] animation_frames;
|
||||
#endif
|
||||
|
||||
private Gdk.Pixbuf syncing_idle_image = SparkleUIHelpers.GetIcon ("sparkleshare", 24);
|
||||
private Gdk.Pixbuf syncing_up_image = SparkleUIHelpers.GetIcon ("process-syncing-up", 24);
|
||||
private Gdk.Pixbuf syncing_down_image = SparkleUIHelpers.GetIcon ("process-syncing-down", 24);
|
||||
private Gdk.Pixbuf syncing_image = SparkleUIHelpers.GetIcon ("process-syncing", 24);
|
||||
private Gdk.Pixbuf syncing_error_image = SparkleUIHelpers.GetIcon ("process-syncing-error", 24);
|
||||
|
||||
|
||||
public SparkleStatusIcon ()
|
||||
|
@ -50,10 +54,8 @@ namespace SparkleShare {
|
|||
|
||||
this.indicator.Status = Status.Active;
|
||||
#else
|
||||
CreateAnimationFrames ();
|
||||
|
||||
this.status_icon = new StatusIcon ();
|
||||
this.status_icon.Pixbuf = this.animation_frames [0];
|
||||
this.status_icon.Pixbuf = this.syncing_idle_image;
|
||||
|
||||
this.status_icon.Activate += ShowMenu; // Primary mouse button click
|
||||
this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
|
||||
|
@ -61,35 +63,56 @@ namespace SparkleShare {
|
|||
|
||||
CreateMenu ();
|
||||
|
||||
|
||||
Controller.UpdateIconEvent += delegate (int icon_frame) {
|
||||
Controller.UpdateIconEvent += delegate (IconState state) {
|
||||
Application.Invoke (delegate {
|
||||
if (icon_frame > -1) {
|
||||
switch (state) {
|
||||
case IconState.Idle: {
|
||||
#if HAVE_APP_INDICATOR
|
||||
string icon_name = "process-syncing-";
|
||||
for (int i = 0; i <= icon_frame; i++)
|
||||
icon_name += "i";
|
||||
|
||||
this.indicator.IconName = icon_name;
|
||||
|
||||
// Force update of the icon
|
||||
this.indicator.Status = Status.Attention;
|
||||
this.indicator.Status = Status.Active;
|
||||
this.indicator.IconName = "sparkleshare";
|
||||
#else
|
||||
this.status_icon.Pixbuf = this.animation_frames [icon_frame];
|
||||
this.status_icon.Pixbuf = this.syncing_idle_image;
|
||||
#endif
|
||||
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
case IconState.SyncingUp: {
|
||||
#if HAVE_APP_INDICATOR
|
||||
this.indicator.IconName = "process-syncing-up";
|
||||
#else
|
||||
this.status_icon.Pixbuf = this.syncing_up_image;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case IconState.SyncingDown: {
|
||||
#if HAVE_APP_INDICATOR
|
||||
this.indicator.IconName = "process-syncing-down";
|
||||
#else
|
||||
this.status_icon.Pixbuf = this.syncing_down_image;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case IconState.Syncing: {
|
||||
#if HAVE_APP_INDICATOR
|
||||
this.indicator.IconName = "process-syncing";
|
||||
#else
|
||||
this.status_icon.Pixbuf = this.syncing_image;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case IconState.Error: {
|
||||
#if HAVE_APP_INDICATOR
|
||||
this.indicator.IconName = "process-syncing-error";
|
||||
|
||||
// Force update of the icon
|
||||
this.indicator.Status = Status.Attention;
|
||||
this.indicator.Status = Status.Active;
|
||||
#else
|
||||
this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("process-syncing-error", 24);
|
||||
this.status_icon.Pixbuf = this.syncing_error_image;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if HAVE_APP_INDICATOR
|
||||
// Force update of the status icon
|
||||
this.indicator.Status = Status.Attention;
|
||||
this.indicator.Status = Status.Active;
|
||||
#endif
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -240,7 +263,6 @@ namespace SparkleShare {
|
|||
this.menu.Add (notify_item);
|
||||
this.menu.Add (new SeparatorMenuItem ());
|
||||
|
||||
|
||||
MenuItem about_item = new MenuItem ("About SparkleShare");
|
||||
|
||||
about_item.Activated += delegate {
|
||||
|
@ -250,7 +272,6 @@ namespace SparkleShare {
|
|||
this.menu.Add (about_item);
|
||||
this.menu.Add (new SeparatorMenuItem ());
|
||||
|
||||
|
||||
this.quit_item = new MenuItem ("Quit") {
|
||||
Sensitive = Controller.QuitItemEnabled
|
||||
};
|
||||
|
@ -276,20 +297,6 @@ namespace SparkleShare {
|
|||
Controller.SubfolderClicked (name);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#if !HAVE_APP_INDICATOR
|
||||
private void CreateAnimationFrames ()
|
||||
{
|
||||
this.animation_frames = new Gdk.Pixbuf [] {
|
||||
SparkleUIHelpers.GetIcon ("process-syncing-i", 24),
|
||||
SparkleUIHelpers.GetIcon ("process-syncing-ii", 24),
|
||||
SparkleUIHelpers.GetIcon ("process-syncing-iii", 24),
|
||||
SparkleUIHelpers.GetIcon ("process-syncing-iiii", 24),
|
||||
SparkleUIHelpers.GetIcon ("process-syncing-iiiii", 24)
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !HAVE_APP_INDICATOR
|
||||
|
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 632 B |
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 566 B |
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 584 B After Width: | Height: | Size: 631 B |
|
@ -31,7 +31,7 @@ namespace SparkleShare {
|
|||
|
||||
public List <NSButton> Buttons = new List <NSButton> ();
|
||||
public string Header;
|
||||
public string Description;
|
||||
new public string Description;
|
||||
|
||||
private NSImage side_splash;
|
||||
private NSImageView side_splash_view;
|
||||
|
|