From ecf1d9df601df8316291b224f8156f30d02fb536 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 18 Mar 2018 14:02:15 +0000 Subject: [PATCH] linux: Fix icon theme --- ...re.SparkleShare-syncing-down-symbolic.svg} | 0 ...e.SparkleShare-syncing-error-symbolic.svg} | 0 ...leshare.SparkleShare-syncing-symbolic.svg} | 0 ...hare.SparkleShare-syncing-up-symbolic.svg} | 0 SparkleShare/Linux/Images/icons/meson.build | 10 ++--- SparkleShare/Linux/StatusIcon.cs | 40 +++++++++++++------ SparkleShare/Linux/UserInterface.cs | 3 +- Sparkles/Git/GitFetcher.cs | 1 + 8 files changed, 35 insertions(+), 19 deletions(-) rename SparkleShare/Linux/Images/icons/hicolor/symbolic/status/{process-syncing-down-symbolic.svg => org.sparkleshare.SparkleShare-syncing-down-symbolic.svg} (100%) rename SparkleShare/Linux/Images/icons/hicolor/symbolic/status/{process-syncing-error-symbolic.svg => org.sparkleshare.SparkleShare-syncing-error-symbolic.svg} (100%) rename SparkleShare/Linux/Images/icons/hicolor/symbolic/status/{process-syncing-symbolic.svg => org.sparkleshare.SparkleShare-syncing-symbolic.svg} (100%) rename SparkleShare/Linux/Images/icons/hicolor/symbolic/status/{process-syncing-up-symbolic.svg => org.sparkleshare.SparkleShare-syncing-up-symbolic.svg} (100%) diff --git a/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-down-symbolic.svg b/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-down-symbolic.svg similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-down-symbolic.svg rename to SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-down-symbolic.svg diff --git a/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-error-symbolic.svg b/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-error-symbolic.svg similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-error-symbolic.svg rename to SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-error-symbolic.svg diff --git a/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-symbolic.svg b/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-symbolic.svg similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-symbolic.svg rename to SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-symbolic.svg diff --git a/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-up-symbolic.svg b/SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-up-symbolic.svg similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/symbolic/status/process-syncing-up-symbolic.svg rename to SparkleShare/Linux/Images/icons/hicolor/symbolic/status/org.sparkleshare.SparkleShare-syncing-up-symbolic.svg diff --git a/SparkleShare/Linux/Images/icons/meson.build b/SparkleShare/Linux/Images/icons/meson.build index 325cee42..ec0a048d 100644 --- a/SparkleShare/Linux/Images/icons/meson.build +++ b/SparkleShare/Linux/Images/icons/meson.build @@ -17,14 +17,14 @@ install_data( sources: join_paths('hicolor', 'symbolic', 'apps', app_icon_name + '-symbolic.svg'), install_dir: join_paths(theme_dir, 'symbolic', 'apps')) -symbolic_icons = ['process-syncing', - 'process-syncing-up', - 'process-syncing-down', - 'process-syncing-error'] +symbolic_icons = ['syncing', + 'syncing-up', + 'syncing-down', + 'syncing-error'] foreach icon : symbolic_icons 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')) endforeach diff --git a/SparkleShare/Linux/StatusIcon.cs b/SparkleShare/Linux/StatusIcon.cs index c4f2fee1..b9cce134 100644 --- a/SparkleShare/Linux/StatusIcon.cs +++ b/SparkleShare/Linux/StatusIcon.cs @@ -68,17 +68,17 @@ namespace SparkleShare { Application.Invoke (delegate { 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 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"; indicator.IconName = icon_name; @@ -88,6 +88,15 @@ namespace SparkleShare { #endif } 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; } }); @@ -158,12 +167,17 @@ namespace SparkleShare { string icons_path = Path.Combine (UserInterface.AssetsPath, "icons", "hicolor", "12x12", "status"); foreach (KeyValuePair pair in project.UnsyncedChangesInfo) { - string icon_path = Path.Combine (icons_path, pair.Value.Replace ("-12", "")); - (item.Submenu as Menu).Add (new SparkleMenuItem (pair.Key) { - Image = new Image (icon_path), + var change_item = new SparkleMenuItem (pair.Key) { 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)) { diff --git a/SparkleShare/Linux/UserInterface.cs b/SparkleShare/Linux/UserInterface.cs index 41eee3fb..abd77291 100644 --- a/SparkleShare/Linux/UserInterface.cs +++ b/SparkleShare/Linux/UserInterface.cs @@ -51,7 +51,8 @@ namespace SparkleShare application.Register (null); application.Activated += ApplicationActivatedDelegate; - if (IconTheme.Default != null) + + //if (IconTheme.Default != null) IconTheme.Default.AppendSearchPath (Path.Combine (UserInterface.AssetsPath, "icons")); var label = new Label (); diff --git a/Sparkles/Git/GitFetcher.cs b/Sparkles/Git/GitFetcher.cs index 221a5af0..0f6b4361 100644 --- a/Sparkles/Git/GitFetcher.cs +++ b/Sparkles/Git/GitFetcher.cs @@ -335,6 +335,7 @@ namespace Sparkles.Git { void InstallConfiguration () { string [] settings = { + "advice.ignoredHook false", "core.autocrlf input", "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