Author: bklaas
Date: Mon Apr 14 10:18:35 2008
New Revision: 2231

URL: http://svn.slimdevices.com?rev=2231&root=Jive&view=rev
Log:
Bug: 6907
Description: 
create new style 'popupToast' based on albumitem that allows for structured 
display of textarea, text, and icon group elements, which may or may not be 
present depending on context

tweak paddings of icon and text to better align elements

re-use self.currentsong.window for popup showBrieflys

Modified:
    
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
    7.0/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua

Modified: 
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
URL: 
http://svn.slimdevices.com/7.0/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua?rev=2231&root=Jive&r1=2230&r2=2231&view=diff
==============================================================================
--- 
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 (original)
+++ 
7.0/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 Mon Apr 14 10:18:35 2008
@@ -956,6 +956,24 @@
        s.albumitem.icon.img = Surface:loadImage(imgpath .. 
"menu_album_noartwork.png")
        s.albumitem.icon.border = { 8, 0, 0, 0 }
 
+       s.popupToast = _uses(s.albumitem, 
+               {
+                       order = { 'icon', 'text', 'textarea' },
+                       textarea = { 
+                               w = WH_FILL, 
+                               h = WH_FILL, 
+                               padding = { 12, 20, 12, 12 } 
+                       },
+                       text = { 
+                               padding = { 6, 15, 8, 8 } 
+                       },
+                       icon = { 
+                               align = 'top-left', 
+                               border = { 12, 12, 0, 0 } 
+                       }
+               }
+       )
+
        s.albumitemNoAction = {}
        s.albumitemNoAction.order = { "text" }
        s.albumitemNoAction.text = {}
@@ -1158,7 +1176,15 @@
        s.popupplay.y = screenHeight - 96
        s.popupplay.w = screenWidth
        s.popupplay.h = 96
-       s.popupplay.bgImg = helpBox
+
+       -- for textarea properties in popupplay
+       s.popupplay.padding = { 12, 12, 12, 0 }
+       s.popupplay.fg = TEXT_COLOR
+       s.popupplay.font = FONT_15px
+       s.popupplay.align = "top-left"
+       s.popupplay.scrollbar = {}
+       s.popupplay.scrollbar.w = 0
+
 
        s.popupplay.text = {}
        s.popupplay.text.w = screenWidth
@@ -1175,15 +1201,6 @@
        }
        s.popupplay.text.fg = TEXT_COLOR
        s.popupplay.text.align = "top-left"
-
-       -- for textarea properties in popupplay
-       s.popupplay.padding = 12
-       s.popupplay.h = 72
-       s.popupplay.fg = TEXT_COLOR
-       s.popupplay.font = FONT_15px
-       s.popupplay.align = "top-left"
-       s.popupplay.scrollbar = {}
-       s.popupplay.scrollbar.w = 0
 
        -- Popup window for information display
        s.popupinfo = {}

Modified: 7.0/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL: 
http://svn.slimdevices.com/7.0/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=2231&root=Jive&r1=2230&r2=2231&view=diff
==============================================================================
--- 7.0/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua (original)
+++ 7.0/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua Mon Apr 14 
10:18:35 2008
@@ -675,10 +675,12 @@
        self.currentSong.window:setAlwaysOnTop(true)
        self.currentSong.artIcon = Icon("icon")
        self.currentSong.text = Label("text", "")
-
-       local group = Group("albumitem", {
-                     text = self.currentSong.text,
-                     icon = self.currentSong.artIcon
+       self.currentSong.textarea = Textarea('popupplay', '')
+
+       local group = Group("popupToast", {
+                       text = self.currentSong.text,
+                       textarea = self.currentSong.textarea,
+                       icon = self.currentSong.artIcon
              })
 
        self.currentSong.window:addWidget(group)
@@ -779,11 +781,9 @@
                local type    = display["type"] or 'text'
 
                local s = self.currentSong
-               local showMe
 
                if type == 'song' then
-                       showMe = s.window
-                       -- new song display from server
+                       s.textarea:setValue("")
                        s.text:setValue(table.concat(display["text"], "\n"))
                        s.artIcon:setStyle("icon")
                        if display['icon'] then
@@ -792,13 +792,12 @@
                                
self.slimServer:fetchArtworkThumb(display["icon-id"], s.artIcon, 56, 'png')
                        end
                else
-                       local textarea = Textarea('popupplay', 
table.concat(display['text'], ' '))
-                       showMe = Popup("currentsong")
-                       showMe:addWidget(textarea)
-                       showMe:setAllowScreensaver(true)
-                       showMe:setAlwaysOnTop(true)
+                       s.text:setValue('')
+                       s.artIcon:setStyle("noimage")
+                       s.artIcon:setValue(nil)
+                       s.textarea:setValue(table.concat(display["text"], "\n"))
                end
-               showMe:showBriefly(3000, nil, Window.transitionPushPopupUp, 
Window.transitionPushPopupDown)
+               s.window:showBriefly(3000, nil, Window.transitionPushPopupUp, 
Window.transitionPushPopupDown)
        end
 end
 

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

Reply via email to