Author Topic: Element for the Player Control time?  (Read 2469 times)

krissasaur

  • Jr. Member
  • **
  • Posts: 77
I would like to center this vertically if at all possible when using the 2 columns. Looking through the code and the forum and I couldn't fine one.



Anyone know if it's possible?

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Try the id TrackPosition.
Favourite song at the moment:   Decode by Paramore

krissasaur

  • Jr. Member
  • **
  • Posts: 77
Try the id TrackPosition.

Do you know what the code for it would be? I tried a bunch of things but my skin wont load so I think I am off base haha.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Sorry for the incomplete reply.
In the skin.xml file, search for the element already mentioned and you should come across something like:

Code
<element id="TrackPosition" parent="Panel" fontSize="9.00">
<left relativeTo="..." offset="0"/>
<right relativeTo="..." offset="0"/>
<top relativeTo="Panel.VerticalCenter" offset="-2"/>
<bottom relativeTo="Panel.VerticalCenter" offset="15"/>
</element>
To center the element vertically, make your top and bottom margins relative to Panel.VerticalCenter.
You may have to adjust the offset values a bit to get the element properly centered.
Favourite song at the moment:   Decode by Paramore

krissasaur

  • Jr. Member
  • **
  • Posts: 77
Sorry for the incomplete reply.
In the skin.xml file, search for the element already mentioned and you should come across something like:

Code
<element id="TrackPosition" parent="Panel" fontSize="9.00">
<left relativeTo="..." offset="0"/>
<right relativeTo="..." offset="0"/>
<top relativeTo="Panel.VerticalCenter" offset="-2"/>
<bottom relativeTo="Panel.VerticalCenter" offset="15"/>
</element>
To center the element vertically, make your top and bottom margins relative to Panel.VerticalCenter.
You may have to adjust the offset values a bit to get the element properly centered.
Sorry I have been busy lately. Thank you for the help!

The skin I have been editing doesn't have that, and when I add that in it doesn't seem to do anything.

I made a pastebin of the file I am editing here if you wanna look: https://pastebin.com/raw/e8f4L3hn

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Thanks for linking that file. Through it, I just realized that my initial suggestion is irrelevant here, as the skin you're dealing with is a standard skin.
Everything to do with the positioning and alignment of elements in a standard skin is hard coded into MusicBee.

@Steven, if you are following this:

Can I ask what the TrackPosition's top and bottom anchors are relative to? (when the progress bar is positioned at the top or bottom)

[removed. I was mistaken on something]
Last Edit: August 27, 2022, 09:15:11 PM by Mayibongwe
Favourite song at the moment:   Decode by Paramore

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Can I ask what the TrackPosition's top and bottom anchors are relative to? (when the progress bar is positioned at the top or bottom)
The reason I ask is because the top and bottom margins of this element appear to be anchored to Panel.Top and Panel.Bottom, respectively.
And that's doing the right thing - the vertical alignment adjusts accordingly with respect to whatever font size is being used.

But when 'show track details on multiple lines' is enabled and the font size is anything but the default, the vertical alignment gets messed up.
So I'm assuming that this element's top and bottom margins are no longer anchored to the Panel height when this setting is enabled.

Could that be an oversight or there's a reason behind the apparent difference in anchoring?
Favourite song at the moment:   Decode by Paramore