Builder4/ClutterFiles.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 17 Nov 2014 09:18:59 +0000 (17:18 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 17 Nov 2014 09:18:59 +0000 (17:18 +0800)
Builder4/ClutterFiles.vala

Builder4/ClutterFiles.bjs
Builder4/ClutterFiles.vala

index 38edf07..36d72f3 100644 (file)
@@ -67,7 +67,7 @@
                                     "$ margin_top" : 5,
                                     "id" : "+image",
                                     "* args" : "JsRender.JsRender file",
-                                    "* init" : "{\n    var pixbuf = new Gdk.Pixbuf.from_file(file.getIconFileName(true));\n    var img = new Clutter.Image();\n    img.set_data(pixbuf.get_pixels(),   \n                        pixbuf.has_alpha \n                          ? Cogl.PixelFormat.RGBA_8888\n                          : Cogl.PixelFormat.RGB_888,\n                        pixbuf.get_width (),\n            pixbuf.get_height (),\n                        pixbuf.get_rowstride ()\n    );\n    this.el.set_content(img);\n    this.el.set_size(80, (80.0f / pixbuf.get_width ()) * pixbuf.get_height () );\n}\n",
+                                    "* init" : "{\n    var pixbuf = new Gdk.Pixbuf.from_file(file.getIconFileName(true));\n    var img = new Clutter.Image();\n    img.set_data(pixbuf.get_pixels(),   \n                        pixbuf.has_alpha \n                          ? Cogl.PixelFormat.RGBA_8888\n                          : Cogl.PixelFormat.RGB_888,\n                        pixbuf.get_width (),\n            pixbuf.get_height (),\n                        pixbuf.get_rowstride ()\n    );\n    this.el.set_content(img);\n    \n    \n    \n    this.el.set_size(80, 80.0f);\n}\n",
                                     "$ x_expand" : true,
                                     "* pack" : "add_child",
                                     "xtype" : "Actor",
index 03fa8d4..73eefab 100644 (file)
@@ -301,7 +301,10 @@ public class Xcls_ClutterFiles : Object
                                     pixbuf.get_rowstride ()
                 );
                 this.el.set_content(img);
-                this.el.set_size(80, (80.0f / pixbuf.get_width ()) * pixbuf.get_height () );
+                
+                
+                
+                this.el.set_size(80, 80.0f);
             }        }
 
         // user defined functions