[gnome-maps] Utils: Add color to actor icon creation



commit 5223607dc8c83883549b8c71bf2c6165cf4383ea
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Sat Jan 31 16:48:21 2015 +0100

    Utils: Add color to actor icon creation

 src/utils.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/utils.js b/src/utils.js
index e088064..6fc47ed 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -162,10 +162,17 @@ function activateAction(appId, action, parameter, timestamp) {
                           });
 }
 
-function CreateActorFromIconName(name, size) {
+function CreateActorFromIconName(name, size, color) {
     try {
         let theme = Gtk.IconTheme.get_default();
-        let pixbuf = theme.load_icon(name, size, 0);
+        let pixbuf;
+
+        if (color) {
+            let info = theme.lookup_icon(name, size, 0);
+            pixbuf = info.load_symbolic(color, null, null, null, null, null)[0];
+        } else
+            pixbuf = theme.load_icon(name, size, 0);
+
         let image = new Clutter.Image();
         image.set_data(pixbuf.get_pixels(),
                        Cogl.PixelFormat.RGBA_8888,


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