[gnome-maps/wip/turnPointMarker: 1/2] Utils: Add color to actor icon creation



commit bb4d12cf2f8df3869070dc3ebba9e4b0927d36d5
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 485785e..b8ee775 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -165,10 +165,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]