Kodi Community Forum

Full Version: Conditional Height
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there, having a slight brain freeze. I am trying to create a list, whose height will change depending on whether a setting is applied or not. Code fragment below:

<control type="list" id="506">
<posx>300</posx>
<posy>544</posy>
<width>1000</width>
<height>176</height>
<viewtype label="ninjalist">list</viewtype>
...
...


Now, if for instance a condition such as "Skin.HasSetting(raiselist)" I want the height of the list to be a certain value, and if this condition "!Skin.HasSetting(raiselist)" is not met, I would like the height to be another value. Is there something like conditional height when I can do the following in a single list control.

<height condition="Skin.HasSetting(raiselist)">300</height>
<height condition="!Skin.HasSetting(raiselist)">176</height>


I have attempted to create two list controls with same id number, and different heights which is visible when these either of the two conditions are met, but one of them won't work.

Any idea what the solution to my dilemma may be guys?
only way atm is to use includes + reloadwindow(). we have the same "problem" with low list viewtype.
(2012-06-06, 00:23)BlackRose Wrote: [ -> ]I have attempted to create two list controls with same id number, and different heights which is visible when these either of the two conditions are met, but one of them won't work.

Change the ID of one of them so they're not the same.
(2012-06-06, 08:30)Hitcher Wrote: [ -> ]
(2012-06-06, 00:23)BlackRose Wrote: [ -> ]I have attempted to create two list controls with same id number, and different heights which is visible when these either of the two conditions are met, but one of them won't work.

Change the ID of one of them so they're not the same.

Will this work? Does there not have to be a default control, and if not present, kabam!

Quote:only way atm is to use includes + reloadwindow(). we have the same "problem" with low list viewtype.

Please elaborate super phil? I'm using your low list as a reference, but have changed the control to a list, due to cosmetic value (lol!).
inside the list:

Code:
<include condition="!Skin.HasSetting(nohighlist)">LowListHeightHigh</include>
                <include condition="Skin.HasSetting(nohighlist)">LowListHeightLow</include>

Includes:



Code:
<include name="LowListHeightHigh">
        <height>480</height>
        <focusposition>3</focusposition>
    </include>
    <include name="LowListHeightLow">
        <height>330</height>
        <focusposition>1</focusposition>
    </include>


settings button:


Code:
<control type="radiobutton" id="1630">
                <description>Toggle Lower List</description>
                <include>Objects_MediaMenuButtonAlt2</include>
                <label>$LOCALIZE[31170]</label>
                <onclick>Skin.ToggleSetting(nohighlist)</onclick>
                <onclick>XBMC.ReloadSkin()</onclick>
                <selected>Skin.HasSetting(nohighlist)</selected>
                <visible>Window.IsActive(videolibrary) + stringcompare(Skin.String(actualViewtype),lowlist)</visible>
            </control>


only other solution is, as Hitcher said, to make seperate viewtypes with different ids.
(2012-06-06, 12:48)phil65 Wrote: [ -> ]inside the list:

Code:
<include condition="!Skin.HasSetting(nohighlist)">LowListHeightHigh</include>
                <include condition="Skin.HasSetting(nohighlist)">LowListHeightLow</include>

Includes:



Code:
<include name="LowListHeightHigh">
        <height>480</height>
        <focusposition>3</focusposition>
    </include>
    <include name="LowListHeightLow">
        <height>330</height>
        <focusposition>1</focusposition>
    </include>


settings button:


Code:
<control type="radiobutton" id="1630">
                <description>Toggle Lower List</description>
                <include>Objects_MediaMenuButtonAlt2</include>
                <label>$LOCALIZE[31170]</label>
                <onclick>Skin.ToggleSetting(nohighlist)</onclick>
                <onclick>XBMC.ReloadSkin()</onclick>
                <selected>Skin.HasSetting(nohighlist)</selected>
                <visible>Window.IsActive(videolibrary) + stringcompare(Skin.String(actualViewtype),lowlist)</visible>
            </control>


only other solution is, as Hitcher said, to make seperate viewtypes with different ids.

Now that is seriously sexy. Thanks so much Philinio! That is going to be a serious help. Now stop wasting your time on a fool like me and go sort Aeon Nox 4.0 out! haha
(2012-06-06, 14:13)BlackRose Wrote: [ -> ]
(2012-06-06, 12:48)phil65 Wrote: [ -> ]inside the list:

Code:
<include condition="!Skin.HasSetting(nohighlist)">LowListHeightHigh</include>
                <include condition="Skin.HasSetting(nohighlist)">LowListHeightLow</include>

Includes:



Code:
<include name="LowListHeightHigh">
        <height>480</height>
        <focusposition>3</focusposition>
    </include>
    <include name="LowListHeightLow">
        <height>330</height>
        <focusposition>1</focusposition>
    </include>


settings button:


Code:
<control type="radiobutton" id="1630">
                <description>Toggle Lower List</description>
                <include>Objects_MediaMenuButtonAlt2</include>
                <label>$LOCALIZE[31170]</label>
                <onclick>Skin.ToggleSetting(nohighlist)</onclick>
                <onclick>XBMC.ReloadSkin()</onclick>
                <selected>Skin.HasSetting(nohighlist)</selected>
                <visible>Window.IsActive(videolibrary) + stringcompare(Skin.String(actualViewtype),lowlist)</visible>
            </control>


only other solution is, as Hitcher said, to make seperate viewtypes with different ids.

Now that is seriously sexy. Thanks so much Philinio! That is going to be a serious help. Now stop wasting your time on a fool like me and go sort Aeon Nox 4.0 out! haha

solutions with reloadskin() aren´t sexy Wink
And they're frowned upon for official repo releases. Confused
(2012-06-06, 14:25)phil65 Wrote: [ -> ]
(2012-06-06, 14:13)BlackRose Wrote: [ -> ]
(2012-06-06, 12:48)phil65 Wrote: [ -> ]inside the list:

Code:
<include condition="!Skin.HasSetting(nohighlist)">LowListHeightHigh</include>
                <include condition="Skin.HasSetting(nohighlist)">LowListHeightLow</include>

Includes:



Code:
<include name="LowListHeightHigh">
        <height>480</height>
        <focusposition>3</focusposition>
    </include>
    <include name="LowListHeightLow">
        <height>330</height>
        <focusposition>1</focusposition>
    </include>


settings button:


Code:
<control type="radiobutton" id="1630">
                <description>Toggle Lower List</description>
                <include>Objects_MediaMenuButtonAlt2</include>
                <label>$LOCALIZE[31170]</label>
                <onclick>Skin.ToggleSetting(nohighlist)</onclick>
                <onclick>XBMC.ReloadSkin()</onclick>
                <selected>Skin.HasSetting(nohighlist)</selected>
                <visible>Window.IsActive(videolibrary) + stringcompare(Skin.String(actualViewtype),lowlist)</visible>
            </control>


only other solution is, as Hitcher said, to make seperate viewtypes with different ids.

Now that is seriously sexy. Thanks so much Philinio! That is going to be a serious help. Now stop wasting your time on a fool like me and go sort Aeon Nox 4.0 out! haha

solutions with reloadskin() aren´t sexy Wink

Haha, I reload my skin all the time... but yeah, why u nox fellows not try the Hitch-Meister's solutionHuh could work...

Quote:And they're frowned upon for official repo releases.

Well, I frowned when I tried the multiple id solution last night... was excited... but it didn't work for some reason... do you think the different id's caused the list not to appear when one setting was chosenHuh.. i was clueless, thought it was because of the default control thingy... thought it would work... but yeah, any idea?
(2012-06-06, 15:04)Hitcher Wrote: [ -> ]And they're frowned upon for official repo releases. Confused

i know. that´s why i was begging for conditional height some time ago.
conditional focusedposition and navigation (hor/ver) would also be nice to have.
tackled the reloadskin thing again...
achieved now to get rid of all reloadskin() in our skin by loading an empty window and returning then to the origin.

https://github.com/BigNoid/Aeon-Nox/comm...706173f723
https://github.com/BigNoid/Aeon-Nox/comm...ca7bd9117e

perhaps others can make use of that.
(2012-06-07, 01:26)phil65 Wrote: [ -> ]tackled the reloadskin thing again...
achieved now to get rid of all reloadskin() in our skin by loading an empty window and returning then to the origin.

https://github.com/BigNoid/Aeon-Nox/comm...706173f723
https://github.com/BigNoid/Aeon-Nox/comm...ca7bd9117e

perhaps others can make use of that.

Ur a clever yoda type fellow aren't u! I have so much to learn.
i know why i was binging a conditional weight
(2012-06-07, 14:43)BlackRose Wrote: [ -> ]Ur a clever yoda type fellow aren't u! I have so much to learn.

Young padawan he is. Still much to learn he has Big Grin
(2012-06-09, 20:37)Martijn Wrote: [ -> ]
(2012-06-07, 14:43)BlackRose Wrote: [ -> ]Ur a clever yoda type fellow aren't u! I have so much to learn.

Young padawan he is. Still much to learn he has Big Grin

The real padawan´s lost against Denmark today Wink