Author: titmuss
Date: Wed Nov 12 14:33:12 2008
New Revision: 3350
URL: http://svn.slimdevices.com?rev=3350&root=Jive&view=rev
Log:
Bug: 9362
Description:
Fix rendering Choice widgets when used with home menu customization.
Modified:
7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Group.lua
7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua
7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_group.c
Modified: 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Group.lua
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Group.lua?rev=3350&root=Jive&r1=3349&r2=3350&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Group.lua (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Group.lua Wed Nov 12
14:33:12 2008
@@ -108,12 +108,13 @@
=cut
--]]
function setWidget(self, key, widget)
- if self.widgets[key] == widget then
+ if self.widgets[key] == widget
+ and self.widgets[key].parent == self then
return
end
if self.widgets[key] then
- if self.widgets[key].parent == self then
+ if self.widgets[key].parent ~= self then
if self.visible then
self.widgets[key]:dispatchNewEvent(EVENT_HIDE)
end
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=3350&root=Jive&r1=3349&r2=3350&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 Nov 12
14:33:12 2008
@@ -262,6 +262,7 @@
widget:_event(event)
end
+ self:reLayout()
return EVENT_UNUSED
end
Modified: 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_group.c
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_group.c?rev=3350&root=Jive&r1=3349&r2=3350&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_group.c (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_group.c Wed Nov 12
14:33:12 2008
@@ -218,10 +218,21 @@
static int draw_closure(lua_State *L) {
- if (jive_getmethod(L, 1, "draw")) {
+ boolean is_parent;
+
+ /* Only draw the widget if we are it's parent. This fixes a
+ * rendering error when a widget (eg choice) is used in the
+ * home menu customization (Bug 9362).
+ */
+ lua_getfield(L, 1, "parent");
+ lua_pushvalue(L, lua_upvalueindex(1)); // group widget
+ is_parent = (lua_equal(L, -1, -2) == 0);
+ lua_pop(L, 2);
+
+ if (is_parent && jive_getmethod(L, 1, "draw")) {
lua_pushvalue(L, 1); // widget
- lua_pushvalue(L, lua_upvalueindex(1)); // surface
- lua_pushvalue(L, lua_upvalueindex(2)); // layer
+ lua_pushvalue(L, lua_upvalueindex(2)); // surface
+ lua_pushvalue(L, lua_upvalueindex(3)); // layer
lua_call(L, 3, 0);
}
@@ -251,9 +262,10 @@
if (jive_getmethod(L, 1, "iterate")) {
lua_pushvalue(L, 1); // widget
+ lua_pushvalue(L, 1); // widget
lua_pushvalue(L, 2); // surface
lua_pushvalue(L, 3); // layer
- lua_pushcclosure(L, draw_closure, 2);
+ lua_pushcclosure(L, draw_closure, 3);
lua_call(L, 2, 0);
}
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins