Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1486

Help: Rainmeter Skins • Re: Calculating the text width

$
0
0
There really is no way to alter the size of a running skin, other than 1) Writing to the skin .ini file to alter [Rainmeter] / SkinWidth and fully refreshing the skin, or 2) Using DynamicWindowSize and the size of one or more meters to set the overall size of the skin. With DynamicWindowSize, the skin will shrink and grow as needed to contain all the meters in it.
This is exactly what I thought a while ago, but later I figured out something which makes not too much sense in my opinion and can't find an explanation. Maybe you can figure out what is going on.
Here is a short sample code:

Code:

[Rainmeter]Update=1000;DynamicWindowSize=0SkinWidth=86SkinHeight=[#Height1][Variables]Height1=0[MeasureCalc]Measure=CalcFormula=RandomLowBound=1HighBound=5UpdateRandom=1IfCondition=(MeasureCalc=1)IfTrueAction=[!SetVariable Height1 "200"][!UpdateMeter "MeterBackground"][!Redraw]IfCondition2=(MeasureCalc=2)IfTrueAction2=[!SetVariable Height1 "208"][!UpdateMeter "MeterBackground"][!Redraw]IfCondition3=(MeasureCalc=3)IfTrueAction3=[!SetVariable Height1 "216"][!UpdateMeter "MeterBackground"][!Redraw]IfCondition4=(MeasureCalc=4)IfTrueAction4=[!SetVariable Height1 "224"][!UpdateMeter "MeterBackground"][!Redraw]IfCondition5=(MeasureCalc=5)IfTrueAction5=[!SetVariable Height1 "232"][!UpdateMeter "MeterBackground"][!Redraw]UpdateDivider=-1[MeterBackground]Meter=ShapeX=1Y=1Shape=Rectangle 0,0,50,(18+6*[MeasureCalc]),4 | Extend MyModifiersMyModifiers=Fill Color 0,0,0,150 | StrokeWidth 2 | Stroke Color 255,0,240,220DynamicVariables=1LeftMouseUpAction=[!UpdateMeasure "MeasureCalc"][!UpdateMeter "MeterVal"][!Redraw][MeterVal]Meter=STRINGMeasureName=MeasureCalcX=0rY=10RPadding=15,5,15,5FontColor=220,220,220FontEffectColor=0,0,0StringEffect=ShadowSolidColor=0,0,0,150FontSize=8FontFace=Segoe UIStringStyle=BOLDStringAlign=LEFTAntiAlias=1Text=%1 / #Height1##CRLF#Height: #CURRENTCONFIGHEIGHT#DynamicVariables=1LeftMouseUpAction=[!UpdateMeasure "MeasureCalc"][!UpdateMeter "MeterVal"][!Redraw]
The code has a Shape ([MeterBackground]) and a String ([MeterVal]), meter, the last one used to follow how variables are changing. The skin has defined a width (SkinWidth option of the [Rainmeter] section) and a height (SkinHeight=[#Height1]). The skin applies perfectly the SkinWidth, however its hight has nothing to do with the [#Height1] variable, which is changing dynamically. This is perfectly right, it shouldn't even have to have, the [Rainmeter] section not being dynamic. But although the skin doesn't have a dynamic size set (no DynamicWindowSize=1 option), its height is varying. To can follow this you can click to any meter (the Shape or the String meter), which updates the [MeasureCalc] measure, sets a new value for the Height1 variable. This leads to resize the Shape, to move the String AND to alter the height of the skin (the height can be seen on the second line of the String meter, but if you CTRL - ALT - click the skin after each click, you can see it's changing height). As said, the height of the skin has nothing to do with the set height (with the [#Height1] variable), however it is changing on each click. Same goes on if I remove / comment out either of the SkinWidth or SkinHeight option, or even both.
My question is why is varying the height of the skin, if its size is not set to be dynamic (the default value of the DynamicWindowSize option is 0 and I even tried to explicitly add the DynamicWindowSize=0 option - see it commented out)? I understand why the SkinHeight is not applied, however if I set it for instance to Height1=0 in the [Variables] section (as it is in the posted code), the skin should have to be not visible, having a height of 0 - it's not the case.

Statistics: Posted by balala — Yesterday, 8:47 pm



Viewing all articles
Browse latest Browse all 1486

Trending Articles