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

Help: Rainmeter Skins • Re: Skin menu Toggle based on variable conditions

$
0
0
My skins basically open down into a menu when you click on them. They are horizontally on the screen so it would be like this:
Apart from the later posts, this is how I'd do this:
  • Declare the SecurityState, GameSate (and so on, if needed) variables into the [Variables] section, as you did.
  • Into the LeftMouseUpAction options of all those meters, use some simple bangs, like this for instance:

    Code:

    [Security]...LeftMouseUpAction=[!SetVariable SecurityState "(1-#SecurityState#)"][!SetVariable GamesState "0"][!UpdateMeasureGroup "State"][!UpdateMeter "Security"]DynamicVariables=1[Games]...LeftMouseUpAction=[!SetVariable SecurityState "0"][!SetVariable GamesState "(1-#GamesState#)"][!UpdateMeasureGroup "State"][!UpdateMeter "Games"]DynamicVariables=1
    Make sure not to forget adding the DynamicVariables options, they are needed in order to get everything working.
    Here, whenever are you clicking to any of the [Security] or [Games] meter, you get the variables set properly and the appropriate meters shown / hidden.
  • As you can see, I updated above some so-far not existing measures (the ones belonging to the State measure group). Add them. They will control what from the sub-menus is visible:

    Code:

    [MeasureSecurity]Measure=CalcFormula=#SecurityState#IfCondition=(#CURRENTSECTION#>=1)IfTrueAction=[!ShowMeterGroup "Security"][!HideMeterGroup "Games"][!Redraw]IfFalseAction=[!HideMeterGroup "Security"][!HideMeterGroup "Games"][!Redraw]DynamicVariables=1Group=State[MeasureGames]Measure=CalcFormula=#GamesState#IfCondition=(#CURRENTSECTION#>=1)IfTrueAction=[!HideMeterGroup "Security"][!ShowMeterGroup "Games"][!Redraw]IfFalseAction=[!HideMeterGroup "Security"][!HideMeterGroup "Games"][!Redraw]DynamicVariables=1Group=State
  • Two additional advantages of this procedure:
    • If you want, it's easy to add an option to hide all menus whenever are you unfocusing the skin. For this you only have to add the following LeftMouseUpAction option to the [Rainmeter] section: OnUnfocusAction=[!SetVariable SecurityState "0"][!SetVariable GamesState "0"][!UpdateMeasureGroup "State"].
    • Same way, by this, you can easily hide the menus when you click to any element of a menu (for instance to the [Antivirus], [Defender] or [Defrag] meters). For this just add the [!SetVariable SecurityState "0"][!SetVariable GamesState "0"][!UpdateMeasureGroup "State"] bangs to the LeftMouseUpAction options of all those meters (besides the existing bangs).
I think this is the simplest ever solution to achieve this. Using the !ToggleMeter / !ToggleMeterGroup bangs can cause lot of troubles over time, in my opinion.

Statistics: Posted by balala — Today, 11:41 am



Viewing all articles
Browse latest Browse all 1134

Trending Articles