It is currently April 20th, 2024, 2:56 pm

Solved: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Get help with creating, editing & fixing problems with skins
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Solved: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

Hallo everyone, I am working on a suite of skins and now I am facing some problems.
Image
This is the first time I've post a topic, so if the img can be seen, excuse me, please.

As can be seen in the img, I am working on a function that the DOCK can be disappeared when mouse is not focused on the skin automatically. But now when I click the skin to open the programs, DOCKs disappeared, except the icon img.

Here's my code.
(the variables is originally set in a file and included in the skin, but I just write them in for the convenience of readers.)

Code: Select all

[Rainmeter]
Update=5000
AccurateText=1
OnRefreshAction=[!Draggable 0]
OnUnfocusAction=[!HideMeterGroup Launcher][!SetVariable Action 1][!UpdateMeter BG][!Update]

[Metadata]
Name=SAO Augma
Author=Setsukka
Version=1.0
License=CC BY - NC - SA 4.0
Information=Circle Launcher

[Variables]
AlphaCircle=200
ColorGlow=255,240,50

CircleColor1=250,195,50
CircleIcon1=
CirclePath1=

CircleColor2=240,80,90
CircleIcon2=
CirclePath2=

CircleColor3=200,200,200
CircleIcon3=
CirclePath3=

CircleColor4=20,180,210
CircleIcon4=
CirclePath4=

CircleColor5=20,200,140
CircleIcon5=
CirclePath5=

CircleColor6=190,165,100
CircleIcon6=
CirclePath6=

CircleColor7=120,110,200
CircleIcon7=
CirclePath7=

CircleColor8=10,170,150
CircleIcon8=
CirclePath8=

CircleColor9=130,90,60
CircleIcon9=
CirclePath9=


Wait=20
Action=1
Num=1


[BG]
Meter=Image
W=5
H=#WorkAreaHeight#
SolidColor=#ColorGlow#,200
SolidColor2=#ColorGlow#,0
DynamicVariables=1
UpdateDivider=-1
MouseOverAction=[!CommandMeasure MeasureAction "Execute #Action#"]


;====================================================================

[MeasureAction]
Measure=Plugin
Plugin=Actiontimer
DynamicVariables=1

