It is currently March 29th, 2024, 3:27 pm

Desire to Hide Group After a Certain Amount of Time

Get help with creating, editing & fixing problems with skins
Deximus
Posts: 2
Joined: May 24th, 2018, 6:44 am

Desire to Hide Group After a Certain Amount of Time

Post by Deximus »

I wish to have a group appear when I click on a button, then have it automatically hide after 5 seconds. Ultimately, I'm trying to create a set of launcher icons in a "folder" that is displayed with a click and that is hidden automatically after a certain time. Currently, the group hides about half a second after I show it. The skin with the button is set to update every 5 seconds. Increasing this does not have any effect.

Button:

Code: Select all

[MeterLaunch]
;UpdateDivider=1
Meter=String
X=0r
Y=2R
FontFace=Trebuchet MS
FontSize=14
FontColor=255,255,255,255
StringStyle=Bold
SolidColor=0,0,0,1
AntiAlias=1
Text=Paint
LeftMouseUpAction=[!ToggleGroup "PCControl"]
Group:

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
OnRefreshAction=[!HideGroup "PCControl"]
OnUpdateAction=[!HideFadeGroup "PCControl"]
DefaultUpdateDivider=1
Group=PCControl
DragGroup=PCControl

[Metadata]
Name=DexSkin
Author=Dex
Information=
Version=1.0.0
License=WTFPL

[Variables]
@Include=#@#Styles.inc

[MeterString]
Meter=String
MeterStyle=TextStyle
Text=Hello
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Desire to Hide Group After a Certain Amount of Time

Post by eclectic-tech »

Create a timer calc measure that counts to 5, hides the group, and disables itself.
When you click the meter, show the group and enable the timer calc measure.
The skin with the calc measure must have the default update of 1000 ms in order to work for 5 seconds.

Code: Select all

; Measure to display a group of meters for about 5 seconds if skin update is 1000ms
[mTimer5]
Measure=Calc
Formula=(mTimer5%5)+1
IfCondition=(mTimer5=5)
IfTrueAction=[!HideGroup PCControl][!DisableMeasure mTimer5]
IfConditionMode=1
Disabled=1

; In the meter...
[Dummy]
Meter=String
Text=Click
SolidColor=0,0,0,1
LeftMouseUpAction=[!EnableMeasure mTimer5][!ShowGroup PCControl]
EDIT: Modified to show/hide SKIN groups as requested (not meter groups, although it can do either :p ) Forgot about the !Delay bang used below; either method will work.
Last edited by eclectic-tech on May 26th, 2018, 4:21 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Desire to Hide Group After a Certain Amount of Time

Post by balala »

eclectic-tech wrote:Create a timer calc measure that counts to 5, hides the group, and disables itself.
When you click the meter, show the group and enable the timer calc measure.
I think the [mTimer5] measure isn't needed any more, since we have the !Delay bang. I'd replace the LeftMouseUpAction option of the [MeterLaunch] meter (because Deximus in his request had a so called meter, not one named [Dummy]), with this: LeftMouseUpAction=[!ShowGroup "PCControl"][!Delay "5000"][!HideGroup "PCControl"]. The !Delay bang adds a 5 seconds (or 5000 milliseconds) delay between the !ShowGroup and the !HideGroup bangs. I think this is a much simpler solution.
And eclectic-tech, PCControl is a group of skins, not a group of meters. That's why !ShowGroup and !HideGroup bangs are used, not !ShowMeterGroup and !HideMeterGroup.

Deximus, my solution probably will also require to remove the OnUpdateAction option of the [Rainmeter] section of your code.
Deximus
Posts: 2
Joined: May 24th, 2018, 6:44 am

Re: Desire to Hide Group After a Certain Amount of Time

Post by Deximus »

balala wrote:I think the [mTimer5] measure isn't needed any more, since we have the !Delay bang. I'd replace the LeftMouseUpAction option of the [MeterLaunch] meter (because Deximus in his request had a so called meter, not one named [Dummy]), with this: LeftMouseUpAction=[!ShowGroup "PCControl"][!Delay "5000"][!HideGroup "PCControl"]. The !Delay bang adds a 5 seconds (or 5000 milliseconds) delay between the !ShowGroup and the !HideGroup bangs. I think this is a much simpler solution.
And eclectic-tech, PCControl is a group of skins, not a group of meters. That's why !ShowGroup and !HideGroup bangs are used, not !ShowMeterGroup and !HideMeterGroup.

Deximus, my solution probably will also require to remove the OnUpdateAction option of the [Rainmeter] section of your code.
Thank yo very much! This worked perfectly!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Desire to Hide Group After a Certain Amount of Time

Post by balala »

Deximus wrote:Thank yo very much! This worked perfectly!
I'm glad.
eclectic-tech's solution is good as well, just a bit more complicated, probably.