admuralchik wrote: ↑April 26th, 2022, 1:45 pm
Maybe the full code from the main.ini would be more useful...
No, actually the posted code is not the full code and is useless in our case, because it has a lot of @Include options, which are linked to a lot of unknown files. But it's not even needed...
admuralchik wrote: ↑April 26th, 2022, 1:09 pm
I wanted to modify a skin in Rainmeter, so when I click the middle mouse button it would set the transparency to 255 and when I click again, it would set it back to 1. I did the first part: the skin stays on the screen after I click the mouse wheel. I don't know what command should I use to set it back to 1 after I click it again.
Here is a solution, which I hope does what you want. Same way as in the posted codes, this uses a variable called Alpha, which sets the transparency of the skin, but there is a trick. The value of this variable varies between 0 (when the transparency is 1, so practically the skin is not visible) and 1 (when the skin is opaque). So for first add this variable to the [Variables] section:
Note that the skin starts with a transparency according to the set value of this variable. If you set it to 1 (as above), the skin is visible when is loaded / refreshed. With
Alpha=0, the skin is not visible, being almost transparent.
Now add the following measure to your code:
Code: Select all
[MeasureTransparency]
Measure=Calc
Formula=#Alpha#
OnChangeAction=[!SetTransparency "(1+254*#Alpha#)"]
DynamicVariables=1
And finally use the following MiddleMouseDownAction (or usually even better MiddleMouseUpAction) in the [Rainmeter] section of your skin:
MiddleMouseDownAction=[!SetVariable Alpha "(1-[#Alpha])"][!UpdateMeasure "MeasureTransparency"]. As you can see here when you middle click the skin, the value of the Alpha variable is switched between 0 and 1, which changes the value of the [MeasureTransparency] measure. The OnChangeAction option of this measure sets the transparency of the skin accordingly.
Does this what you want?