It is currently September 20th, 2024, 7:26 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

Post by sl23 »

:welcome:
Last edited by sl23 on August 23rd, 2024, 10:52 am, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
jsmorley
Developer
Posts: 22749
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

Code: Select all

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

[Variables]

[StrokeStyle]
justMyStroke=Stroke Color 67,67,67,255

[MeterShape1]
Meter=Shape
Shape=Rectangle 4,4,300,150 | StrokeWidth 8 | Extend justMyStroke
MeterStyle=StrokeStyle
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# justMyStroke "Stroke Color 67,67,67,0"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# justMyStroke ""][!UpdateMeter *][!Redraw]

[MeterShape2]
Meter=Shape
Shape=Rectangle 4,4,300,150 | StrokeWidth 8 | Extend justMyStroke
MeterStyle=StrokeStyle
Y=10R
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# justMyStroke "Stroke Color 67,67,67,0"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# justMyStroke ""][!UpdateMeter *][!Redraw]

GIF.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8192
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

sl23 wrote: August 8th, 2019, 12:33 am I was thinking something like this, but it doesn't work:

Code: Select all

[sHighlight2]
MouseOverAction=[!SetVariable #CURRENTSECTION# sw "2"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
MouseLeaveAction=[!SetVariable #CURRENTSECTION# sw ""] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
...
Jsmorley already provided a solution to your problem, but just so you know, you had an (unintentional?) mistake in the code above: it should have been [!SetVariable sw "2"] instead of [!SetVariable #CURRENTSECTION# sw "2"]. The latter form is used for the !SetOption bangs, not for the !SetVariable ones.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

Post by sl23 »

:welcome:
Last edited by sl23 on August 23rd, 2024, 10:53 am, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
balala
Rainmeter Sage
Posts: 16568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

sl23 wrote: August 8th, 2019, 12:16 am Is it possible to use a similar instruction for the StrokeWidth?
Yep, it definitely is. For instance starting from jsmorley's above code, you have to add extenders for the Shape meters, then modify those ones:

Code: Select all

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

[Variables]
StrokeAlpha=255
StrokeWidth=8

[sHighlight]
MouseOverAction=[!SetOption #CURRENTSECTION# MyModifiers2 "Stroke Color 47,47,47,0"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# MyModifiers2 "Stroke Color 47,47,47,255"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeterShape1]
Meter=Shape
MeterStyle=sHighlight
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,255

[MeterShape2]
Meter=Shape
MeterStyle=sHighlight
Y=10R
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,255
As you can see this time I modified the color of the stroke, through the MyModifiers2 option, previously added to both Shape meters.
User avatar
Yincognito
Rainmeter Sage
Posts: 8192
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

sl23 wrote: August 8th, 2019, 8:28 amI thought you had to use the Set Variable bang to use variables! So thanks for explaining :)
To make things clear: in general, the !SetVariable bang is indeed used to modify the value of variables, just like the !SetOption bang is used to modify options. So, from this point of view, you weren't mistaken - it was just a matter of confusing the former's syntax with the latter's in your original code.

In practice, you can use either of these two methods (or even a mixture of them) to do your thing - for example, jsmorley and balala used !SetOption bangs to make it happen, but you can easily use !SetVariable bangs if you like (the code below is based on balala's reply):

Code: Select all

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

[Variables]
StrokeAlpha=255
StrokeWidth=8

[sHighlight]
MouseOverAction=[!SetVariable StrokeAlpha 0][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetVariable StrokeAlpha 255][!UpdateMeter "#CURRENTSECTION#"][!Redraw]

[MeterShape1]
Meter=Shape
MeterStyle=sHighlight
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,#StrokeAlpha#
DynamicVariables=1
UpdateDivider=-1

[MeterShape2]
Meter=Shape
MeterStyle=sHighlight
Y=10R
Shape=Rectangle 4,4,300,150 | Extend MyModifiers1, MyModifiers2
MyModifiers1=StrokeWidth #StrokeWidth#
MyModifiers2=Stroke Color 47,47,47,#StrokeAlpha#
DynamicVariables=1
UpdateDivider=-1
Obviously, dynamic variables are required, and setting the update divider to -1 in order to update the relevant meters only when needed is a good idea.

Whether you prefer one method over the other, that's entirely up to you. I just wanted to point out that you can do it using !SetVariable bangs as well, in case you had the wrong impression on this...

EDIT: You can control the stroke width as well, by replacing, say, [!SetVariable StrokeAlpha 0] with [!SetVariable StrokeWidth 8] and [!SetVariable StrokeAlpha 255] with [!SetVariable StrokeWidth 1] in the above code (it makes more sense to me to make the highlighted/hovered frame thicker, instead of the opposite, by the way).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

Post by sl23 »

:welcome:
Last edited by sl23 on August 23rd, 2024, 10:53 am, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
balala
Rainmeter Sage
Posts: 16568
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

Yincognito wrote: August 8th, 2019, 10:28 am Obviously, dynamic variables are required, and setting the update divider to -1 in order to update the relevant meters only when needed is a good idea.
No, it's not a good idea, it is absolutely needed! If you don1t set the UpdateDivider of both meters to -1, both will get receive the newly set transparency of the stroke. Using the !Setoption method, this can be avoided.
User avatar
sl23
Posts: 1705
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the new Shape meter

Post by sl23 »

:welcome:
Last edited by sl23 on August 23rd, 2024, 10:53 am, edited 1 time in total.
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8192
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the new Shape meter

Post by Yincognito »

balala wrote: August 8th, 2019, 11:42 am No, it's not a good idea, it is absolutely needed! If you don1t set the UpdateDivider of both meters to -1, both will get receive the newly set transparency of the stroke. Using the !Setoption method, this can be avoided.
I know - that's why I included them. :D Using "a good idea" instead of "absolutely needed" was just another way of saying it. I hate to always use the same words, so I was probably trying to be 'creative', LOL.

Other than that, there is no reason to avoid setting the update divider to -1 on the meters, as long as it doesn't interfere with other processes in the skin - after all, the 'highlight' is triggered on demand (i.e. on hover) anyway. Since the example was pretty basic, I didn't think it was a problem, but then, it always depends on what else you have in your skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth