Author Topic: center of panel  (Read 12141 times)

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
Is there a setting to keep the center of an item, e.g. Album Cover, aligned to center of the panel in standard TM
MusicBee and my library - Making bee-utiful music together

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
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?

MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
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"

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
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.
MusicBee and my library - Making bee-utiful music together

redwing

  • Guest
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.

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
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.
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
align already supports
XXX.Left
XXX.Center
XXX.Right

where XXX is
Top
Middle
Bottom



Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
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!
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
those Middle & Center values werent actually implemented - they are done for the next theatermode.dll release but that might be a few days away

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
No problems, Steven.  There's no hurry  - I've still got plenty to do with integrating the new skin elements  :)
MusicBee and my library - Making bee-utiful music together

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3831
  • MB Version: 3.6.8849 P
... 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
MusicBee and my library - Making bee-utiful music together