Author: richard
Date: Fri Feb 13 08:43:58 2009
New Revision: 4197

URL: http://svn.slimdevices.com?rev=4197&root=Jive&view=rev
Log:
Bug: N/A
Description:
Add support for background images for Icons, they should work the same a Labels.


Modified:
    7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_icon.c

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_icon.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_icon.c?rev=4197&root=Jive&r1=4196&r2=4197&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_icon.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_icon.c Fri Feb 13 
08:43:58 2009
@@ -14,6 +14,7 @@
 
        JiveSurface *img;
        JiveSurface *default_img;
+       JiveTile *bg_tile;
        Uint32 anim_frame;
        Uint32 anim_total;
 
@@ -39,6 +40,7 @@
 
 int jiveL_icon_skin(lua_State *L) {
        IconWidget *peer;
+       JiveTile *bg_tile;
        JiveSurface *img;
 
        /* stack is:
@@ -74,6 +76,14 @@
        peer->frame_rate = jive_style_int(L, 1, "frameRate", 0);
        if (peer->frame_rate) {
                peer->frame_width = jive_style_int(L, 1, "frameWidth", -1);
+       }
+
+       bg_tile = jive_style_tile(L, 1, "bgImg", NULL);
+       if (bg_tile != peer->bg_tile) {
+               if (peer->bg_tile) {
+                       jive_tile_free(peer->bg_tile);
+               }
+               peer->bg_tile = jive_tile_ref(bg_tile);
        }
 
        peer->align = jive_style_align(L, 1, "align", JIVE_ALIGN_TOP_LEFT);
@@ -236,6 +246,10 @@
        JiveSurface *srf = tolua_tousertype(L, 2, 0);
        bool drawLayer = luaL_optinteger(L, 3, JIVE_LAYER_ALL) & peer->w.layer;
 
+       if (drawLayer && peer->bg_tile) {
+               jive_tile_blit(peer->bg_tile, srf, peer->w.bounds.x, 
peer->w.bounds.y, peer->w.bounds.w, peer->w.bounds.h);
+       }
+
        if (!drawLayer || !peer->img) {
                return 0;
        }

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

Reply via email to