resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / ClutterFiles.vala
index be7aa9a..f10613d 100644 (file)
@@ -150,7 +150,7 @@ public class Xcls_ClutterFiles : Object
         
         
        //_this.filelayout_manager.el.max_column_width = w - 200;
-       _this.filelayout.el.width = w - 200;
+       _this.filelayout.el.width = w ;
        
         this.el.set_size(
                // this.el.get_stage().width-150,
@@ -164,7 +164,7 @@ public class Xcls_ClutterFiles : Object
        
        this.scroller.el.set_size(
                // this.el.get_stage().width-150,
-               w-50,
+               w,
                h  // this.el.get_stage().height
         );
         
@@ -346,7 +346,7 @@ public class Xcls_ClutterFiles : Object
 
             //listeners
             this.el.scroll_event.connect( ( event) => {
-               //Sprint("scroll event");
+                print("scroll event\n");
                 var y = _this.filelayout.el.y;
                 var dir = event.direction;
                 
@@ -366,38 +366,24 @@ public class Xcls_ClutterFiles : Object
                         y = float.max(bottompos, y);
                         
                         
+                        break;
+                         case Clutter.ScrollDirection.SMOOTH:
+                           double delta_x, delta_y;
+                           event.get_scroll_delta(out delta_x, out delta_y);
+                        //print("Scroll SMOOTH? by %f\n",  delta_y * event.y);
+                        y += ((float)delta_y * event.y * -1.0f) /2 ;
+                        y = float.max(bottompos, y);
+                        y = float.min(0, y); // 
+                                   
                         break;
                     default:
+                       print("scroll event = bad direction %s\n", dir.to_string());
                         return false;
                 }
                 // range of scroll -- can go up -- eg.. -ve value.
                 
             
                 
-                // to work out the max -ve number
-                // height of filelayout
-                // height of scrollactor..
-                
-            /*
-                if ( (-1 * (y+200)) > (  last_child_bottom - this.el.height)) {
-                    var nv =         _this.filelayout.el.y ;
-                    if (nv != -1 * (  last_child_bottom - this.el.height)) {
-                
-                        _this.filelayout.el.y = -1 * (  last_child_bottom - this.el.height);
-                        return true;
-                    }
-                
-                    return  false;
-                }
-            
-            */
-                
-                
-            //    print("\nlast child - this height = %f  ==== new y %f\n ".printf( 
-              //          last_child_bottom - this.el.height,
-               //         y));    
-               // y = float.min(0, y);    //??
-               // print("scroll event of %f  - new y = %f ".printf(event.y, y));
                print("Set scroll to %f (lcb=%f / height = %f)\n", y, last_child_bottom, this.el.height);
                
                 _this.filelayout.el.y = y;
@@ -719,8 +705,6 @@ public class Xcls_ClutterFiles : Object
             child_1.ref();
             this.el.add_child (  child_1.el  );
             this.foldertitle =  child_1;
-            var child_2 = new Xcls_Text18( _this );
-            child_2.ref();
 
             // init method
 
@@ -779,19 +763,20 @@ public class Xcls_ClutterFiles : Object
         // user defined functions
     }
 
-    public class Xcls_Text18 : Object
+    public class Xcls_folderfile : Object
     {
         public Clutter.Text el;
         private Xcls_ClutterFiles  _this;
 
 
             // my vars (def)
+        public string filepath;
 
         // ctor
-        public Xcls_Text18(Xcls_ClutterFiles _owner )
+        public Xcls_folderfile(Xcls_ClutterFiles _owner , string filepath)
         {
             _this = _owner;
-            this.el = new Clutter.Text();
+            this.el = new Clutter.Text.full("Sans 10px", GLib.Path.get_basename(filepath),  Clutter.Color.from_string("#fff"));
 
             // my vars (dec)
 
@@ -799,7 +784,14 @@ public class Xcls_ClutterFiles : Object
             this.el.x_align = Clutter.ActorAlign.START;
             this.el.x_expand = true;
             this.el.y_align = Clutter.ActorAlign.START;
-            this.el.y_expand = false;
+            this.el.reactive = true;
+            this.el.y_expand = true;
+
+            // init method
+
+            {
+               this.filepath = filepath;
+            }
 
             //listeners
             this.el.button_press_event.connect( (  event) => {