src/Builder4/ClutterFiles.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 26 May 2015 06:22:19 +0000 (14:22 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 26 May 2015 06:22:19 +0000 (14:22 +0800)
src/Builder4/ClutterFiles.vala

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

index 51bdc58..b24fa06 100644 (file)
@@ -17,7 +17,7 @@
    "@ void open" : "(JsRender.JsRender file)",
    "$ xns" : "Clutter",
    "bool reactive" : true,
-   "|  void set_size" : "(float w, float h) \n{\n    \n     // called by window resize... with is alreaddy -50 (for the buttons?)\n     \n\n\n\n     if (this.el == null) {\n        print(\"object not ready yet?\");\n        return;\n    }\n    \n    print(\"recv width %f, filelayoutw = %f\", w, w-200);\n    \n    // floor ( w/120) * 120...\n    \n   //_this.filelayout_manager.el.max_column_width = w - 200;\n   _this.filelayout.el.width = w - 200;\n   \n    this.el.set_size(\n           // this.el.get_stage().width-150,\n           w,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.el.set_position(0,0);\n   \n   \n   this.scroller.el.set_size(\n           // this.el.get_stage().width-150,\n           w-50,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.scroller.el.set_position(75,50);\n    // scroll...\n    _this.filelayout.el.y = 0.0f;\n    \n}\n",
+   "|  void set_size" : "(float w, float h) \n{\n    \n     // called by window resize... with is alreaddy -50 (for the buttons?)\n     \n\n\n\n     if (this.el == null) {\n        print(\"object not ready yet?\");\n        return;\n    }\n    \n    print(\"recv width %f, filelayoutw = %f\", w, w-200);\n    \n    w = GLib.Math.floorf ( w/120.0f) * 120.0f;\n    \n    \n    \n    \n   //_this.filelayout_manager.el.max_column_width = w - 200;\n   _this.filelayout.el.width = w - 200;\n   \n    this.el.set_size(\n           // this.el.get_stage().width-150,\n           w,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.el.set_position(0,0);\n   \n   \n   this.scroller.el.set_size(\n           // this.el.get_stage().width-150,\n           w-50,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.scroller.el.set_position(75,50);\n    // scroll...\n    _this.filelayout.el.y = 0.0f;\n    \n}\n",
    "# Gee.ArrayList<Object> fileitems" : "new Gee.ArrayList<Object>()",
    "items" : [
     {
@@ -87,8 +87,8 @@
        "items" : [
         {
          "id" : "filelayout_manager",
-         "bool homogeneous" : false,
          "$ orientation" : "Clutter.FlowOrientation.HORIZONTAL",
+         "bool homogeneous" : false,
          "xtype" : "FlowLayout",
          "float max_column_width" : "100.0f",
          "$ xns" : "Clutter",
           },
           {
            "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickType(),  Clutter.Color.from_string(\"#fff\"))",
-           "* args" : "JsRender.JsRender file",
            "id" : "+typetitle",
+           "* args" : "JsRender.JsRender file",
            "* pack" : "add_child",
            "xtype" : "Text",
            "bool x_expand" : false,
           },
           {
            "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickName(),  Clutter.Color.from_string(\"#fff\"))",
-           "* args" : "JsRender.JsRender file",
            "id" : "+title",
+           "* args" : "JsRender.JsRender file",
            "* pack" : "add_child",
            "xtype" : "Text",
            "bool x_expand" : false,
           },
           {
            "* ctor" : "new Clutter.Text.full(\"Sans bold 14px\", GLib.Path.get_basename(folderpath),  Clutter.Color.from_string(\"#fff\"))",
-           "id" : "+foldertitle",
            "* args" : "string folderpath",
+           "id" : "+foldertitle",
            "$ x_expand" : true,
            "* pack" : "add_child",
            "xtype" : "Text",
             "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
            },
            "* ctor" : "new Clutter.Text.full(\"Sans 10px\", GLib.Path.get_basename(filepath),  Clutter.Color.from_string(\"#fff\"))",
-           "id" : "*folderfile",
            "* args" : "string filepath",
+           "id" : "*folderfile",
            "* init" : "{\n    this.filepath = filepath;\n}\n",
            "$ x_expand" : true,
            "* pack" : "add_child",
index 2a8e711..a8bd6a3 100644 (file)
@@ -140,7 +140,10 @@ public class Xcls_ClutterFiles : Object
         
         print("recv width %f, filelayoutw = %f", w, w-200);
         
-        // floor ( w/120) * 120...
+        w = GLib.Math.floorf ( w/120.0f) * 120.0f;
+        
+        
+        
         
        //_this.filelayout_manager.el.max_column_width = w - 200;
        _this.filelayout.el.width = w - 200;