Panel Width and Conditions
#1
I'm trying to setup a music view which displays a panel of tiled album covers but I need to make adjust the width of the panel depending on whether or not there is a on playing (Player.HasAudio).

The code for the panel is as follows:

Code:
<include name="SSAlbum2">
    <control type="panel" id="51">
      <viewtype label="Album">icon</viewtype>
      <posx>2</posx>
      <posy>139</posy>
      <width>530</width>
      <height>292</height>
      <pagecontrol>-</pagecontrol>
      <onleft>2</onleft>
      <onright>2</onright>
      <onup>51</onup>
      <ondown>51</ondown>
      <orientation>vertical</orientation>
      <include>common-fade</include>
      <visible>!Window.IsVisible(129)</visible>
      <itemlayout width="77" height="92">
        <control type="image">
          <posx>21</posx>
          <posy>17</posy>
          <width>66</width>
          <height>88</height>
          <info>ListItem.Icon</info>
          <aspectratio aligny="center">stretch</aspectratio>
          <colordiffuse>e0FFFFFF</colordiffuse>
        </control>
      </itemlayout>
      <focusedlayout width="83" height="103">
        <control type="image">
          <posx>14</posx>
          <posy>7</posy>
          <width>79</width>
          <height>106</height>
          <info>ListItem.Icon</info>
          <aspectratio aligny="center">stretch</aspectratio>
          <animation effect="zoom" start="21,17,66,88" end="14,7,79,106" time="100">Focus</animation>
        </control>
      </focusedlayout>
    </control>
  </include>

I tried putting a group control around the panel and then having a conditional zoom animation (staring with the width at 720 and then reducing it to 530 when the PLayer.HasAudio becomes true). This looked fine when there was no song playing but when there was it just squeezed the panel, making it look all squashed.

Is it possible to adjust the width of the panel (or the number of items displayed horizontally) based on the value of Player.HasAudio?

Thanks
Reply
#2
Nope.

The problem is, ofcourse, that it requires re-doing the layout of the panel. Thus items will shuffle around. This <may> look a little nasty.

As you are aware, the layout is done based on the width and height of the layout items - this is what would have to be changed, and the container would need to be aware of the changes so that it could re-calculate itself (which involves possibly rendering more objects than it would have normally, and updating page controls etc. as necessary).

It's not something that I see a simple solution to, but I'm open to suggestions and ideas as to how this might be accomplished (from the skinner's perspective).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
I think you're probably right that it's more trouble than it's worth. I was originally thinking about it from the user's viewpoint (they start playing a song and the panel reduces in width) but hadn't really considered what that would mean for the skinning engine.

I'm going to have another play about with it and see if I can come up with an alternative solution Rolleyes

Thanks
Reply

Logout Mark Read Team Forum Stats Members Help
Panel Width and Conditions0