[tomboy] Allow icon themes to customize panel/tray icon separately (bgo612887)



commit 3421c5a8fab2c81fe0c77e1817721da604e72ece
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Mon Mar 15 08:00:45 2010 -0700

    Allow icon themes to customize panel/tray icon separately (bgo612887)
    
    Based on a patch from Jason Herne, Tomboy will first attempt to load
    an icon named "tomboy-panel", then settle for the "tomboy" icon
    if the first isn't found.

 Tomboy/Applet.cs |    8 +++++++-
 Tomboy/Tray.cs   |    7 ++++++-
 Tomboy/Utils.cs  |    2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy/Applet.cs b/Tomboy/Applet.cs
index dab49f1..06b1244 100644
--- a/Tomboy/Applet.cs
+++ b/Tomboy/Applet.cs
@@ -162,7 +162,13 @@ namespace Tomboy
 			// Load a 16x16-sized icon to ensure we don't end up with a
 			// 1x1 pixel.
 			panel_size = 16;
-			this.image = new Gtk.Image (GuiUtils.GetIcon ("tomboy", panel_size));
+			// Load Icon to display in the panel.
+			// First we try the "tomboy-panel" icon. This icon can be replaced
+			// by the user's icon theme. If the theme does not have this icon
+			// then we fall back to the Tomboy Menu icon named "tomboy".
+			var icon = GuiUtils.GetIcon ("tomboy-panel", panel_size) ??
+				GuiUtils.GetIcon ("tomboy", panel_size);
+			this.image = new Gtk.Image (icon);
 
 			this.CanFocus = true;
 			this.ButtonPressEvent += ButtonPress;
diff --git a/Tomboy/Tray.cs b/Tomboy/Tray.cs
index f6e5fc3..8aae890 100644
--- a/Tomboy/Tray.cs
+++ b/Tomboy/Tray.cs
@@ -149,7 +149,12 @@ namespace Tomboy
 			tray = new TomboyTray (manager, this);
 			keybinder = new TomboyPrefsKeybinder (manager, this);
 			int panel_size = 22;
-			Pixbuf = GuiUtils.GetIcon ("tomboy", panel_size);
+			// Load Icon to display in the notification area.
+			// First we try the "tomboy-panel" icon. This icon can be replaced
+			// by the user's icon theme. If the theme does not have this icon
+			// then we fall back to the Tomboy Menu icon named "tomboy".
+			Pixbuf = GuiUtils.GetIcon ("tomboy-panel", panel_size) ??
+				GuiUtils.GetIcon ("tomboy", panel_size);
 
 			Tooltip = TomboyTrayUtils.GetToolTipText ();
 
diff --git a/Tomboy/Utils.cs b/Tomboy/Utils.cs
index 6dbbf5e..54e190a 100644
--- a/Tomboy/Utils.cs
+++ b/Tomboy/Utils.cs
@@ -105,7 +105,7 @@ namespace Tomboy
 				return ret.ScaleSimple (size, size, Gdk.InterpType.Bilinear);
 			} catch (ArgumentException) {}
 
-			Logger.Log ("Unable to load icon '{0}'.", resource_name);
+			Logger.Debug ("Unable to load icon '{0}'.", resource_name);
 			return null;
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]