From 31e5daf7207c15a9faca0f4e73b5ec8e3ce4c51e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 19 Mar 2018 09:31:55 +0000 Subject: [PATCH] linux: Rename icons to work in AppIndicator --- ...parkleshare.SparkleShare-syncing-down.png} | Bin ...arkleshare.SparkleShare-syncing-error.png} | Bin ....sparkleshare.SparkleShare-syncing-up.png} | Bin ...org.sparkleshare.SparkleShare-syncing.png} | Bin ...parkleshare.SparkleShare-syncing-down.png} | Bin ...arkleshare.SparkleShare-syncing-error.png} | Bin ....sparkleshare.SparkleShare-syncing-up.png} | Bin ...org.sparkleshare.SparkleShare-syncing.png} | Bin SparkleShare/Linux/Images/icons/meson.build | 42 +++++++----------- SparkleShare/Linux/StatusIcon.cs | 34 ++++++-------- SparkleShare/Linux/UserInterface.cs | 3 +- SparkleShare/Linux/UserInterfaceHelpers.cs | 14 +++--- Sparkles/Git/GitFetcher.cs | 1 - 13 files changed, 37 insertions(+), 57 deletions(-) rename SparkleShare/Linux/Images/icons/hicolor/24x24/status/{process-syncing-down.png => org.sparkleshare.SparkleShare-syncing-down.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/24x24/status/{process-syncing-error.png => org.sparkleshare.SparkleShare-syncing-error.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/24x24/status/{process-syncing-up.png => org.sparkleshare.SparkleShare-syncing-up.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/24x24/status/{process-syncing.png => org.sparkleshare.SparkleShare-syncing.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/48x48/status/{process-syncing-down.png => org.sparkleshare.SparkleShare-syncing-down.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/48x48/status/{process-syncing-error.png => org.sparkleshare.SparkleShare-syncing-error.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/48x48/status/{process-syncing-up.png => org.sparkleshare.SparkleShare-syncing-up.png} (100%) rename SparkleShare/Linux/Images/icons/hicolor/48x48/status/{process-syncing.png => org.sparkleshare.SparkleShare-syncing.png} (100%) diff --git a/SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-down.png b/SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-down.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-down.png rename to SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-down.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-error.png b/SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-error.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-error.png rename to SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-error.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-up.png b/SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-up.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing-up.png rename to SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing-up.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing.png b/SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/24x24/status/process-syncing.png rename to SparkleShare/Linux/Images/icons/hicolor/24x24/status/org.sparkleshare.SparkleShare-syncing.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-down.png b/SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-down.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-down.png rename to SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-down.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-error.png b/SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-error.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-error.png rename to SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-error.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-up.png b/SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-up.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing-up.png rename to SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing-up.png diff --git a/SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing.png b/SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing.png similarity index 100% rename from SparkleShare/Linux/Images/icons/hicolor/48x48/status/process-syncing.png rename to SparkleShare/Linux/Images/icons/hicolor/48x48/status/org.sparkleshare.SparkleShare-syncing.png diff --git a/SparkleShare/Linux/Images/icons/meson.build b/SparkleShare/Linux/Images/icons/meson.build index ec0a048d..aa8a4e2f 100644 --- a/SparkleShare/Linux/Images/icons/meson.build +++ b/SparkleShare/Linux/Images/icons/meson.build @@ -11,21 +11,29 @@ foreach size : icon_sizes install_dir: join_paths(theme_dir, icon_dir)) endforeach - -# Install the symbolic icons install_data( sources: join_paths('hicolor', 'symbolic', 'apps', app_icon_name + '-symbolic.svg'), install_dir: join_paths(theme_dir, 'symbolic', 'apps')) -symbolic_icons = ['syncing', - 'syncing-up', - 'syncing-down', - 'syncing-error'] -foreach icon : symbolic_icons +# Install the status icons +status_icons = ['syncing', + 'syncing-up', + 'syncing-down', + 'syncing-error'] + +foreach icon : status_icons install_data( - sources: join_paths('hicolor', 'symbolic', 'status', 'org.sparkleshare.SparkleShare-' + icon + '-symbolic.svg'), - install_dir: join_paths(theme_dir, 'symbolic', 'status')) + sources: join_paths('hicolor', '24x24', 'status', app_icon_name + '-' + icon + '.png'), + install_dir: join_paths(theme_dir, '24x24', 'apps')) + + install_data( + sources: join_paths('hicolor', '48x48', 'status', app_icon_name + '-' + icon + '.png'), + install_dir: join_paths(theme_dir, '48x48', 'apps')) + + install_data( + sources: join_paths('hicolor', 'symbolic', 'status', app_icon_name + '-' + icon + '-symbolic.svg'), + install_dir: join_paths(theme_dir, 'symbolic', 'apps')) endforeach @@ -52,19 +60,3 @@ size = '16' install_data(sources: join_paths('hicolor', size + 'x' + size, category, 'list-point.png'), install_dir: join_paths(app_theme_dir, size + 'x' + size, category)) -sizes = ['24', '48'] - -foreach size : sizes - install_data(sources: join_paths('hicolor', size + 'x' + size, category, 'process-syncing.png'), - install_dir: join_paths(app_theme_dir, size + 'x' + size, category)) - - install_data(sources: join_paths('hicolor', size + 'x' + size, category, 'process-syncing-up.png'), - install_dir: join_paths(app_theme_dir, size + 'x' + size, category)) - - install_data(sources: join_paths('hicolor', size + 'x' + size, category, 'process-syncing-down.png'), - install_dir: join_paths(app_theme_dir, size + 'x' + size, category)) - - install_data(sources: join_paths('hicolor', size + 'x' + size, category, 'process-syncing-error.png'), - install_dir: join_paths(app_theme_dir, size + 'x' + size, category)) -endforeach - diff --git a/SparkleShare/Linux/StatusIcon.cs b/SparkleShare/Linux/StatusIcon.cs index b9cce134..b64f49e5 100644 --- a/SparkleShare/Linux/StatusIcon.cs +++ b/SparkleShare/Linux/StatusIcon.cs @@ -31,7 +31,7 @@ namespace SparkleShare { public class StatusIcon { public StatusIconController Controller = new StatusIconController (); - public static bool use_appindicator = true; + public static bool use_appindicator = true; Gtk.StatusIcon status_icon; @@ -68,35 +68,27 @@ namespace SparkleShare { Application.Invoke (delegate { string icon_name = "org.sparkleshare.SparkleShare"; - 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"; + 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"; + if (use_appindicator) { icon_name += "-symbolic"; + + #if HAVE_APP_INDICATOR indicator.IconName = icon_name; - // Force update of the status icon + // Hack to force update the status icon indicator.Status = (int) IndicatorStatus.Attention; indicator.Status = (int) IndicatorStatus.Active; #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; } }); diff --git a/SparkleShare/Linux/UserInterface.cs b/SparkleShare/Linux/UserInterface.cs index 0c52c2ca..f257c4f1 100644 --- a/SparkleShare/Linux/UserInterface.cs +++ b/SparkleShare/Linux/UserInterface.cs @@ -51,8 +51,7 @@ 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/SparkleShare/Linux/UserInterfaceHelpers.cs b/SparkleShare/Linux/UserInterfaceHelpers.cs index 856d4e8e..f72f627b 100755 --- a/SparkleShare/Linux/UserInterfaceHelpers.cs +++ b/SparkleShare/Linux/UserInterfaceHelpers.cs @@ -18,8 +18,8 @@ using System; using System.IO; -using Gtk; using Sparkles; +using Gtk; namespace SparkleShare { @@ -66,7 +66,7 @@ namespace SparkleShare { (int) Math.Truncate (color.Blue / 256.00)); } - + public static Gdk.Color RGBAToColor (Gdk.RGBA rgba) { return new Gdk.Color () { Red = (ushort) (rgba.Red * 65535), @@ -85,13 +85,11 @@ namespace SparkleShare { public static Gdk.Color MixColors (Gdk.Color first_color, Gdk.Color second_color, double ratio) { return new Gdk.Color ( - Convert.ToByte ((255 * (Math.Min (65535, first_color.Red * (1.0 - ratio) + - second_color.Red * ratio))) / 65535), - Convert.ToByte ((255 * (Math.Min (65535, first_color.Green * (1.0 - ratio) + - second_color.Green * ratio))) / 65535), - Convert.ToByte ((255 * (Math.Min (65535, first_color.Blue * (1.0 - ratio) + - second_color.Blue * ratio))) / 65535) + Convert.ToByte ((255 * (Math.Min (65535, first_color.Red * (1.0 - ratio) + second_color.Red * ratio))) / 65535), + Convert.ToByte ((255 * (Math.Min (65535, first_color.Green * (1.0 - ratio) + second_color.Green * ratio))) / 65535), + Convert.ToByte ((255 * (Math.Min (65535, first_color.Blue * (1.0 - ratio) + second_color.Blue * ratio))) / 65535) ); } } } + diff --git a/Sparkles/Git/GitFetcher.cs b/Sparkles/Git/GitFetcher.cs index 0f6b4361..221a5af0 100644 --- a/Sparkles/Git/GitFetcher.cs +++ b/Sparkles/Git/GitFetcher.cs @@ -335,7 +335,6 @@ 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