Kodi Community Forum
Select a skins colour theme. - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Select a skins colour theme. (/showthread.php?tid=363855)



Select a skins colour theme. - roidy - 2021-08-05

Is there any way to change the skins colour theme, like an <onclick>SetColorTheme(blue)</onclick> kind of function?

I can't see any sort of function in the wiki.

I'd like on first start up of my skin to present the user with the various colour themes and let them choose one.

Any ideas?

Thanks


RE: Select a skins colour theme. - bsoriano - 2021-08-05

(2021-08-05, 20:20)roidy Wrote: Is there any way to change the skins colour theme, like an <onclick>SetColorTheme(blue)</onclick> kind of function?

I can't see any sort of function in the wiki.

I'd like on first start up of my skin to present the user with the various colour themes and let them choose one.

Any ideas?

Thanks
@roidy , I use script.embuary.helper for this.  In the Colors section of the skin settings, I have a button that presents the user with a select dialog with the various color themes so that they can choose one.  Here is the code:

xml:

<control type="button" id="91080">
      <width>1350</width>
      <height>60</height>
      <texturenofocus />
      <textoffsetx>30</textoffsetx>
      <onclick>SetProperty(Dialog.1.Label,$LOCALIZE[571])</onclick>
  <onclick>SetProperty(Dialog.1.BuiltIn,RunScript(script.embuary.helper,action=setkodisetting,setting=lookandfeel.skincolors,value=SKINDEFAULT)||Skin.SetString(HighlightColorStr,None)||Skin.SetString(LabelTextColorStr,None)||Skin.SetString(FocusedTextColorStr,None)||Skin.SetString(SelectedTextColorStr,None))</onclick>
      <onclick>SetProperty(Dialog.2.Label,Blue)</onclick>
                        <onclick>SetProperty(Dialog.2.BuiltIn,RunScript(script.embuary.helper,action=setkodisetting,setting=lookandfeel.skincolors,value=Blue)||Skin.SetString(HighlightColorStr,None)||Skin.SetString(LabelTextColorStr,None)||Skin.SetString(FocusedTextColorStr,None)||Skin.SetString(SelectedTextColorStr,None))</onclick>
      <onclick>SetProperty(Dialog.3.Label,Green)</onclick>
                        <onclick>SetProperty(Dialog.3.BuiltIn,RunScript(script.embuary.helper,action=setkodisetting,setting=lookandfeel.skincolors,value=Green)||Skin.SetString(HighlightColorStr,None)||Skin.SetString(LabelTextColorStr,None)||Skin.SetString(FocusedTextColorStr,None)||Skin.SetString(SelectedTextColorStr,None))</onclick>
      <onclick>SetProperty(Dialog.4.Label,White)</onclick>
                        <onclick>SetProperty(Dialog.4.BuiltIn,RunScript(script.embuary.helper,action=setkodisetting,setting=lookandfeel.skincolors,value=White)||Skin.SetString(HighlightColorStr,None)||Skin.SetString(LabelTextColorStr,None)||Skin.SetString(FocusedTextColorStr,None)||Skin.SetString(SelectedTextColorStr,None))</onclick>
      <onclick>RunScript(script.embuary.helper,action=createselect,header=$LOCALIZE[15111])</onclick>
      <label>$LOCALIZE[32210]</label>
      <label2>$VAR[SkinColorTheme]</label2>
      <visible>Skin.HasSetting(Enable.EmbuaryHelper)</visible>
</control>

As you can see, I am using the setkodisetting function of embuary helper to set the lookandfeel.skincolors Kodi setting, and I am also using embuary helper to build and show the select dialog itself.  That function is explained here: https://github.com/sualfred/script.embuary.helper/wiki/Script:-Creating-dialogs#select-dialog

I hope this is useful to you.

Regards,

Bart


RE: Select a skins colour theme. - roidy - 2021-08-06

(2021-08-05, 22:29)bsoriano Wrote: @roidy , I use script.embuary.helper for this.  In the Colors section of the skin settings, I have a button that presents the user with a select dialog with the various color themes so that they can choose one.  Here is the code:

Perfect, Thanks.