Author: bklaas
Date: Mon May 19 10:49:12 2008
New Revision: 2486
URL: http://svn.slimdevices.com?rev=2486&root=Jive&view=rev
Log:
Bug: 6561, another one I can't locate
Description: only use setTitleWidget instead of several widget modifications
when setting title style + (optionally) text attributes
fix a long-existing bug where the text of the title bar in the currently
playlist window was not getting properly set under certain circumstances
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=2486&root=Jive&r1=2485&r2=2486&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
Mon May 19 10:49:12 2008
@@ -814,19 +814,21 @@
if data.window then
-- if a titleStyle is being sent, we need to
setTitleWidget completely
if data.window.titleStyle then
- -- first setup the widget with the
existing title text
- local existingTitle =
step.window:getTitle()
- if not existingTitle then
- existingTitle = ''
+ local titleText
+ -- set the title text if specified
+ if data.window.text then
+ titleText = data.window.text
+ -- otherwise default back to what's
currently in the title widget
+ else
+ titleText =
step.window:getTitle()
+ if not titleText then
+ log:warn('no title
found in existing title widget')
+ titleText = ''
+ end
end
- local newTitleWidget = Group("title", {
text = Label("text", existingTitle), icon = Icon("icon") })
+ local titleStyle =
data.window.titleStyle .. 'title'
+ local newTitleWidget =
Group(titleStyle, { text = Label("text", titleText), icon = Icon("icon") })
step.window:setTitleWidget(newTitleWidget)
- -- change the title text if necessary
- if data.window.text then
-
step.window:setTitle(data.window.text)
- end
- -- after widget is created, set the
style as directed
-
step.window:setTitleStyle(data.window.titleStyle .. 'title')
-- change the text as specified if no
titleStyle param was also sent
elseif data.window.text then
step.window:setTitle(data.window.text)
@@ -2034,9 +2036,8 @@
token = 'off'
end
- -- FIXME, bug 7365: this title doesn't get set even though this command
does change the text of the window title label
- step.window:setTitle(_string(modeTokens[token]))
- step.window:setTitleStyle("currentplaylisttitle")
+ local newTitleWidget = Group('currentplaylisttitle', { text =
Label("text", _string(modeTokens[token])), icon = Icon("icon") })
+ step.window:setTitleWidget(newTitleWidget)
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins