Author: tom
Date: Wed Oct 15 20:14:37 2008
New Revision: 3145

URL: http://svn.slimdevices.com?rev=3145&root=Jive&view=rev
Log:
Bug: 9717 
Description: 
Improve slider drag boundary issues. Now slider shows top item when dragged to 
the top and same for bottom

Modified:
    7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua
    7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Scrollbar.lua

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua?rev=3145&root=Jive&r1=3144&r2=3145&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua Wed Oct 15 
20:14:37 2008
@@ -290,7 +290,7 @@
                                 end)
        obj.scrollbar = Scrollbar("scrollbar",
                                  function(_, value)
-                                         obj:setSelectedIndex(value)
+                                         obj:setSelectedIndex(value + 1) -- 
value comes in zero based, one based is needed
                                  end)
 
        obj.scrollbar.parent = obj

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Scrollbar.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Scrollbar.lua?rev=3145&root=Jive&r1=3144&r2=3145&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Scrollbar.lua (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Scrollbar.lua Wed Oct 
15 20:14:37 2008
@@ -94,14 +94,25 @@
 
 
 function _setSlider(self, percent)
-       local oldvalue = self.value
+       
+       --boundary guard, since value is often past border (e.g. when vertical 
slider drag y value moves above slider)  
+       if percent < 0 then
+               percent = 0
+       elseif percent >= 1 then
+               percent = .9999 
+       end
 
        local pos = percent * (self.range)
 
        self.value = math.floor(pos)
        self:reDraw()
-               
-       if self.value ~= oldvalue and self.closure then
+       
+-- removed oldValue check (performance enhancement as far as I can see) 
because value (in menu case, for example) was
+-- being reset by the menu after setSelectedIndex was called, calling false 
positives here
+-- I would think that these would always have been the same, but was not the 
case,
+-- so in the future this discrepency could be resolved and this performance 
enhancement could be re-added.                     
+--     if self.value ~= oldvalue and self.closure then
+       if self.closure then
                self.closure(self, self.value, false)
        end
 end

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to