Author Topic: Allow hiding of LastFm button for bitmapped skins  (Read 7703 times)

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
For non-bitmapped skins, the user can remove the lastfm button from the player panel, but for bitmapped skins that is not possible.

So the request is to enable that for those too.
(probably needs adding of a replacementElement for LastFmButton)

(I could swear this was requested before, but I can't find a previous post about it)

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3837
  • MB Version: 3.6.8878 P
+1

(probably needs adding of a replacementElement for LastFmButton)
Hopefully that doesn't mean to much re-writing of SkinCreator.exe
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
It was requested previously and i did look at it. To make it disappear completely by internally setting its width behind the scenes didnt work well for all the bitmap skins i tested ie. there was still a gap where the button was because the skins were positioning the other buttons relative to the right or left panel edge.
If you are prepared to redesign your skins or create a new one that works where MB simply hides the button and sets its width to zero then i can create a skin setting for that.
Let me know if its not clear what i am saying

hiccup

  • Sr. Member
  • ****
  • Posts: 7884

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
https://getmusicbee.com/patches/MusicBee34_Patched.zip

to indicate hiding the scrobble button is supported by a skin:
<HideScrobbleButtonSupported>true</HideScrobbleButtonSupported>

when the user sets the scrobble button to be hidden, MB moves the button vertically off the panel and its width to 0
the effect for most existing bitmap skins is to leave a gap between buttons where the scrobble button was, but if you make each button relative to the other then the layout should adapt

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3837
  • MB Version: 3.6.8878 P
That appears to have to be
<element id="HideScrobbleButtonSupported">true</element>
for the option to appear.

But couldn't get it to work on B78 even though buttons positions are dependant.

Code
<element id="RepeatButton" parent="Panel">
    <left relativeTo="ShuffleButton.Left" offset="-31" />
    <top relativeTo="Panel.VerticalCenter" offset="0" />
    <images category="Off"
      default="Images34\pb_repeatoff.png"
      highlight="Images34\pb_repeatoff_hi.png"
  />
    <images category="On"
      default="Images34\pb_repeaton.png"
      highlight="Images34\pb_repeaton_hi.png"
  />
    <images category="One"
      default="Images\button_repeatone_opt.svg"
      highlight="Images\button_repeatone_hi_opt.svg"
  />
  </element>

  <element id="ShuffleButton" parent="Panel">
    <left relativeTo="LastFmButton.Left" offset="-31" />
    <top relativeTo="Panel.VerticalCenter" offset="0" />
    <images category="Off"
      default="Images\button_shuffle_alt_off.svg"
      highlight="Images\button_shuffle_alt_off_hi.svg"
  />
    <images category="On"
      default="Images\button_shuffle_alt_on.svg"
      highlight="Images\button_shuffle_alt_on_hi.svg"
  />
    <images category="AutoDJ"
      default="Images\button_shuffleDJ_adj_opt.svg"
      highlight="Images\button_shuffleDJ_adj_hi_opt.svg"
  />
  </element>

  <element id="LastFmButton" parent="Panel">
    <left relativeTo="EqualiserButton.Left" offset="-31" />
    <top relativeTo="Panel.VerticalCenter" offset="0" />
    <images category="Off"
      default="Images\button_lastFMoff_opt.svg"
      highlight="Images\button_lastFMoff_opt.svg"
  />
    <images category="On"
      default="Images\button_lastFMon_opt.svg"
      highlight="Images\button_lastFMon_hi_opt.svg"
  />
    <images category="Error"
      default="Images\button_lastFMerror_opt.svg"
      highlight="Images\button_lastFMerror_hi_opt.svg"
  />
  </element>

  <element id="EqualiserButton" parent="Panel">
    <left relativeTo="Spectrum.Left" offset="-61" />
    <top relativeTo="Panel.VerticalCenter" offset="0" />
    <images category="Off"
      default="Images\button_equalizer_alt_off.svg"
      highlight="Images\button_equalizer_alt_off_hi.svg"
  />
    <images category="On"
      default="Images\button_equalizer_alt_on.svg"
      highlight="Images\button_equalizer_alt_on_hi.svg"
  />
  </element>

  <element id="Spectrum" parent="Panel">
    <left relativeTo="Panel.Right" offset="-42" />
    <top relativeTo="EqualiserButton.Top" offset="-4" />
    <!-- for now the spectrum area needs to be 32px wide -->
    <right relativeTo="Panel.Right" offset="-10" />
    <bottom relativeTo="EqualiserButton.Bottom" offset="4" />
  </element>
MusicBee and my library - Making bee-utiful music together

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
Thanks, a quick test shows it works very well.

Would you consider adding a replacementElement id for it too?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
But couldn't get it to work on B78 even though buttons positions are dependant.
you need to make the equaliser button a left offset of the player panel and then make the other buttons a right offset of the button to the left. Then because the last.fm button width will be 0, it should work.
As it stands, setting the last.fm button width to 0 in the B78 skin has no effect on the layout as each button is to the configured to left of the following button.

If its too much of an issue for your skins, i could add another setting where you say how much px to move the last.fm button to the right when its hidden

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3837
  • MB Version: 3.6.8878 P
OK.  Shall give re-working a go.
Will get back if it's a problem.
Thank you.
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
i will add an offset setting. that should make it very easy

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
https://getmusicbee.com/patches/MusicBee34_Patched.zip

updated with
<element id="HideScrobbleButtonOffset">999</element>

which is the number of pixels that the position of last.fm button is offset so other buttons relative to it are also adjusted.
For the B78 skin, you would set it to 0 ie. so its no longer offset by -31

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3837
  • MB Version: 3.6.8878 P
Thanks for the offset setting.
Even with changing to .Right arrangement I needed one.
Turns out here is actually a 1px spacing between the button elements in B78.
MusicBee and my library - Making bee-utiful music together

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
Thanks for the option to make it invisible.

I still think it would be an improvement if instead of (or in addition to) this 'HideScrobbleButtonOffset, it had a replacement element id for the skin.xml so that you could gain the lost space of the button and reposition dependent buttons.

Same as:
<replacementElement id="Spectrum"
<replacementElement id="TrackRating"
<replacementElement id="TrackLove"

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
i appreciate it would be more consistent to do that but its difficult to implement and i want to avoid making that sort of change if i can

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
Thanks for considering anyway. It would only be 'nice to have', but certainly not essential.