sl23 wrote: ↑August 8th, 2019, 8:28 amI thought you had to use the Set Variable bang to use variables! So thanks for explaining
To make things clear: in general, the
!SetVariable bang is indeed used to modify the value of variables, just like the
!SetOption bang is used to modify options. So, from this point of view, you weren't mistaken - it was just a matter of confusing the former's
syntax with the latter's in your original code.
In practice, you can use either of these two methods (or even a mixture of them) to do your thing - for example, jsmorley and balala used
!SetOption bangs to make it happen, but you can easily use
!SetVariable bangs if you like (the code below is based on balala's reply):
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
StrokeAlpha=255
StrokeWidth=8
[sHighlight]
MouseOverAction=[!SetVariable StrokeAlpha 0][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetVariable StrokeAlpha 255][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
[MeterShape1]
Meter=Shape
MeterStyle=sHighlight
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,#StrokeAlpha#
DynamicVariables=1
UpdateDivider=-1
[MeterShape2]
Meter=Shape
MeterStyle=sHighlight
Y=10R
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,#StrokeAlpha#
DynamicVariables=1
UpdateDivider=-1
Obviously, dynamic variables are required, and setting the update divider to
-1 in order to update the relevant meters only when needed is a good idea.
Whether you prefer one method over the other, that's entirely up to you. I just wanted to point out that you can do it using
!SetVariable bangs as well, in case you had the wrong impression on this...
EDIT: You can control the stroke width as well, by replacing, say,
[!SetVariable StrokeAlpha 0] with
[!SetVariable StrokeWidth 8] and
[!SetVariable StrokeAlpha 255] with
[!SetVariable StrokeWidth 1] in the above code (it makes more sense to me to make the highlighted/hovered frame thicker, instead of the opposite, by the way).