Conditional Hide (1 Viewer)

Kurtis

Portal Member
April 17, 2007
11
2
50
Home Country
United States of America United States of America
Pardon me if this is a stupid newbie quesiton, but is it possible to make one control dependent on the visibility of another?

Use case: I see a lot of the widescreen skins are moving to the full window width view for icon view, which makes sense (it looks like the Vista Media Center album view, for instance) but, frankly, that screen real estate is wasted in list view. It would be nice to make list view more like the apple TV view (where you set aside a large chunk of that space for a big cover art image) but there's no way to make that big image ONLY show up with the list control as far as I can see.

If there isn't a way to currently do this, it seems like this one use case could be done pretty easily in the code, and I'll look into it. I was just making sure there isn't a more general way.
 

mirk

Retired Team Member
  • Premium Supporter
  • June 2, 2006
    863
    64
    Växjö, Sweden
    Home Country
    Sweden Sweden
    Its possible to control other controls visibility with this code:

    Code:
             <control>
    		<description>Movies</description>
    		<type>button</type>
    		<id>3</id>
    		<posX>0</posX>
    		<posY>0</posY>
    		<width>1280</width>
    		<height>720</height>
    		<textureFocus>-</textureFocus>
    		<hyperlink>6</hyperlink>
    		<label>3</label>
      		<textcolor>00ffffff</textcolor>
    		<onleft>2</onleft>
    		<onright>14</onright>
    		<onup>21</onup>
    		<ondown>23</ondown>
    		<textXOff>-100</textXOff>
                    <textYOff>16</textYOff>
    		[B]<visible>Control.IsVisible(3)</visible>[/B]
    	</control>

    But in the way you try to use it, its not possible. This becorce all view controls has the same Control ID. Witch will make the conditional controls also show in thumbs and filmstrip view. I have my self tryed to find a way around this many times but had no luck.
     

    rsparey

    Portal Pro
    August 16, 2006
    136
    34
    Congleton
    Home Country
    United Kingdom United Kingdom
    I have this problem as well with foofaraw.. And also have found no way around it. It would be great if there was a way to add support for this in to the skinning engine.
     

    mofux

    Portal Designer
  • Premium Supporter
  • January 27, 2006
    678
    34
    Dresden, Germany
    we (or better hwahrmann) just intodruced a way to make this working...

    there are a few new visible tags now that you can use:

    #albumViewVisible
    #filmstripViewVisible
    #largeiconsViewVisible
    #listViewVisible
    #playlistViewVisible
    #smalliconsViewVisible

    those are set by the value of the fascade control. so if you are in filmstrip view f.e.

    #filmstripViewVisible will be set to true...

    you can then use that to show / hide any information you want using the visible property of each control like this:

    <control>
    ....
    <description>some image or any other control, could also be a group</description>
    <visible>#filmstripViewVisible</visible>
    </control>

    so that control would only show up when the filmstripview is selected...

    it will be available in the next public svn build after we made some tests if it's working. big big thanks to hwahrmann!
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,630
    2,462
    Vienna, Austria
    Home Country
    Austria Austria
    It's a bit different then mofux described above.
    needed to change something.

    Based on which Viewmode you are, you can set the visibility of controls.
    the view modes are specified with:
    facadeview.album
    facadeview.filmstrip
    facadeview.list
    facadeview.largeicons
    facadeview.playlist
    facadeview.smallicons


    so if you want a specific control to appear only, while for example in List view:

    <control>
    ....
    <description>some image or any other control, could also be a group</description>
    <visible>facadeview.list</visible>
    </control>

    works from SVN 15491
     

    DarkWader

    Portal Pro
    October 3, 2006
    270
    6
    48
    Home Country
    Norway Norway
    Get this in the wiki, or pin the topic please.
     

    Kurtis

    Portal Member
    April 17, 2007
    11
    2
    50
    Home Country
    United States of America United States of America
    Well, shoot. Should've paid attention to the topic, I guess.

    I solved the limited use case: I added a "preview" image to the list control that lets you define four XML tags:

    previewPosX
    previewPosY
    previewWidth
    previewHeight

    and if they're defined renders an image of #selectedthumb at that location when the list control itself is rendered.

    It works fine, and I'm gonna put the patch here if the devs are interested. It'd be pretty easy to allow a fifth tag (something like videoPreviewIfAvailable) that would define not a GUIImage, but a playing video preview if the file has video data instead.

    Anyway, looks good all around, I guess.
     

    Users who are viewing this thread

    Top Bottom