Builder4/ClutterFiles.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 25 Jun 2014 16:14:05 +0000 (00:14 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 25 Jun 2014 16:14:05 +0000 (00:14 +0800)
Builder4/ClutterFiles.js
Builder4/ClutterFiles.vala

Builder4/ClutterFiles.bjs
Builder4/ClutterFiles.js
Builder4/ClutterFiles.vala

index f0cd6f1..f1cee3f 100644 (file)
@@ -7,7 +7,7 @@
     "items": [
         {
             "listeners": {
-                "scroll_event": "( event)  => {\n\n    print(\"scroll event\");\n    var y = this.filelayout.el.y;\n    var dir = event.direction;\n    switch (dir) {\n        case Clutter.ScrollDirection.UP:\n            y += event.y /2;\n            break;\n        case Clutter.ScrollDirection.DOWN:\n            y -= event.y /2 ;\n            break;\n        default:\n            return false;\n    }\n    // range of scroll -- can go up -- eg.. -ve value.\n    \n    y = float.min(0, y);\n    \n    // to work out the max -ve number\n    // height of filelayout\n    // height of scrollactor..\n    \n    \n    print(\"\\nnew y %f  - layout height = %f , sroll actor height %f\\n \".printf( \n            y, this.filelayout.el.height, this.el.height));    \n   // y = float.min(0, y);    //??\n    print(\"scroll event of %f  - new y = %f \".printf(event.y, y));\n    this.filelayout.el.y = y;\n    return true;\n        \n}"
+                "scroll_event": "( event)  => {\n\n    print(\"scroll event\");\n    var y = this.filelayout.el.y;\n    var dir = event.direction;\n    switch (dir) {\n        case Clutter.ScrollDirection.UP:\n            y += event.y /2;\n            break;\n        case Clutter.ScrollDirection.DOWN:\n            y -= event.y /2 ;\n            break;\n        default:\n            return false;\n    }\n    // range of scroll -- can go up -- eg.. -ve value.\n    \n    y = float.min(0, y);\n    \n    // to work out the max -ve number\n    // height of filelayout\n    // height of scrollactor..\n    \n    \n    print(\"\\nnew y %f  sroll actor height %f = last child bottom %f\\n \".printf( \n            y, \n            this.el.height, \n            this.filelayout.el.last_child.y + , this.filelayout.el.last_child.height));    \n   // y = float.min(0, y);    //??\n    print(\"scroll event of %f  - new y = %f \".printf(event.y, y));\n    this.filelayout.el.y = y;\n    return true;\n        \n}"
             },
             "id": "ClutterFiles",
             "scroll_mode": "Clutter.ScrollMode.VERTICAL",
index 60e1f31..0dd9a7a 100644 (file)
@@ -36,8 +36,10 @@ ClutterFiles=new XObject({
             // height of scrollactor..
             
             
-            print("\nnew y %f  - layout height = %f , sroll actor height %f\n ".printf( 
-                    y, this.filelayout.el.height, this.el.height));    
+            print("\nnew y %f  sroll actor height %f = last child bottom %f\n ".printf( 
+                    y, 
+                    this.el.height, 
+                    this.filelayout.el.last_child.y + , this.filelayout.el.last_child.height));    
            // y = float.min(0, y);    //??
             print("scroll event of %f  - new y = %f ".printf(event.y, y));
             this.filelayout.el.y = y;
index 7a83215..5b87d55 100644 (file)
@@ -67,8 +67,10 @@ public class Xcls_ClutterFiles : Object
             // height of scrollactor..
             
             
-            print("\nnew y %f  - layout height = %f , sroll actor height %f\n ".printf( 
-                    y, this.filelayout.el.height, this.el.height));    
+            print("\nnew y %f  sroll actor height %f = last child bottom %f\n ".printf( 
+                    y, 
+                    this.el.height, 
+                    this.filelayout.el.last_child.y + , this.filelayout.el.last_child.height));    
            // y = float.min(0, y);    //??
             print("scroll event of %f  - new y = %f ".printf(event.y, y));
             this.filelayout.el.y = y;