getmusicbee.com

Support => Developers' Area => TheaterMode => Topic started by: Bee-liever on January 16, 2014, 08:51:04 PM

Title: center of panel
Post by: Bee-liever on January 16, 2014, 08:51:04 PM
Is there a setting to keep the center of an item, e.g. Album Cover, aligned to center of the panel in standard TM
Title: Re: center of panel
Post by: Bee-liever on January 18, 2014, 06:31:42 AM
I'll clarify the above question, to see if I can make it easier to answer.

Is there some way (or an attribute maybe, that I haven't tried) in TM, eg:align:"Panel.center", that can be used to align the center of a size-changing element, eg:type="AlbumCover", to the center of the panel or another element, please?

Title: Re: center of panel
Post by: Steven on January 18, 2014, 08:27:05 AM
it should work with x/y Anchors eg.
xAnchor="#Picture.Center"
and you can then tweak the position by then using an x value

xAnchor="Panel.Center" x="-20"
Title: Re: center of panel
Post by: Bee-liever on January 18, 2014, 08:47:08 AM
Thank you, I will check this out to make sure, but I think that will only align the top LH corner to the center.

I want to align the center of the two items so that they are always aligned.

I can do it with the new % values if the top item is a fixed size, but when it's the AlbumCover that can vary in size with the min/max attributes, things get a bit wonky.
Title: Re: center of panel
Post by: redwing on January 19, 2014, 02:44:48 AM
Would be great if align attribute supports "Center" along with the current "Top.Left", "Top.Right", "Bottom.Left", and "Bottom.Right". Then we could draw an element in a variable size in the center of panel:

Code
<element type="AlbumCover" xAnchor="Panel.Center" x="0" yAnchor="Panel.Center" y="0" align="Center" widthDock="X:Panel.60" width="0" heightDock="Y:Panel.70" height="0" ></element>

That will be useful to some kind of elements like blocks. But the problem is that there's no way to have album cover keep its original width/height ratio. With the code above, the cover's shape will be distorted depending on the whole player window's shape. But, for some reason, embedded TM allows keeping original ratio with the following code where height is not precisely defined.

Code
<element type="AlbumCover" xAnchor="Panel.Center" x="0" yAnchor="Panel.Center" y="0" align="Center" widthDock="X:Panel.60" width="0" heightDock="Panel" height="0" ></element>

If that supports full-screen TM too, the problem can be resolved.
Title: Re: center of panel
Post by: Bee-liever on January 23, 2014, 10:30:07 AM
it should work with x/y Anchors eg.
xAnchor="#Picture.Center"
and you can then tweak the position by then using an x value

xAnchor="Panel.Center" x="-20"

Thank you, I will check this out to make sure, but I think that will only align the top LH corner to the center.

No go. Can't align the centers of two items when the top one changes size.
As redwing says
embedded TM allows keeping original ratio with the following code where height is not precisely defined.

Code
<element type="AlbumCover" xAnchor="Panel.Center" x="0" yAnchor="Panel.Center" y="0" align="Center" widthDock="X:Panel.60" width="0" heightDock="Panel" height="0" ></element>

If that supports full-screen TM too, the problem can be resolved.

If the default "keep" attribute for AlbumCover worked the same in standard TM as it does in embedded TM, then I could use what I have in "Tabulous." It has a scaling size AlbumCover that stays centered in a changing size panel.
Title: Re: center of panel
Post by: Steven on February 02, 2014, 10:01:36 AM
align already supports
XXX.Left
XXX.Center
XXX.Right

where XXX is
Top
Middle
Bottom


Title: Re: center of panel
Post by: Bee-liever on February 04, 2014, 05:45:44 AM
align already supports
XXX.Left
XXX.Center
XXX.Right

where XXX is
Top
Middle
Bottom

using version:2.3.5146 and Top./Bottom. & .Left/.Right work. 
Middle. or .Center don't have any effect and default aligning is used.

Code
<element type="AlbumCover" name="#Cover" xAnchor="Panel.Center" x="0" align="Top.Center" yAnchor="Panel.Center" y="0" width="300" height="300" min="100" max="500" brightness="1.0" ></element>
does not align the center of the top edge of "AlbumCover" to the center of the panel.  It's ignored and the default (Top.Left) aligning is used.

Getting this working as you say it should will be great, 'cause I can then use align="Middle.Center" to have the album cover stay in the center of the panel. Yippee!
Title: Re: center of panel
Post by: Steven on February 04, 2014, 09:27:46 PM
those Middle & Center values werent actually implemented - they are done for the next theatermode.dll release but that might be a few days away
Title: Re: center of panel
Post by: Bee-liever on February 05, 2014, 04:26:03 AM
No problems, Steven.  There's no hurry  - I've still got plenty to do with integrating the new skin elements  :)
Title: Re: center of panel
Post by: Bee-liever on February 22, 2014, 06:32:25 AM
... Middle & Center values ...... done for the next theatermode.dll ...

forgot to report back that these elements are working fine in 'Touch Style - Album'
thank you Steven