Kodi Community Forum

Full Version: how not have possibility to selectionner toggle !!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello communauty Wink

I have a small problem, I coded this to enable or disable the background of the menu ( Refocus or Refocus Glass )

Everything works fine, but what I lack is, remove the ability to disable the buttons. !
If you onclick on Menu Refocus Glass, it disables the toggle property to refocus original, but if i disable also button refocus Glass , then it not have nothing on-screen , no visible menu on screen .


Can you help me on this problem. ?

Cheers






into Homemenu.xml

(for code refocus Glass)
<visible>!Skin.HasSetting(homemenuglass.enable)</visible>

and


(for code refocus original
<visible>Skin.HasSetting(homemenurefocus.enable)</visible>





Setting Skin :

PHP Code:
<!--Menu Background -->
    <
control type="radiobutton" id="1009"
        <
label>Refocus Glass Menu</label>    
        <
onclick>Skin.ToggleSetting(homemenuglass.enable)</onclick>        
        <
onclick condition="Skin.HasSetting(homemenurefocus.enable)">Skin.ToggleSetting(homemenurefocus.enable)</onclick>       
        <
selected>!Skin.HasSetting(homemenuglass.enable)</selected>
        <
offclick>Skin.ToggleSetting(homemenurefocus.enable)</offclick>    
        <include>
settings_Radiobutton</include>        
    </
control
    <
control type="radiobutton" id="1010">
        <
label>Refocus Menu</label>
        <
onclick>Skin.ToggleSetting(homemenurefocus.enable)</onclick>
        <
onclick condition="!Skin.HasSetting(homemenuglass.enable)">Skin.ToggleSetting(homemenuglass.enable)</onclick>
        <
selected>Skin.HasSetting(homemenurefocus.enable)</selected
        <
offclick>Skin.ToggleSetting(homemenurefocus.enable)</offclick>
        <include>
settings_Radiobutton</include>        
    </
control
<offclick> doesn't exist.

I think what you want is this

PHP Code:
<control type="radiobutton" id="1009">
    <
onclick>Skin.ToggleSetting(homemenuglass.enable)</onclick>        
    <
onclick>Skin.ToggleSetting(homemenurefocus.enable)</onclick>       
    <
selected>!Skin.HasSetting(homemenuglass.enable)</selected>  
</
control
<
control type="radiobutton" id="1010">
    <
onclick>Skin.ToggleSetting(homemenurefocus.enable)</onclick>
    <
onclick>Skin.ToggleSetting(homemenuglass.enable)</onclick>
    <
selected>Skin.HasSetting(homemenurefocus.enable)</selected
</
control
Ah a thank you from my heart, to bed at 5 am, and see that it is simple, I m dead . You make me demoralize skinners lol .. I love you Wink ha ha ha !!
I need to understand the logic of the code! Thank you very much Jeroen

Cheers
You're welcome

Just remember togglesetting doesn't change a setting to 1 specific value, it switches between 2 values.

So first time you press the button: A -> B
Second time you press the button: B -> A
Third time... exactly Smile

A + B just being examples to simplify
I will remember!

But now .. I have a new problem whenever I (with your help the communityWink) solved another.

I just create a view, with 4 possible changes, and after have I put your code to change background, the information in this view are no longer visible. I do not understand the link between these two problem, but here I am with a new problem to solve! Hard hard life skiiner! I'm exhausted lol

cheers Smile