Author: titmuss
Date: Wed Nov 12 08:08:23 2008
New Revision: 3345

URL: http://svn.slimdevices.com?rev=3345&root=Jive&view=rev
Log:
Bug: 9926
Description:
Allow the image mask to be used even when popup windows are not transparent. 
This makes the background on the firmware update window 
black again, but still without the expense of drawing the window underneath.


Modified:
    7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c
    
7.3/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c?rev=3345&root=Jive&r1=3344&r2=3345&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_window.c Wed Nov 12 
08:08:23 2008
@@ -203,39 +203,45 @@
        WindowWidget *peer = jive_getpeer(L, 1, &windowPeerMeta);
        JiveSurface *srf = tolua_tousertype(L, 2, 0);
        Uint32 layer = luaL_optinteger(L, 3, JIVE_LAYER_ALL);
+       bool_t is_transparent, is_mask;
 
        lua_getfield(L, 1, "transparent");
-       if (lua_toboolean(L, -1)) {
-               /* draw underneath a popup */
-               if (jive_getmethod(L, 1, "getLowerWindow")) {
-                       lua_pushvalue(L, 1);
-                       lua_call(L, 1, 1);
-
-                       if ((layer & JIVE_LAYER_LOWER) && jive_getmethod(L, -1, 
"draw")) {
-                               lua_pushvalue(L, -2);
-                               lua_pushvalue(L, 2);
-                               lua_pushinteger(L, JIVE_LAYER_ALL);
+       is_transparent = lua_toboolean(L, -1);
+       lua_pop(L, 1);
+
+       is_mask = (layer & peer->w.layer) && peer->mask_tile;
+
+       if ((is_transparent || is_mask) &&
+           jive_getmethod(L, 1, "getLowerWindow")) {
+               lua_pushvalue(L, 1);
+               lua_call(L, 1, 1);
+
+               /* draw window underneath a popup */
+               if (is_transparent && (layer & JIVE_LAYER_LOWER)
+                   && jive_getmethod(L, -1, "draw")) {
+                       lua_pushvalue(L, -2);
+                       lua_pushvalue(L, 2);
+                       lua_pushinteger(L, JIVE_LAYER_ALL);
                                
-                               lua_call(L, 3, 0);
+                       lua_call(L, 3, 0);
+               }
+
+               /* draw mask under a popup */
+               if (is_mask && !lua_isnil(L, -1)) {
+                       JiveWidget *peer2;
+
+                       lua_getfield(L, -1, "peer");
+                       if (!lua_isnil(L, -1)) {
+                               peer2 = lua_touserdata(L, -1);
+
+                               jive_tile_blit(peer->mask_tile, srf, 
peer2->bounds.x, peer2->bounds.y, peer2->bounds.w, peer2->bounds.h);
                        }
-
-                       if ((layer & peer->w.layer) && !lua_isnil(L, -1) && 
peer->mask_tile) {
-                               JiveWidget *peer2;
-
-                               lua_getfield(L, -1, "peer");
-                               if (!lua_isnil(L, -1)) {
-                                       peer2 = lua_touserdata(L, -1);
-
-                                       jive_tile_blit(peer->mask_tile, srf, 
peer2->bounds.x, peer2->bounds.y, peer2->bounds.w, peer2->bounds.h);
-                               }
                                
-                               lua_pop(L, 1);
-                       }
-
-                       lua_pop(L, 1);
-               }
-       }
-       lua_pop(L, 1);
+                       lua_pop(L, 1);
+               }
+
+               lua_pop(L, 1);
+       }
 
        /* window background */
        if ((layer & peer->w.layer) && peer->bg_tile) {

Modified: 
7.3/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua?rev=3345&root=Jive&r1=3344&r2=3345&view=diff
==============================================================================
--- 
7.3/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua 
(original)
+++ 
7.3/trunk/squeezeplay/src/squeezeplay_contrib/share/applets/Test/TestApplet.lua 
Wed Nov 12 08:08:23 2008
@@ -461,10 +461,12 @@
 
        local popup = Popup("popupIcon")
 
+       popup:setTransparent(false)
+
        --FIXME, this window does not layout correctly (Bug 5412)
        local icon = Icon("iconConnecting")
        local text = Label("text", "\nDownloading Firmware")
-       local label = Label("downloading", "0%")
+       local label = Label("text", "0%")
 
        popup:addWidget(label)
        popup:addWidget(icon)

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

Reply via email to