It is currently September 20th, 2019, 12:59 pm

Keep colors from measure after MouseLeaveAction

Help with creating, editing & fixing problems with skins
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Keep colors from measure after MouseLeaveAction

Pul53dr1v3r » August 22nd, 2019, 1:15 pm

eclectic-tech wrote:
August 22nd, 2019, 11:36 am
Set the initial value of MOver to zero in your [Variables] section.
:oops: Seems i reached my limit of getting solutions in a day. Thanks ET.

I spotted one more issue (the only remaining) where MouseOverColor color is being overridden when i click the button, so it disapears until the nex mouseoveraction. Image i modified the code to make it more distinct, and MouseOverColor is a separated color used just for this purpose. The text should have that color all the time when the condition of MOver=1. That behaviour would look more natural.

Code: Select all

[Rainmeter]
 Update=1000
 AccurateText=1
 DynamicWindowSize=1
 MiddleMouseDownAction=[!RefreshApp]

[Variables]
ActivatedSkinColor=105,105,105
ActivatedSkinTxtColor=255,200,0
DeactivatedSkinColor=64,64,64
DeactivatedSkinTxtColor=120,120,120
MouseOverColor=255,0,0
SkinTxtColor=105,105,105
MOver=0

[styleSkinsBoxes]
 StringCase=UPPER
 StringStyle=Bold
 FontColor=#SkinTxtColor#
 SolidColor=64,64,64,250
 FontFace=#FontFamily#
 FontSize=24
 padding=10,10,10,10
 AntiAlias=1
 MouseOverAction= [!SetVariable MOver "1"][!UpdateMeasure MeasureBatteryLauncher]
 MouseLeaveAction=[!SetVariable MOver "0"][!UpdateMeasure MeasureBatteryLauncher]
 DynamicVariables=1

[MeasureBatteryLauncher]
Measure=Plugin
Plugin=ConfigActive
ConfigName=#ROOTCONFIG#\Battery
IfCondition=(#CURRENTSECTION# = 1)
IfTrueAction=[!SetOption MeterBatteryLauncher LeftMouseUpAction """[!DeactivateConfig "#ROOTCONFIG#\Battery"]"""][!SetOption "MeterBatteryLauncher" "SolidColor" "#ActivatedSkinColor#"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOption MeterBatteryLauncher LeftMouseUpAction """[!ActivateConfig "#ROOTCONFIG#\Battery" "Battery.ini"]"""][!SetOption "MeterBatteryLauncher" "SolidColor" "#DeactivatedSkinColor#"][!UpdateMeter *][!Redraw]
IfCondition2=(#CURRENTSECTION# <= 0) && (#MOver# <= 0)
IfTrueAction2=[!SetVariable SkinTxtColor "#DeactivatedSkinTxtColor#"][!UpdateMeter *][!Redraw]
IfCondition3=(#CURRENTSECTION# <= 0) && (#MOver# = 1)
IfTrueAction3=[!SetVariable SkinTxtColor "#MouseOverColor#"][!UpdateMeter *][!Redraw]
IfCondition4=(#CURRENTSECTION# = 1) && (#MOver# = 1)
IfTrueAction4=[!SetVariable SkinTxtColor "#MouseOverColor#"][!UpdateMeter *][!Redraw]
IfCondition5=(#CURRENTSECTION# = 1) && (#MOver# <= 0)
IfTrueAction5=[!SetVariable SkinTxtColor "#ActivatedSkinTxtColor#"][!UpdateMeter *][!Redraw]
IfCondition6=(#CURRENTSECTION# <= 0)
IfTrueAction6=[!SetVariable SkinTxtColor "#DeactivatedSkinTxtColor#"][!UpdateMeter *][!Redraw]
IfCondition7=(#CURRENTSECTION# = 1)
IfTrueAction7=[!SetVariable SkinTxtColor "#ActivatedSkinTxtColor#"][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterBatteryLauncher]
Meter=String
MeterStyle=styleSkinsBoxes
Text=Battery
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Keep colors from measure after MouseLeaveAction

eclectic-tech » August 22nd, 2019, 3:13 pm

Try changing the 4th condition in [MeasureBatteryLauncher]

Code: Select all

IfCondition4=(#CURRENTSECTION# = 1) && (#MOver# = 1)
IfTrueAction4=[!SetVariable SkinTxtColor "#ActivatedSkinTxtColor#"][!UpdateMeter *][!Redraw]
This will keep the text with "ActivatedSkinTxtColor" when the battery config is active and you mouse over the button. When the battery config is inactive, the button will change to the "MouseOverColor".

Not sure if that is what you want? :???:
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Keep colors from measure after MouseLeaveAction

Pul53dr1v3r » August 22nd, 2019, 4:33 pm

eclectic-tech wrote:
August 22nd, 2019, 3:13 pm
No mate, you misunderstood me. Variable SkinTxtColor must have the color from MouseOverColor Variable all the time mouse is over the button, namely whenever value of MOver variable is 1.
That's it. This is how it looks in real example when you click on the button:
Image

So, once more, whenever the cursor is over the button, the text have to be red since MouseOverColor=255,0,0.

I found a solution that's good but not perfect because it calls for a little mouse move after the state's changed, but would like to see differents approaches if there are and probably a better way to do it.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Keep colors from measure after MouseLeaveAction

eclectic-tech » August 22nd, 2019, 5:35 pm

Pul53dr1v3r wrote:
August 22nd, 2019, 4:33 pm
No mate, you misunderstood me. Variable SkinTxtColor must have the color from MouseOverColor Variable all the time mouse is over the button, namely whenever value of MOver variable is 1.
That's it. This is how it looks in real example when you click on the button:
Image

So, once more, whenever the cursor is over the button, the text have to be red since MouseOverColor=255,0,0.

I found a solution that's good but not perfect because it calls for a little mouse move after the state's changed, but would like to see differents approaches if there are and probably a better way to do it.
More options than I can follow! ;-)
I would go with your solution 'cause I can figure out what you want. :confused:
User avatar
Pul53dr1v3r
Posts: 211
Joined: July 30th, 2014, 10:30 am

Re: Keep colors from measure after MouseLeaveAction

Pul53dr1v3r » August 22nd, 2019, 6:51 pm

Solved!
Thanks to jsmorley, ikarus and ET!