It is currently July 27th, 2024, 8:37 am

Aligning a bar meter with text, changing config on click.

Get help with creating, editing & fixing problems with skins
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Aligning a bar meter with text, changing config on click.

Post by WhiteBaron »

I'm in the process of making a small music skin for my suite based on the Led 7 Windows theme. Anyhow, I wanted to make the progress bar shrink and stretch from the blue dot so that it always stops just before the title of the song starts. At the moment it just sits behind it. Not sure if this is at all possible, but I sure hope someone has ideas on this.

I'm also having trouble with the following meter: Found the problem, there was a space in one of the folder names, which messes up #CURRENTCONFIG#

Code: Select all

[MeterPlayPause]
Meter=Image
ImageName=BlueDot.png
X=10
Y=11
LeftMouseDownAction=!Execute [!RainmeterShowMeter MeterPush]
RightMouseDownAction=!Execute [!RainmeterActivateConfig #CURRENTCONFIG# MusicBarMini.ini]
AntiAlias=1
It is supposed to change the config when I right click the blue button, but nothing happens.
You do not have the required permissions to view the files attached to this post.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Aligning a bar meter with text, changing config on click.

Post by Chewtoy »

Well. You could have the bar in a relative position to the track name so it always stops before it.
The bar will however have a specified length, so if the name is a long one, the further out the bar will be.
So, what I'm thinking is something like this:

Code: Select all

[Track]
Meter=String
MeasureName=
X=400
Y=2
Font..
font..
font..
StringAlign=Left

[PrograssBar]
Meter=Bar
MeasureName=
X=-50r
Y=
W=50
H=1
SolidColor=
BarColor=
BarOrientation=Horizontal

[Pausebutton]
Meter=Image
X=-10r
Y=
yadda
yadda
yadda

Get the general idea?
You work your way from the track to the right.
You can put StringAlign=Right on the track-string as well if you like. If you do, it won't go off screen when it gets to big.
And you have to place it like, X=400, for everything that passes x=0 gets cut off.
I don't think, therefore I'm not.
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Aligning a bar meter with text, changing config on click.

Post by WhiteBaron »

Yep I already have the text aligned to the right, so when the song changes it still aligns to the end of the background. So what I wanted was for the bar to stretch back and forth with the left side of the text as the song changes. I think this would require Rainmeter to be able to measure the length of the characters or something along those lines, so I'm pretty sure it's impossible! Thanks for your help though!
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Aligning a bar meter with text, changing config on click.

Post by Chewtoy »

WhiteBaron wrote:Yep I already have the text aligned to the right, so when the song changes it still aligns to the end of the background. So what I wanted was for the bar to stretch back and forth with the left side of the text as the song changes. I think this would require Rainmeter to be able to measure the length of the characters or something along those lines, so I'm pretty sure it's impossible! Thanks for your help though!

I'm pretty sure you didn't read the rest of the post.
If you set the bar relative to the left side of the string measure, you'r bar won't interfer.

[Track]
Meter=String
MeasureName=
X=400
Y=2

[PrograssBar]
Meter=Bar
MeasureName=
X=-#BarLength#r
Y=
W=#BarLength#
H=1

With that, the bar will be relative to the first letter of the string. And it won't touch the text unless you have a lower value on the X (for the bar) then the length is.
I don't think, therefore I'm not.
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Aligning a bar meter with text, changing config on click.

Post by dragonmage »

White Baron is correct. The "r" relative positioning does not work when using a right-alignment on the previous. It will be relative to the X pos of the previous meter which in right-aligned text would be the end of the string. MattKing said he has some ideas about making this work, but I don't know if he has had time to test it yet.

You can try a workaround. Left align the text and use X=R positioning on it with the bar preceding the string meter. Then you will have to set the positioning of the skin on the desktop in Rainmeter.ini. Add AnchorX=100% to the config's section in rainmeter.ini. This should work I think, but I haven't tested it.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Aligning a bar meter with text, changing config on click.

Post by Chewtoy »

Huh... So it seems. Never run in to that before. Thought it would be the same as it is with StringAling=Left. But apparently not. Annoying.
I don't think, therefore I'm not.