It is currently March 28th, 2024, 4:01 pm

Can I specify a meter to 'Click Through'?

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can I specify a meter to 'Click Through'?

Post by balala »

sl23 wrote: February 18th, 2023, 6:32 pm Although it works on first use, once you click on another button, the scrolling stops working, any idea why that is?
This is a completely normal behavior, because when you click the second or third button, you set a well defined value for the ScreenSaver variable: 0,0,0,150 with [Button2] and 50,10,0,220 with [Button3]. One of these values being set, the scrolling can't work anymore, because the ScreenSaver variable doesn't contain anymore the Alpha variable, which is in fact altered when scrolling.
To fix, you have to rewrite the LeftMouseUpAction options of the [Button2] and [Button3] meters, to not get modified the original ScreenSaver variable. For instance:

Code: Select all

[Button2]
...
LeftMouseUpAction=[!WriteKeyValue Variables ScreenSaver 0,0,0,#*Alpha*#][!SetVariable Alpha "150"][!SetVariable ScreenSaver "0,0,0,[#Alpha]"][!UpdateMeter "Button1"][!UpdateMeter "Background"][!Redraw]

[Button3]
...
LeftMouseUpAction=[!WriteKeyValue Variables ScreenSaver "50,10,0,#*Alpha*#"][!SetVariable Alpha "210"][!SetVariable ScreenSaver "50,10,0,[#Alpha]"][!UpdateMeter "Button1"][!UpdateMeter "Background"][!Redraw]
This code is still not the proper one, because clicking [Button2] will work, however when you click [Button3], the FillColor option (in fact the #ScreenSaver# variable) of the [Background] meter is set to 50,10,0,[#Alpha] (according to the second !SetVariable bang of the LeftMouseUpAction option of the [Button3] meter), but when you start scrolling, this option (and again, in fact the #ScreenSaver# variable) is set back to 0,0,0,[#Alpha], by the MouseScrollDownAction and MouseScrollUpAction options of the [Button1] meter. To fix this, we'll have to add two (or best way, maybe even three) variable, for the red, green and blue components of the color. But for first please test the above update of your code, to see if it works as expected. If it does, the new variables can be added easily. If you get the skin working as expected (excepting the above described issue) and don't you know how to add those variables, please let me know, for further help.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Ok Thanks to your help, I managed to get this working, sort of!

A slightly different approach, for now. I have made 4 'buttons' that you can scroll to adjust for each R G B A.
What I would like to add to this, is to allow L-clicking any button to save the current setting, but I'm lost as to how to achieve that! :confused:

Please help! :rosegift:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can I specify a meter to 'Click Through'?

Post by balala »

sl23 wrote: February 20th, 2023, 4:59 pm I have made 4 'buttons' that you can scroll to adjust for each R G B A.
What I would like to add to this, is to allow L-clicking any button to save the current setting, but I'm lost as to how to achieve that! :confused:
Add something like this to each of those buttons: LeftMouseUpAction=[!WriteKeyValue Variables R "R-Value"]. For each button you have to add the !WriteKeyValue which writes the value of the appropriate variable (R for first button, G for the second one, B for the third and finally A for the last one).
These !WriteKeyValue bangs write the values for the R, G, B and A variables accordingly into the [Variables] section. Obviously R-Value, G-Value, B-Value and A-Value are the values which are set when scrolling on the appropriate button.
Most probably you'll want to remove the existing !WriteKeyValue bangs.
If you can't deal with this and need further help, please post the altered code.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Thanks for your help balala, and sorry for the late reply, only just had time now to deal with it. :D

It seems to be fully working how I imagined, here's the code if anyone's interested:

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=ScreenSaver
Author=sl23
Information=Screen saver background and night filter.||
Version=2023.2.20
License=CC BY 3.0

[Variables]
Red=40
Green=20
Blue=0
Alpha=200
ScreenSaver=#Red#,#Green#,#Blue#,#Alpha#
BgFill=0,0,0,150
White20=255,255,255,20
White60=255,255,255,60
Yellow=255,255,0

==================================
[Background]
Meter=Shape
Shape=Rectangle 0,0,#ScreenAreaWidth#,#WorkAreaHeight#,0 | Extend FillAlpha
FillAlpha=FillColor #ScreenSaver#
DynamicVariables=1

==================================
[sButton]
Shape=Ellipse 0,0,10 | Extend FillAlpha | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=StrokeColor #White60#
;LeftMouseUpAction=[!WriteKeyValue Variables ScreenSaver #*Red*#,#*Green*#,#*Blue*#,#*Alpha*#][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "Background"][!Redraw]
LeftMouseUpAction=[!WriteKeyValue Variables #CURRENTSECTION# "[#[#CURRENTSECTION]]"]

MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #Yellow#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #White60#"][!UpdateMeter *][!Redraw]

MouseScrollUpAction=[!SetVariable #CURRENTSECTION# ([#[#CURRENTSECTION]]+10)] [!SetVariable ScreenSaver "[#Red],[#Green],[#Blue],[#Alpha]"] [!UpdateMeter "#CURRENTSECTION#"] [!UpdateMeter Background][!Redraw]
MouseScrollDownAction=[!SetVariable #CURRENTSECTION# ([#[#CURRENTSECTION]]-10)] [!SetVariable ScreenSaver "[#Red],[#Green],[#Blue],[#Alpha]"] [!UpdateMeter "#CURRENTSECTION#"] [!UpdateMeter Background][!Redraw]

DynamicVariables=1
X=30r
Y=r

[Red]
Meter=Shape
MeterStyle=sButton
FillAlpha=FillColor 50,0,0,200

X=(#ScreenAreaWidth#/2-45)
Y=(#WorkAreaHeight#-30)

[Green]
Meter=Shape
MeterStyle=sButton
FillAlpha=FillColor 0,50,0,200

[Blue]
Meter=Shape
MeterStyle=sButton
FillAlpha=FillColor 0,0,50,200

[Alpha]
Meter=Shape
MeterStyle=sButton
FillAlpha=FillColor 0,0,0,200
I changed the Section names for the Buttons to their respective colours, just to condense the code and make it easier to read really.

Instructions: Scroll on the coloured buttons to change that colour, the dark button is Alpha transparency. Once you've set the desired overall colour, Left click any button to permanently save it.

Thanks again :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can I specify a meter to 'Click Through'?

Post by balala »

sl23 wrote: February 25th, 2023, 1:24 pm I changed the Section names for the Buttons to their respective colours, just to condense the code and make it easier to read really.
Extremely ingenious this code condensation. You've reduced the length of your code in a very smart way. Congratulations for this, I like this approach extremely much. :great:
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Can I specify a meter to 'Click Through'?

Post by sl23 »

Thanks, least I'm good at something then! :rolmfao: :rolmfao: :rolmfao:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can I specify a meter to 'Click Through'?

Post by balala »

sl23 wrote: February 26th, 2023, 10:52 am Thanks, least I'm good at something then! :rolmfao: :rolmfao: :rolmfao:
I think no one has contested this. :thumbup:
Post Reply