Conditional visibility in list itemlayout
#1
Hello all,
I'm quite new to the skinning "game", so to speak, so probably this is just a noob question, but it's driving me crazy.

I have a list control with it's item layout ecc i would like to know if it's possible to set the visibility of a control on the layout part of the list, based on a property of the itemslist.. i've made a try including in the control

Code:
<visible>ListItem.label2</visible>
in the <itemlayout> section

and then in the item itself:
Code:
<label2>Y</label2>

It doesn't work.

Isn't possible to do so, or I'm doing something wrong?

Ciao,
ZIOLele
Reply
#2
Hi there, and welcome to the forums.

Perhaps you could give the full code for the list control, plus a more detailed description of what you are trying to achieve?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
jmarshall Wrote:Hi there, and welcome to the forums.

Perhaps you could give the full code for the list control, plus a more detailed description of what you are trying to achieve?

Cheers,
Jonathan

Here is the code:

Code:
<control type="list" id="1">
    <posx>405</posx>
    <posy>110</posy>
    <height>360</height>
    <width>305</width>
    <onleft>5</onleft>
    <onright>5</onright>
    <onup>5</onup>
    <ondown>5</ondown>
    <itemlayout height="40">
        <control type="label">
            <posx>20</posx>
            <posy>0</posy>
            <width>265</width>
            <height>40</height>
            <info>ListItem.label</info>
            <aligny>center</aligny>
            <font>font13</font>
            <textcolor>button-text</textcolor>
        </control>
        <control type="image">
            <posx>265</posx>
            <posy>-18</posy>
            <width>25</width>
            <height>75</height>
            <texture>home-buttonarrow-alpha.png</texture>
            <aspectratio align="right">keep</aspectratio>
                        <visible>ListItem.label2</visible>
        </control>
    </itemlayout>
    <focusedlayout height="40">
        <control type="image">
            <posx>0</posx>
            <posy>0</posy>
            <width>305</width>
            <height>40</height>
            <texture>default-button.png</texture>
        </control>
            <control type="label">
            <posx>20</posx>
            <posy>0</posy>
            <width>265</width>
            <height>40</height>
            <info>ListItem.label</info>
            <aligny>center</aligny>
            <font>font13</font>
            <textcolor>button-text</textcolor>
        </control>
        <control type="image">
            <posx>265</posx>
            <posy>-18</posy>
            <width>25</width>
            <height>75</height>
            <texture>home-buttonarrow.png</texture>
            <aspectratio align="right">keep</aspectratio>
                        <visible>ListItem.label2</visible>
        </control>
    </focusedlayout>
    <content>
        <item>
            <label>31008</label>
            <label2>Y</label2>
                        <onclick>ActivateWindow(4)</onclick>
            </item>
        <item>
            <label>31068</label>
                        <label2>N</label2>
                <onclick>ActivateWindow(51)</onclick>
        </item>
    </content>                
</control>

What I want is to show the arrow on the first item in the list and not show it in the second item... as i said i'm really a noob at skinning so i don't know if this is possible or not.. all i know is the way i'm trying to do it doesn't work... Big Grin

I hope i made it clearer...
Thanks

ZIOLele
Reply
#4
I hope I understand you correctly. Will your list have only these two items? Wouldn't you be better of just making two separate buttons?

Then you could give both buttons an ID and use conditional visibility on those or just use two seperate textures. AFAIK you can't use conditional visibility on the items within the list, just on the list itself. If you just need two controls using a list seems a bit over complicated. But maybe you have other plans Wink
Reply
#5
Jeroen Wrote:I hope I understand you correctly. Will your list have only these two items? Wouldn't you be better of just making two separate buttons?

Then you could give both buttons an ID and use conditional visibility on those or just use two seperate textures. AFAIK you can't use conditional visibility on the items within the list, just on the list itself. If you just need two controls using a list seems a bit over complicated. But maybe you have other plans Wink

well no, my list have more items in it. It is a menu, the "problem" is that some items are submenus, others are not... right now all items have an arrow on the right i would prefer to hide this arrow for the items wich are not submenus..

I'm using a list because it handle auto-magically the position of its items, since some of them could be hidden with specific options. If you have some ideas on how i can make this in another way, tell me, as i said i'm new to skinning and open to good ideas Big Grin

ZIOLele
P.S.: I really like your Focus skin... good work!
Reply
#6
Ok, you want to do it like this:

1. Have a <label2> on only the submenus - don't have it on the others.
2. Use IsEmpty(ListItem.Label2) as the visibility condition.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
Thanks, it work perfectly! :-D
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional visibility in list itemlayout0