It is currently September 29th, 2024, 11:22 am

Toggle Meter?

Get help with creating, editing & fixing problems with skins
pulinshah07
Posts: 43
Joined: March 2nd, 2016, 5:57 am

Toggle Meter?

Post by pulinshah07 »

After using Hidden=1
How do I make sure that when the cursor hovers on the meter, then the meter gets visibility and rest of the time hidden?
User avatar
balala
Rainmeter Sage
Posts: 16602
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Toggle Meter?

Post by balala »

You can't do this in this way, because if you hide a meter, it can't recognize when are you hovering the mouse over it (in fact when the meter is hidden, its size is 0). But you can make the meter almost transparent and when you're hovering the mouse over it, make it opaque, then transparent again. For example:

Code: Select all

[MeterTryout]
Meter=Image
SolidColor=0,0,0,1
X=0
Y=0
W=150
H=100
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "0,0,0,255"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor "0,0,0,1"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Initialy the color of the meter is set to 0,0,0,1. The last number represents the transparency, it 's a value between 0 and 255, where 0 is totaly transparent and 255 is totaly opaque. At the first moment you have a transparency set to 1 (from 255), which is practicaly invisible, but when you're hovering the mouse over it, its color will be set to 0,0,0,255 (opaque), according to the value set with the !SetOption bang. When you're leaving the meter, its color will be set back to 0,0,0,1, becoming again (almost) transparent.
In the same way you can set the color of a string meter, if you need. Just set the FontColor of the string meter, instead of SolidColor (and here usualy is a good idea to add a SolidColor=0,0,0,1 to the string meter, otherwise it'll set the color of the fonts just when you're hovering the mouse over the lines of the letters).
pulinshah07
Posts: 43
Joined: March 2nd, 2016, 5:57 am

Re: Toggle Meter?

Post by pulinshah07 »

Works perfectly and made it in a easier way for me! Thanks... :bow: :bow: :thumbup: :thumbup: :great: :great:
User avatar
balala
Rainmeter Sage
Posts: 16602
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Toggle Meter?

Post by balala »

You're welcome.