ListItem.Icon change on Focus ?
#1
Hello,
I'm trying to create a list that scrolls a group of buttons but i want to control that list from python so i can't use the Group List Control because python doesn't know how to add whole controls - yet! - it only knows how to add ListItems so I'm stuck with a normal List Container, so i thought i could emulate the behavior of a button in a ListItem but I've faced some challenges one of them is the Focus, UnFocus image of the button; a ListItem already has an Icon defined - which i got working (UnFocus Image) - but can i change that icon in the <focusedlayout /> to the Focus image ? or save the Focus image path in a property tag and switch it in the focuslayout !

I don't know if this possible and how to go about it, or maybe I'm using the wrong approach, maybe someone could point me to the right direction.
I would really like to solve this issue,
Any help will be appreciated.

Thanks.
I wrote a program to program my program ! - programception.
Reply
#2
this will work:
Xive Wrote:save the Focus image path in a property tag and switch it in the focuslayout

in python:
Code:
listitem.setProperty( "Foo", "focus.png" )

in your focusedlayout:
Code:
<control type="image">
    <posx>0</posx>
    <posy>0</posy>
    <width>100</width>
    <height>100</height>
    <texture>$INFO[ListItem.Property(Foo)]</texture>
</control>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
@ronie: Worked perfectly !
Thanks a million Smile
Edit: However the listitem doesn't unfocus when i leave the scroller and go to another control, is there a way to show the focus image only if the scroller HasFocus ?
Edit2: Nvm solved it 2 stacked images

Code:
<control type="image">
        <posx>5</posx>
        <posy>3</posy>
        <width>64</width>
        <height>64</height>
        <texture>$INFO[ListItem.Property(Foo)]</texture>
        <visible>Control.HasFocus(24) </visible>
</control>
<control type="image">
        <posx>5</posx>
        <posy>3</posy>
        <width>64</width>
        <height>64</height>
        <info>ListItem.Icon</info>
        <visible>!Control.HasFocus(24) </visible>
</control>

Thanks again.
I wrote a program to program my program ! - programception.
Reply

Logout Mark Read Team Forum Stats Members Help
ListItem.Icon change on Focus ?0