ActionList1=Start1|Wait #Wait#|Repeat Show, #Wait#, 9|Wait #Wait#|End1
Start1=[!SetVariable Num 1][!UpdateMeasure MeasureAction]
Show=[!ShowMeterGroup #Num#][!SetVariable Num (#Num#+1)][!UpdateMeasure MeasureAction][!Redraw]
End1=[!SetVariable Action 2][!UpdateMeter BG]

ActionList2=Start2|Wait #Wait#|Repeat Hide, #Wait#, 9|Wait #Wait#|End2
Start2=[!SetVariable Num 9][!UpdateMeasure MeasureAction]
Hide=[!HideMeterGroup #Num#][!SetVariable Num (#Num#-1)][!UpdateMeasure MeasureAction][!Redraw]
End2=[!SetVariable Action 1][!UpdateMeter BG]

[BS]
AntiAlias=1
Hidden=1

[IS]
X=-30r
Y=-30r
W=60
ImageAlpha=#AlphaCircle#
AntiAlias=1
Hidden=1

[IS2]
X=-6r
Y=-6r
W=72
Hidden=1
AntiAlias=1
Group=Launcher

;====================================================================


[1]
Meter=Shape
X=150
Y=150
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor1#,#AlphaCircle#
Group=1|Launcher

MouseOverAction=[!SetOption 1 Size "Scale 1.2,1.2"][!SetOption 1 Color "Fill Color #CircleColor1#"][!ShowMeter I1Over][!HideMeter I1][!UpdateMeter 1][!Redraw]
MouseLeaveAction=[!SetOption 1 Size "Scale 1.0,1.0"][!SetOption 1 Color "Fill Color #CircleColor1#,#AlphaCircle#"][!HideMeter I1Over][!ShowMeter I1][!UpdateMeter 1][!Redraw]
LeftMouseUpAction=["#CirclePath1#"]

[I1]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon1#
Group=1|Launcher

[I1Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon1#

[2]
Meter=Shape
X=150
Y=235
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor2#,#AlphaCircle#
Group=2|Launcher

MouseOverAction=[!SetOption 2 Size "Scale 1.2,1.2"][!SetOption 2 Color "Fill Color #CircleColor2#"][!ShowMeter I2Over][!HideMeter I2][!UpdateMeter 2][!Redraw]
MouseLeaveAction=[!SetOption 2 Size "Scale 1.0,1.0"][!SetOption 2 Color "Fill Color #CircleColor2#,#AlphaCircle#"][!HideMeter I2Over][!ShowMeter I2][!UpdateMeter 2][!Redraw]
LeftMouseUpAction=["#CirclePath2#"]

[I2]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon2#
Group=2|Launcher

[I2Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon2#

[3]
Meter=Shape
X=150
Y=320
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor3#,#AlphaCircle#
Group=3|Launcher

MouseOverAction=[!SetOption 3 Size "Scale 1.2,1.2"][!SetOption 3 Color "Fill Color #CircleColor3#"][!ShowMeter I3Over][!HideMeter I3][!UpdateMeter 3][!Redraw]
MouseLeaveAction=[!SetOption 3 Size "Scale 1.0,1.0"][!SetOption 3 Color "Fill Color #CircleColor3#,#AlphaCircle#"][!HideMeter I3Over][!ShowMeter I3][!UpdateMeter 3][!Redraw]
LeftMouseUpAction=["#CirclePath3#"]

[I3]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon3#
Group=3|Launcher

[I3Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon3#

[4]
Meter=Shape
X=150
Y=405
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor4#,#AlphaCircle#
Group=4|Launcher

MouseOverAction=[!SetOption 4 Size "Scale 1.2,1.2"][!SetOption 4 Color "Fill Color #CircleColor4#"][!ShowMeter I4Over][!HideMeter I4][!UpdateMeter 4][!Redraw]
MouseLeaveAction=[!SetOption 4 Size "Scale 1.0,1.0"][!SetOption 4 Color "Fill Color #CircleColor4#,#AlphaCircle#"][!HideMeter I4Over][!ShowMeter I4][!UpdateMeter 4][!Redraw]
LeftMouseUpAction=["#CirclePath4#"]

[I4]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon4#
Group=4|Launcher

[I4Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon4#

[5]
Meter=Shape
X=150
Y=490
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor5#,#AlphaCircle#
Group=5|Launcher

MouseOverAction=[!SetOption 5 Size "Scale 1.2,1.2"][!SetOption 5 Color "Fill Color #CircleColor5#"][!ShowMeter I5Over][!HideMeter I5][!UpdateMeter 5][!Redraw]
MouseLeaveAction=[!SetOption 5 Size "Scale 1.0,1.0"][!SetOption 5 Color "Fill Color #CircleColor5#,#AlphaCircle#"][!HideMeter I5Over][!ShowMeter I5][!UpdateMeter 5][!Redraw]
LeftMouseUpAction=["#CirclePath5#"]

[I5]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon5#
Group=5|Launcher

[I5Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon5#

[6]
Meter=Shape
X=150
Y=575
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor6#,#AlphaCircle#
Group=6|Launcher

MouseOverAction=[!SetOption 6 Size "Scale 1.2,1.2"][!SetOption 6 Color "Fill Color #CircleColor6#"][!ShowMeter I6Over][!HideMeter I6][!UpdateMeter 6][!Redraw]
MouseLeaveAction=[!SetOption 6 Size "Scale 1.0,1.0"][!SetOption 6 Color "Fill Color #CircleColor6#,#AlphaCircle#"][!HideMeter I6Over][!ShowMeter I6][!UpdateMeter 6][!Redraw]
LeftMouseUpAction=["#CirclePath6#"]

[I6]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon6#
Group=6|Launcher

[I6Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon6#

[7]
Meter=Shape
X=150
Y=660
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor7#,#AlphaCircle#
Group=7|Launcher

MouseOverAction=[!SetOption 7 Size "Scale 1.2,1.2"][!SetOption 7 Color "Fill Color #CircleColor7#"][!ShowMeter I7Over][!HideMeter I7][!UpdateMeter 7][!Redraw]
MouseLeaveAction=[!SetOption 7 Size "Scale 1.0,1.0"][!SetOption 7 Color "Fill Color #CircleColor7#,#AlphaCircle#"][!HideMeter I7Over][!ShowMeter I7][!UpdateMeter 7][!Redraw]
LeftMouseUpAction=["#CirclePath7#"]

[I7]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon7#
Group=7|Launcher

[I7Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon7#

[8]
Meter=Shape
X=150
Y=745
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor8#,#AlphaCircle#
Group=8|Launcher

MouseOverAction=[!SetOption 8 Size "Scale 1.2,1.2"][!SetOption 8 Color "Fill Color #CircleColor8#"][!ShowMeter I8Over][!HideMeter I8][!UpdateMeter 8][!Redraw]
MouseLeaveAction=[!SetOption 8 Size "Scale 1.0,1.0"][!SetOption 8 Color "Fill Color #CircleColor8#,#AlphaCircle#"][!HideMeter I8Over][!ShowMeter I8][!UpdateMeter 8][!Redraw]
LeftMouseUpAction=["#CirclePath8#"]

[I8]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon8#
Group=8|Launcher

[I8Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon8#

[9]
Meter=Shape
X=150
Y=830
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor9#,#AlphaCircle#
Group=9|Launcher

MouseOverAction=[!SetOption 9 Size "Scale 1.2,1.2"][!SetOption 9 Color "Fill Color #CircleColor9#"][!ShowMeter I9Over][!HideMeter I9][!UpdateMeter 9][!Redraw]
MouseLeaveAction=[!SetOption 9 Size "Scale 1.0,1.0"][!SetOption 9 Color "Fill Color #CircleColor9#,#AlphaCircle#"][!HideMeter I9Over][!ShowMeter I9][!UpdateMeter 9][!Redraw]
LeftMouseUpAction=["#CirclePath9#"]

[I9]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon9#
Group=9|Launcher

[I9Over]
Meter=Image
MeterStyle=IS2
ImageName=#CircleIcon9#

The imgs used in the skin are only the "CircleIcon1~9" set in [Variables].
Here's the version of my Rainmeter
4.2.0 beta r3018 64-bit (Dec 20 2017)
Windows 10 Home China 64-bit (build 16299)

By the way, I want to use nesting variables to simplifed the code, but failed.
Hopefully someone can help me.
Thanks.
Last edited by Setsukka on April 5th, 2018, 11:39 am, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by balala »

Setsukka wrote:But now when I click the skin to open the programs, DOCKs disappeared, except the icon img.
And what should have to happen? The icon should have to disappear as well, or the others should have to remain on the skin?
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

I am sorry I have not expressed clearly.
what i want is
When I click the DOCKs, the program windows open, then the "OnUnfocusAction" is effective, all the DOCKs disappear.
But now, the DOCKs disappear, the icons left, as the GIF's shown.
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by balala »

Setsukka wrote:When I click the DOCKs, the program windows open, then the "OnUnfocusAction" is effective, all the DOCKs disappear.
But now, the DOCKs disappear, the icons left, as the GIF's shown.
Add a [!HideMeterGroup "Launcher"] bang to each LeftMouseUpAction option of all the [1] - [9] meters.
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

balala wrote:Add a [!HideMeterGroup "Launcher"] bang to each LeftMouseUpAction option of all the [1] - [9] meters.
thank you, I will consider of it, as well as what effect I really want to make the skin show.
I find myself now gone extreme a little bit.
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by balala »

Setsukka wrote:I find myself now gone extreme a little bit.
Not sure I understood what you mean by this, but here is another solution to the same problem: instead of adding the [!HideMeterGroup "Launcher"] bang to the previously mentioned options, add this: [!CommandMeasure "MeasureAction" "Stop 1"][!CommandMeasure "MeasureAction" "Execute 2"]. I think this would be an even better solution, because with this one, after the click, the value of the Num variable is decreased back to 0, while if you're using the previous solution, the variable is kept to 10, even after the click.
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

balala wrote:Not sure I understood what you mean by this, but here is another solution to the same problem: instead of adding the [!HideMeterGroup "Launcher"] bang to the previously mentioned options, add this: [!CommandMeasure "MeasureAction" "Stop 1"][!CommandMeasure "MeasureAction" "Execute 2"]. I think this would be an even better solution, because with this one, after the click, the value of the Num variable is decreased back to 0, while if you're using the previous solution, the variable is kept to 10, even after the click.
Thank you.
To avoid this issue, I would like to write like this:
[!HideMeterGroup Launcher][!SetVariable Action 1][!UpdateMeter BG][!Update]
Because I want DOCKs to disappear immediately.
Still thank you.
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

balala wrote:Not sure I understood what you mean by this, but here is another solution to the same problem: instead of adding the [!HideMeterGroup "Launcher"] bang to the previously mentioned options, add this: [!CommandMeasure "MeasureAction" "Stop 1"][!CommandMeasure "MeasureAction" "Execute 2"]. I think this would be an even better solution, because with this one, after the click, the value of the Num variable is decreased back to 0, while if you're using the previous solution, the variable is kept to 10, even after the click.
Thank you. I have understood the bug I am facing.
When I HideMeterGroup Launcher, Rainmeter think my mouse leave the meter, and then the MouseOverAction will be execute, so the icon is shown.
Still thank you.
User avatar
Setsukka
Posts: 19
Joined: March 20th, 2018, 9:53 am
Location: China

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by Setsukka »

Thanks for balala's help.
I have solved this problem perfectly.
Belows are my Code finally.

CircleLauncher.ini:

Code: Select all

[Rainmeter]
Update=5000
AccurateText=1
OnRefreshAction=[!Draggable 0]
OnUnfocusAction=[!HideMeterGroup Launcher][!SetVariable Action 1][!UpdateMeter BG][!Update]

[Metadata]
Name=SAO Augma
Author=Setsukka
Version=1.0
License=CC BY - NC - SA 4.0
Information=Circle Launcher

[Variables]
AlphaCircle=200
ColorGlow=255,240,50

CircleColor1=250,195,50
CircleIcon1=
CirclePath1=

CircleColor2=240,80,90
CircleIcon2=
CirclePath2=

CircleColor3=200,200,200
CircleIcon3=
CirclePath3=

CircleColor4=20,180,210
CircleIcon4=
CirclePath4=

CircleColor5=20,200,140
CircleIcon5=
CirclePath5=

CircleColor6=190,165,100
CircleIcon6=
CirclePath6=

CircleColor7=120,110,200
CircleIcon7=
CirclePath7=

CircleColor8=10,170,150
CircleIcon8=
CirclePath8=

CircleColor9=130,90,60
CircleIcon9=
CirclePath9=


Wait=20
Action=1
Num=1

[BG]
Meter=Image
W=5
H=#WorkAreaHeight#
SolidColor=#ColorGlow#,200
SolidColor2=#ColorGlow#,0
DynamicVariables=1
UpdateDivider=-1
MouseOverAction=[!CommandMeasure MeasureAction "Execute #Action#"]


;====================================================================

[MeasureScript]
Measure=Script
ScriptFile=Circle.lua

[MeasureAction]
Measure=Plugin
Plugin=Actiontimer
DynamicVariables=1

ActionList1=Start1|Wait #Wait#|Repeat Show, #Wait#, 9|Wait #Wait#|End1
Start1=[!SetVariable Num 1][!UpdateMeasure MeasureAction]
Show=[!ShowMeterGroup #Num#][!SetVariable Num (#Num#+1)][!UpdateMeasure MeasureAction][!Redraw]
End1=[!SetVariable Action 2][!UpdateMeter BG]

ActionList2=Start2|Wait #Wait#|Repeat Hide, #Wait#, 9|Wait #Wait#|End2
Start2=[!SetVariable Num 9][!UpdateMeasure MeasureAction]
Hide=[!HideMeterGroup #Num#][!SetVariable Num (#Num#-1)][!UpdateMeasure MeasureAction][!Redraw]
End2=[!SetVariable Action 1][!UpdateMeter BG]

[BS]
AntiAlias=1
Hidden=1
MouseOverAction=[!CommandMeasure MeasureScript Over(#CurrentSection#)]
MouseLeaveAction=[!CommandMeasure MeasureScript Leave(#CurrentSection#)]

[IS]
X=-30r
Y=-30r
W=60
ImageAlpha=#AlphaCircle#
AntiAlias=1
Hidden=1

;====================================================================

[1]
Meter=Shape
X=150
Y=150
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor1#,#AlphaCircle#
Group=1|Launcher
LeftMouseUpAction=["#CirclePath1#"]

[I1]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon1#
Group=1|Launcher

[2]
Meter=Shape
X=150
Y=235
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor2#,#AlphaCircle#
Group=2|Launcher
LeftMouseUpAction=["#CirclePath2#"]

[I2]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon2#
Group=2|Launcher

[3]
Meter=Shape
X=150
Y=320
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor3#,#AlphaCircle#
Group=3|Launcher
LeftMouseUpAction=["#CirclePath3#"]

[I3]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon3#
Group=3|Launcher

[4]
Meter=Shape
X=150
Y=405
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor4#,#AlphaCircle#
Group=4|Launcher
LeftMouseUpAction=["#CirclePath4#"]

[I4]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon4#
Group=4|Launcher

[5]
Meter=Shape
X=150
Y=490
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor5#,#AlphaCircle#
Group=5|Launcher
LeftMouseUpAction=["#CirclePath5#"]

[I5]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon5#
Group=5|Launcher

[6]
Meter=Shape
X=150
Y=575
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor6#,#AlphaCircle#
Group=6|Launcher
LeftMouseUpAction=["#CirclePath6#"]

[I6]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon6#
Group=6|Launcher

[7]
Meter=Shape
X=150
Y=660
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor7#,#AlphaCircle#
Group=7|Launcher
LeftMouseUpAction=["#CirclePath7#"]

[I7]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon7#
Group=7|Launcher

[8]
Meter=Shape
X=150
Y=745
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor8#,#AlphaCircle#
Group=8|Launcher
LeftMouseUpAction=["#CirclePath8#"]

[I8]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon8#
Group=8|Launcher

[9]
Meter=Shape
X=150
Y=830
MeterStyle=BS
Shape=Ellipse 0,0,35|Stroke Color 0,0,0,0|Extend Size,Color
Size=Scale 1.0,1.0
Color=Fill Color #CircleColor9#,#AlphaCircle#
Group=9|Launcher
LeftMouseUpAction=["#CirclePath9#"]

[I9]
Meter=Image
MeterStyle=IS
ImageName=#CircleIcon9#
Group=9|Launcher
Circle.lua:

Code: Select all

--[[
Name = Circle.lua
Author = Setsukka
Vertion = 1.0
License = CC BY - NC - SA 4.0
Information = the script is used to control the "Circle Launcher" skin
]]

function Over(N)
	SKIN:Bang('!SetOption '..N..' Size "Scale 1.2,1.2"')
	SKIN:Bang('!SetOption '..N..' Color "Fill Color #CircleColor'..N..'#"')
	SKIN:Bang('!SetOption I'..N..' X -36r')
	SKIN:Bang('!SetOption I'..N..' Y -36r')
	SKIN:Bang('!SetOption I'..N..' W 72')
	SKIN:Bang('!SetOption I'..N..' ImageAlpha 255')
	SKIN:Bang('!UpdateMeterGroup',N)
	SKIN:Bang('!Redraw')
end

function Leave(N)
	SKIN:Bang('!SetOption '..N..' Size "Scale 1.0,1.0"')
	SKIN:Bang('!SetOption '..N..' Color "Fill Color #CircleColor'..N..'#,#AlphaCircle#"')
	SKIN:Bang('!SetOption I'..N..' X -30r')
	SKIN:Bang('!SetOption I'..N..' Y -30r')
	SKIN:Bang('!SetOption I'..N..' W 60')
	SKIN:Bang('!SetOption I'..N..' ImageAlpha #AlphaCircle#')
	SKIN:Bang('!UpdateMeterGroup',N)
	SKIN:Bang('!Redraw')
end
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Some problems on Show/Hide meter with "OnUnfocusAction" Option

Post by balala »

Setsukka wrote:To avoid this issue, I would like to write like this:
[!HideMeterGroup Launcher][!SetVariable Action 1][!UpdateMeter BG][!Update]
Don't update a meter (in this case through the [!UpdateMeter BG] bang) and update the whole skin (through the [!Update] bang) simultaneously. Doesn't worth. Updating the meter is enough.
Just mention that when you update just a meter (or more, but not the whole skin), in most cases a [!Redraw] bang should be used to redraw the skin. The !UpdateMeter bang doesn't do a redraw, while !Update does (because a redrawn is done at the end of each update cycle) and when this bang is used, !Redraw isn't required (but it is with !UpdateMeter).