Control visibility is only dynamic? - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Skin Help and Support (/forumdisplay.php?fid=67)
+--- Thread: Control visibility is only dynamic? (/showthread.php?tid=68751)
Control visibility is only dynamic? - KayJayX - 2010-01-28 10:00
I have been looking for a skin where watched movies/shows are shown in a different color for an easy overview (compared to the Watched overlay).
Since I couldn't find one, I decided to do a little digging and finally came up with a solution. There wasn't a listitem flag for watched/unwatched, so I tried using the ListItem.Overlay which contains the name of the overlay icon.
I'm using the Rapier skin and the value of ListItem.Overlay is OverlayWatched.png/OverlayUnWatched.png so to set a condition I can use stringcompare(ListItem.Overlay,OverlayWatched.png) which will be True if the current item is flagged as watched.
Then I take the title label and make a white version for unwatched and a blue version for watched and use the <visible> tag to turn them on/off.
In the Rapier Views.xml I go to the EpisodesListInfo2BannerStyle which displays the list of episodes of a TV show in library mode using the List Info 2 list, which is the one I use.
In the <focusedlayout> I exchange the title label with these two:
and it works beautifully. If a show is watched, the name shows in blue when I select it or in white if it hasn't been watched.
Now I want to do the same for the ones not in focus, which would be simple enough, just do the same in the <itemlayout> section... nope!
It turns out that the condition check in <visibility> is dynamic. When a label is created, all the ListItem info used (name, episode number, etc) is taken from that particular item as it should be. But the system will keep checking the condition for visibility, so if it changes it will updated.
Since ListItem will always reflect the latest selected item, the check for each label's visibility will be checked against the one in focus atm.
If you move the focus to a show that has been watched, ALL the labels will be shown as blue and if you move to an unwatched show, they all turn white.
Now, my question is: is there a way to only do the condition check at the moment of creating the control or another option of switching color according to watched status or another solution whatsoever? Any help will be appreciated
- jmarshall - 2010-01-28 10:21
Reason is that the stringcompare functionality means it's dropped down to the global visibility section which thus means the listitem.* variables are taken from the focus.
You can't do anything about it that I'm aware of.
- KayJayX - 2010-01-29 00:00
Thanks. I was afraid it would be the case. I'll try something else, or see if I can make the developers add flag to make a condition dynamic/fixed or conditional colour tags... and ofc a ListItem.Watched property.