linux: Fix icon theme

This commit is contained in:
Hylke Bons 2018-03-18 14:02:15 +00:00
parent 507f9f8a4f
commit ecf1d9df60
8 changed files with 35 additions and 19 deletions

View file

@ -17,14 +17,14 @@ install_data(
sources: join_paths('hicolor', 'symbolic', 'apps', app_icon_name + '-symbolic.svg'), sources: join_paths('hicolor', 'symbolic', 'apps', app_icon_name + '-symbolic.svg'),
install_dir: join_paths(theme_dir, 'symbolic', 'apps')) install_dir: join_paths(theme_dir, 'symbolic', 'apps'))
symbolic_icons = ['process-syncing', symbolic_icons = ['syncing',
'process-syncing-up', 'syncing-up',
'process-syncing-down', 'syncing-down',
'process-syncing-error'] 'syncing-error']
foreach icon : symbolic_icons foreach icon : symbolic_icons
install_data( install_data(
sources: join_paths('hicolor', 'symbolic', 'status', icon + '-symbolic.svg'), sources: join_paths('hicolor', 'symbolic', 'status', 'org.sparkleshare.SparkleShare-' + icon + '-symbolic.svg'),
install_dir: join_paths(theme_dir, 'symbolic', 'status')) install_dir: join_paths(theme_dir, 'symbolic', 'status'))
endforeach endforeach

View file

@ -68,17 +68,17 @@ namespace SparkleShare {
Application.Invoke (delegate { Application.Invoke (delegate {
string icon_name = "org.sparkleshare.SparkleShare"; string icon_name = "org.sparkleshare.SparkleShare";
if (state == IconState.SyncingUp)
icon_name = "process-syncing-up";
else if (state == IconState.SyncingDown)
icon_name = "process-syncing-down";
else if (state == IconState.Syncing)
icon_name = "process-syncing";
else if (state == IconState.Error)
icon_name = "process-syncing-error";
if (use_appindicator) { if (use_appindicator) {
#if HAVE_APP_INDICATOR #if HAVE_APP_INDICATOR
if (state == IconState.SyncingUp)
icon_name += "-syncing-up";
else if (state == IconState.SyncingDown)
icon_name += "-syncing-down";
else if (state == IconState.Syncing)
icon_name += "-syncing";
else if (state == IconState.Error)
icon_name += "-syncing-error";
icon_name += "-symbolic"; icon_name += "-symbolic";
indicator.IconName = icon_name; indicator.IconName = icon_name;
@ -88,6 +88,15 @@ namespace SparkleShare {
#endif #endif
} else { } else {
if (state == IconState.SyncingUp)
icon_name += "process-syncing-up";
else if (state == IconState.SyncingDown)
icon_name += "process-syncing-down";
else if (state == IconState.Syncing)
icon_name += "process-syncing";
else if (state == IconState.Error)
icon_name += "process-syncing-error";
this.status_icon.IconName = icon_name; this.status_icon.IconName = icon_name;
} }
}); });
@ -158,12 +167,17 @@ namespace SparkleShare {
string icons_path = Path.Combine (UserInterface.AssetsPath, "icons", "hicolor", "12x12", "status"); string icons_path = Path.Combine (UserInterface.AssetsPath, "icons", "hicolor", "12x12", "status");
foreach (KeyValuePair<string, string> pair in project.UnsyncedChangesInfo) { foreach (KeyValuePair<string, string> pair in project.UnsyncedChangesInfo) {
string icon_path = Path.Combine (icons_path, pair.Value.Replace ("-12", ""));
(item.Submenu as Menu).Add (new SparkleMenuItem (pair.Key) { var change_item = new SparkleMenuItem (pair.Key) {
Image = new Image (icon_path),
Sensitive = false Sensitive = false
}); };
if (!use_appindicator) {
string icon_path = Path.Combine (icons_path, pair.Value.Replace ("-12", ""));
change_item.Image = new Image (icon_path);
}
(item.Submenu as Menu).Add (change_item);
} }
if (!string.IsNullOrEmpty (project.MoreUnsyncedChanges)) { if (!string.IsNullOrEmpty (project.MoreUnsyncedChanges)) {

View file

@ -51,7 +51,8 @@ namespace SparkleShare
application.Register (null); application.Register (null);
application.Activated += ApplicationActivatedDelegate; application.Activated += ApplicationActivatedDelegate;
if (IconTheme.Default != null)
//if (IconTheme.Default != null)
IconTheme.Default.AppendSearchPath (Path.Combine (UserInterface.AssetsPath, "icons")); IconTheme.Default.AppendSearchPath (Path.Combine (UserInterface.AssetsPath, "icons"));
var label = new Label (); var label = new Label ();

View file

@ -335,6 +335,7 @@ namespace Sparkles.Git {
void InstallConfiguration () void InstallConfiguration ()
{ {
string [] settings = { string [] settings = {
"advice.ignoredHook false",
"core.autocrlf input", "core.autocrlf input",
"core.quotepath false", // For commands to output Unicode characters "as is". e.g. '"h\303\251"' becomes 'hé'. "core.quotepath false", // For commands to output Unicode characters "as is". e.g. '"h\303\251"' becomes 'hé'.
"core.precomposeunicode true", // Use the same Unicode form on all filesystems "core.precomposeunicode true", // Use the same Unicode form on all filesystems