src/Builder4/ClutterFiles.bjs
authorAlan Knowles <alan@roojs.com>
Sun, 24 May 2015 08:48:35 +0000 (16:48 +0800)
committerAlan Knowles <alan@roojs.com>
Sun, 24 May 2015 08:48:35 +0000 (16:48 +0800)
src/Builder4/ClutterFiles.vala

src/Builder4/ClutterFiles.bjs
src/Builder4/ClutterFiles.vala

index 972f602..4a3d77e 100644 (file)
            "id" : "+image",
            "* args" : "JsRender.JsRender file",
            "* init" : "{\n    Gdk.Pixbuf pixbuf= null;\n    \n    var fname = file.getIconFileName(false);\n\n    try {\n        if (FileUtils.test(fname, FileTest.EXISTS)) {\n            pixbuf = new Gdk.Pixbuf.from_file(fname);\n        } \n    } catch (Error e) {\n        // noop\n    \n    }\n    if (pixbuf == null) {\n        \n        try {\n            if (_this.missing_thumb_pixbuf == null) {\n                    var icon_theme = Gtk.IconTheme.get_default ();\n                    _this.missing_thumb_pixbuf = icon_theme.load_icon (\"package-x-generic\", 92, 0);\n                    _this.missing_thumb_pixbuf.ref();\n                }\n                pixbuf = _this.missing_thumb_pixbuf;\n\n        } catch (Error e) {\n            // noop?\n        }\n    }\n    try {\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    } catch (Error e) {\n        // noop?\n    }\n     // should probably do smarter scaling...\n    \n    \n    this.el.set_size(90, 70);\n}\n",
-           "$ x_expand" : true,
            "* pack" : "add_child",
            "xtype" : "Actor",
+           "bool x_expand" : false,
            "$ y_align" : "Clutter.ActorAlign.START",
            "$ margin_left" : 5,
            "$ xns" : "Clutter",
            "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickType(),  Clutter.Color.from_string(\"#fff\"))",
            "id" : "+typetitle",
            "* args" : "JsRender.JsRender file",
-           "$ x_expand" : true,
            "* pack" : "add_child",
            "xtype" : "Text",
+           "bool x_expand" : true,
            "$ y_align" : "Clutter.ActorAlign.START",
            "$ xns" : "Clutter",
            "bool y_expand" : false,
index b24a978..888bf16 100644 (file)
@@ -532,7 +532,7 @@ public class Xcls_ClutterFiles : Object
             this.el.margin_right = 5f;
             this.el.margin_left = 5f;
             this.el.x_align = Clutter.ActorAlign.START;
-            this.el.x_expand = true;
+            this.el.x_expand = false;
             this.el.y_align = Clutter.ActorAlign.START;
             this.el.margin_top = 5f;
             this.el.y_expand = false;