Revision: 3044
          http://vexi.svn.sourceforge.net/vexi/?rev=3044&view=rev
Author:   clrg
Date:     2008-08-07 22:50:58 +0000 (Thu, 07 Aug 2008)

Log Message:
-----------
Scrollbar fixes (movement limits, shadow display)

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/scrollbar.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/scrollbar.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/scrollbar.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/scrollbar.t  
2008-08-06 22:58:54 UTC (rev 3043)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/scrollbar.t  
2008-08-07 22:50:58 UTC (rev 3044)
@@ -104,7 +104,7 @@
         var syncThumbTrap = function(v) { cascade = v; syncThumb(); }
         
         var viewportMove = function(v) {
-            cascade = v;
+            cascade = vexi.math.min(0, vexi.math.max(v, viewport[dim] - 
viewport[0][dim]));
             if (percentset) return;
             percentset = true;
             percent = viewport[0][pos] / (viewport[dim] - viewport[0][dim]);
@@ -116,6 +116,7 @@
         /** viewport or viewport[0] resized */
         var viewportResize = function(v) {
             cascade = v;
+            if (percentset) return;
             // avoid resetting percent
             percentset = true;
             // viewport bigger than view subject
@@ -270,6 +271,7 @@
                 vexi.math.max(0,
                     vexi.math.min(th_track[dim] - th_thumb[dim],
                         thumbpos + d[pos]));
+            if (percentset) return;
             // set percent according to thumb
             percentset = true;
             percent = th_thumb[pos] / (th_track[dim] - th_thumb[dim]);

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/scrollbar.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/scrollbar.t       
2008-08-06 22:58:54 UTC (rev 3043)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/scrollbar.t       
2008-08-07 22:50:58 UTC (rev 3044)
@@ -40,10 +40,11 @@
             }
         }
         
+        /** prevent thumb presses from activating track action */
         $track.Press1 ++= function(v) { if ($thumb.mouse.inside) return; 
cascade = v; }
         
-        $track.action ++= function(v) {
-            cascade = v;
+        /** set shadow to cover track to one side of the thumb */
+        var setShadow = function() {
             var thumbpos = $thumb[pos];
             var trackpos = $track.mouse[pos];
             if (thumbpos > trackpos) {
@@ -54,8 +55,18 @@
                 $shadow.display = true;
                 $shadow[dim] = $track[dim] - $thumb[dim] - $thumb[pos];
                 $shadow[pos] = $thumb[dim] + $thumb[pos];
-            } else $shadow.display = false;
+            }
         }
         
+        /** trap function to invoke setShadow() */
+        var syncShadow = function(v) {
+            cascade = v;
+            if (v) setShadow();
+            else $shadow.display = false;
+        }
+        
+        $track.action ++= syncShadow;
+        $track.repeat ++= syncShadow;
+        
     </ui:box>
 </vexi>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to