It is currently March 28th, 2024, 9:32 am

[help]it's delay

General topics related to Rainmeter.
Post Reply
User avatar
louiswei1986
Posts: 4
Joined: February 21st, 2017, 1:30 am

[help]it's delay

Post by louiswei1986 »

sorry my english not very well.
I want use the code "MouseOverAction",to change font color,
but it will delay 1~2 sec and than show the change.
code:

[Rainmeter]

[MeterText2]
Meter=STRING
x=80
Y=34
BackgroundMode=2
SolidColor=0,0,0,1
FontColor=#Color2#
Fontface=lato
FontSize=12
StringStyle=Bold
StringAlign=center
Prefix="PhotoShop"
MouseOverAction=!SetOption MeterText2 FontColor 128,192,255
MouseLeaveAction=!SetOption MeterText2 FontColor 255,255,255
LeftMouseUpAction= ["C:\Program Files\Adobe\Adobe Photoshop CC 2017\Photoshop.exe"]
AntiAlias=1

how i fix it ? please help me and thanks alot!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [help]it's delay

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Color1=128,192,255
Color2=255,255,255
MillisecondsToWait=2000
 
[MeasureDelay]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Wait #MillisecondsToWait# | SetColor1
SetColor1=[!SetOption MeterText2 FontColor #Color1#][!UpdateMeter MeterText2][!Redraw]
ActionList2=Wait #MillisecondsToWait# | SetColor2
SetColor2=[!SetOption MeterText2 FontColor #Color2#][!UpdateMeter MeterText2][!Redraw]

[MeterText2]
Meter=STRING
x=80
Y=34
SolidColor=0,0,0,1
FontColor=#Color2#
Fontface=lato
FontSize=12
StringStyle=Bold
StringAlign=center
Text="PhotoShop"
MouseOverAction=[!CommandMeasure MeasureDelay "Stop 2"][!CommandMeasure MeasureDelay "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureDelay "Stop 1"][!CommandMeasure MeasureDelay "Execute 2"]
LeftMouseUpAction= ["C:\Program Files\Adobe\Adobe Photoshop CC 2017\Photoshop.exe"]
AntiAlias=1
https://docs.rainmeter.net/manual/plugins/actiontimer/
User avatar
louiswei1986
Posts: 4
Joined: February 21st, 2017, 1:30 am

Re: [help]it's delay

Post by louiswei1986 »

jsmorley wrote:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

...[/quote]

I'm sorry I didn't say it clearly.
I mean I don't want it delay,
but I modify your code "MillisecondsToWait=0"
It's working good!
thanks!!!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [help]it's delay

Post by jsmorley »

I tweaked that code a bit to stop it from changing color after 2 seconds even if you move off in the meantime.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [help]it's delay

Post by jsmorley »

louiswei1986 wrote:I'm sorry I didn't say it clearly.
I mean I don't want it delay,
but I modify your code "MillisecondsToWait=0"
It's working good!
thanks!!!
Oh, well never mind that whole thing then, just do this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Color1=128,192,255
Color2=255,255,255
 
[MeterText2]
Meter=STRING
x=80
Y=34
SolidColor=0,0,0,1
FontColor=#Color2#
Fontface=lato
FontSize=12
StringStyle=Bold
StringAlign=center
Text="PhotoShop"
MouseOverAction=[!SetOption MeterText2 FontColor #Color1#][!UpdateMeter MeterText2][!Redraw]
MouseLeaveAction=[!SetOption MeterText2 FontColor #Color2#][!UpdateMeter MeterText2][!Redraw]
LeftMouseUpAction=["C:\Program Files\Adobe\Adobe Photoshop CC 2017\Photoshop.exe"]
AntiAlias=1
User avatar
louiswei1986
Posts: 4
Joined: February 21st, 2017, 1:30 am

Re: [help]it's delay

Post by louiswei1986 »

jsmorley wrote:Oh, well never mind that whole thing then, just do this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[/quote]

if i have many strings , like [MeterText2],[MeterText3],[MeterText4]...
how can i modify it simply.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [help]it's delay

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Color1=128,192,255
Color2=255,255,255
 
[MeterText1]
Meter=STRING
SolidColor=0,0,0,1
FontColor=#Color2#
FontSize=12
StringStyle=Bold
Text=Text1
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor #Color1#][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor #Color2#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=["Whatever"]
AntiAlias=1

[MeterText2]
Meter=STRING
Y=5R
SolidColor=0,0,0,1
FontColor=#Color2#
FontSize=12
StringStyle=Bold
Text=Text2
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor #Color1#][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor #Color2#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=["Whatever"]
AntiAlias=1

[MeterText3]
Meter=STRING
Y=5R
SolidColor=0,0,0,1
FontColor=#Color2#
FontSize=12
StringStyle=Bold
Text=Text3
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor #Color1#][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor #Color2#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=["Whatever"]
AntiAlias=1
https://docs.rainmeter.net/manual/variables/built-in-variables/#CURRENTSECTION
User avatar
louiswei1986
Posts: 4
Joined: February 21st, 2017, 1:30 am

Re: [help]it's delay

Post by louiswei1986 »

it's Perfect!!! Thanks !!! :D :D :D :D :D :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [help]it's delay

Post by jsmorley »

louiswei1986 wrote:it's Perfect!!! Thanks !!! :D :D :D :D :D :D
Glad to help.
Post Reply