Author Topic: Dynamic block sizing  (Read 2632 times)

UkokA

  • Newbie
  • *
  • Posts: 6
Is there any way to dynamically resize a block based on text width, for example a song title or band name?

I tried using widthdock="x:Tracks[1]" but that doesn't seem to work perhaps because there's no predeined width for the block?

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1736
  • Heal The World
Is there any way to dynamically resize a block based on text width, for example a song title or band name?
No, not really. Not unless you had to constrain the width of that text field. i.e setting it to a fixed width which the block can then reference.
I think this goes for all elements - If you haven't explicitly specified their width, then MusicBee cannot use them as a base to dynamically set the widths of anchored elements.
I hope I've understood what you meant.

By the way, please refrain from double-posting:
https://getmusicbee.com/forum/index.php?topic=39786.msg215055#msg215055

It's difficult for somebody else to pick up on a conversation if it's scattered all over the forum.
I've replied to this topic and not the other one in the questions board, since our aim is to keep TM-related discussions grouped together over here.
Strength and Honour (2025)

Bee-liever

  • Member
  • Hero Member
  • *****
  • Posts: 3878
  • MB Version: 3.6.9304P
Is there any way to dynamically resize a block based on text width, for example a song title or band name?

I tried using widthdock="x:Tracks[1]" but that doesn't seem to work perhaps because there's no predeined width for the block?
You can't dynamically resize the block, but you can dynamically resize the text to the block.
Code
<element type="Field" name="NowPlayAr" gammaCorrected="true" xAnchor="#postoverlay.Left" x="3" yAnchor="#postoverlay.12" y="0" xwidthDock="x:#postoverlay.Right" xwidth="-3" widthDock="x:#postoverlay.Right" width="-3" heightDock="Panel.Height.13" height="0" multiLine="true" font="Segoe Black" style="Regular" align="Center" size="72" minSize="20" fg="240,0,0,0" >
    <child id="Artist" ></child>
  </element>
The "size=" sets the maximum allowable font size for the block.
MB will use the smallest font found above the "minSize" that will allow all the text to be displayed in the block.
.
MusicBee and my library - Making bee-utiful music together