Author: tom
Date: Mon Nov 10 10:11:41 2008
New Revision: 3315

URL: http://svn.slimdevices.com?rev=3315&root=Jive&view=rev
Log:
Bug 9948:
Description: 
- mouseBounds adjust for padding (fixes desktop skin scrollbar).
- non-drag mouse movement doesn't scroll menu

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

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=3315&root=Jive&r1=3314&r2=3315&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 Mon Nov 10 
10:11:41 2008
@@ -234,14 +234,18 @@
                        return self.scrollbar:_event(event)
 
                else
-                       -- menu selection follows mouse
+                       --mouse is inside menu region
                        local x,y,w,h = self:mouseBounds(event)
                        local i = y / self.itemHeight --(h / self.numWidgets)
 
-                       self:setSelectedIndex(self.topItem + math.floor(i))
-
+                       local itemShift = math.floor(i)
+                       
                        if evtype == EVENT_MOUSE_DRAG then
+                               self:setSelectedIndex(self.topItem + itemShift)
                                _scrollList(self)
+                       elseif (itemShift >= 0 and itemShift < self.numWidgets) 
then 
+                               -- menu selection follows mouse, but no 
scrolling occurs
+                               self:setSelectedIndex(self.topItem + itemShift)
                        end
 
                        return EVENT_CONSUME

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_widget.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_widget.c?rev=3315&root=Jive&r1=3314&r2=3315&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_widget.c (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_widget.c Mon Nov 10 
10:11:41 2008
@@ -238,10 +238,10 @@
                return 1;
        }
 
-       lua_pushinteger(L, event->u.mouse.x - peer->bounds.x);
-       lua_pushinteger(L, event->u.mouse.y - peer->bounds.y - 
peer->padding.top - peer->padding.bottom);
-       lua_pushinteger(L, peer->bounds.w);
-       lua_pushinteger(L, peer->bounds.h);
+       lua_pushinteger(L, event->u.mouse.x - peer->bounds.x - 
peer->padding.left);
+       lua_pushinteger(L, event->u.mouse.y - peer->bounds.y - 
peer->padding.top);
+       lua_pushinteger(L, peer->bounds.w - peer->padding.left - 
peer->padding.right);
+       lua_pushinteger(L, peer->bounds.h - peer->padding.top - 
peer->padding.bottom);
        return 4;
 }
 

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

Reply via email to