CodeCode wrote: ↑July 25th, 2021, 11:52 am
Hello, on this topic, there is a lot of documentation in the manual.
However, there is something I would like to implement, but I am not sure if it is possible or not. Is this form or similar possible to work, or not?
Code: Select all
[MeasureTri]
Measure=Calc
IfCondition=(aState = 0)
IfTrueAction=[!HideMeter "MeterText"][!Update]
IfCondition2=(aState = 1)
IfTrueAction2=[!ShowMeter "MeterText"][!Update]
IfConditionMode=1
Then this...?
Code: Select all
...
MouseOverAction=[!ToggleMeasure "MeasureTri"][!Update]
I m trying this to test a variable state of aState to show or hide a text meter, on mouseover or mouseleave.
I am thinking there are a few possibilities: !UpdateMeasure / !CommandMeasure / !ToggleMeasure.
But am I doing it wrong in every way possible, as in this concept is not possible? Or just wrong and such and such will do the job here?
I'm not sure I follow the logic. If you "hide" a meter on MouseOverAction, that has two consequences. First, it is now hidden, and will never respond to a MouseOverAction again while it is hidden. Second, if you try to remedy that by having a MouseLeaveAction that "unhides" it, that action will instantly be triggered when the meter is hidden, as hiding the meter means the mouse is no longer "on" it, and the MouseLeaveAction just fires.
I think you need a different logic to come at this.
You can use this to test all the undesirable behaviors:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
aState=1
[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!HideMeter "MeterText"][!UpdateMeter *][!Redraw]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!ShowMeter "MeterText"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1
[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
DynamicVariables=1
MouseOverAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]
MouseLeaveAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]
Basically, you don't want the trigger to toggle the visibility of a meter to be on the meter itself. You need the trigger to be somewhere else. Either that, or don't "hide" the meter, but set its opacity to "1", which means it will be "invisible" for all practical purposes, but will still react to the mouse.