It is currently April 19th, 2024, 6:56 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16145
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, 11:56 am 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.
Exactly. If it indeed doesn't interfere. In some cases it doesn't, but other times it could. It's always a question of details. Users must be careful, to not get it working mistakenly.
Anyway, as usual here are again more possibilities to get it working. We (almost) always can get the best method for our needs.
User avatar
balala
Rainmeter Sage
Posts: 16145
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, 11:31 am Basically I have the skin set to show the stroke on hover using a central common Style. But I want the name of the specific app to show when I hover over it's icon launcher button.

The problem is, because I've used Mouse Actions in a Style, they seem to be ignored in the BG# Section.
There is a solution, but you have to rename the String meters. The beginning of their names must be the same as the name of the appropriate Shape meter and you have to add something after. For instance:

Code: Select all

;========================================
; APP 1
;========================================

[BG1]
Meter=Shape
MeterStyle=sStroke
DynamicVariables=1
;MouseOverAction=[!ShowMeter "Name1"] [!UpdateMeter *] [!Redraw]
;MouseLeaveAction=[!HideMeter "Name1"] [!UpdateMeter *] [!Redraw]
LeftMouseUpAction=["D:\Documents\- TEST -\NTD1.txt"]

[BG1Name]
Meter=STRING
MeterStyle=sName
Text=Waterfox
X=10R

;========================================
; APP 2
;========================================

[BG2]
Meter=Shape
MeterStyle=sStroke
DynamicVariables=1

[BG2Name]
Meter=STRING
MeterStyle=sName
Text=Thunderbird

;========================================
; APP 3
;========================================

[BG3]
Meter=Shape
MeterStyle=sStroke
DynamicVariables=1

[BG3Name]
Meter=STRING
MeterStyle=sName
Text=MuLab
See that this time the Shape meters (which will show/hide the String meters) are named [BG1] - [BG3] and the appropriate String meters [BG1Name] - [BG3Name].
Now it's much easier: add a !ShowMeter / !HideMeter bang to both options of the [sStroke] style section:

Code: Select all

[sStroke]
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color 67,67,67,255"][!ShowMeter "#CURRENTSECTION#Name"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color 67,67,67,0"][!HideMeter "#CURRENTSECTION#Name"][!UpdateMeter *][!Redraw]
On the three meters, #CURRENTSECTION#Name gets three different values. It is BG1Name on the BG1 meter, BG2Name on BG2 and obviously BG3Name on BG3.
Also note that I added a transparent color code to the !SetOption bang of the MouseLeaveAction option.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
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, 11:53 am I know I need to add these actions into the [sStroke] Section, but again, I'm stumped on how to even begin to add actions for something whose Section and Text changes! Because for the Alpha, I used #CURRENTSECTION#, but you can't use that as it changes dependent on the highlighted button.
...
What exactly does DynamicVariable do? Is it only required if using [Variables]?
Regarding the first issue, one way of solving this is to rename the Name meters to NameBG (e.g. Name1 would become NameBG1 and so on), then instead of [!ShowMeter "Name1"] do [!ShowMeter "Name#CURRENTSECTION#"] - that way, it will show the name meter corresponding to the BG meter that was hovered on. Obviously, as you suspected, you should add these to [sStroke]. This is a quick way of doing it - there might be better ways of approaching it, but they would involve creating additional variables.

DynamicVariables=1 is required when using variables that change at runtime. Basically, if you initialize a variable with one value then change it to another value at runtime, DynamicVariables=1 would 'update' the variable's value to the new one instantly.

EDIT: Oops, didn't see balala's last reply which basically states the same thing. Sorry for the duplicate. :oops:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1140
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 »

Oh wow! Such a simple and quite 'elegant' solution, thank you both so much! :thumbup:
I'm happy again :rofl:
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
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:46 pm Oh wow! Such a simple and quite 'elegant' solution, thank you both so much! :thumbup:
I'm happy again :rofl:
If you don't want to rename meters, I think the issue would also be solved by simply removing the !ShowMeter/!HideMeter bangs from [sStroke] and adding instead an OnUpdateAction=[!ShowMeter "NameX"] at the end of every [BGX] meter, where X is the index of the meter in question (i.e. 1, 2, 3 and so on). This has the disadvantage of being a bit too repetitive and having to paste this (and modify the index accordingly) on every BGX meter, so I suppose the other option is preferable.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1140
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 »

I'll stick with the other solution, thanks though. Good to know of alternatives :D

Sorry for repeating myself, it may have been overlooked, but what exactly does Dynamic Variable do? Is it only used on [Variables]?
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
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, 1:02 pmSorry for repeating myself, it may have been overlooked, but what exactly does Dynamic Variable do? Is it only used on [Variables]?
Check this out. DynamicVariables=1 is required when using variables that change at runtime. Basically, if you initialize a variable with one value then change it to another value at runtime, DynamicVariables=1 would 'update' the variable's value to the new one instantly. In some cases, if you don't use DynamicVariables=1, the value of the changed variable would need an additional update cycle in Rainmeter to "get" its new value, or the process won't work at all (i.e. the initial value of the variable would be used instead) in other cases.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1140
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 »

Thanks for that. I thought I'd read about that in the manual before but don't remember reading that!
That why I asked instead of searching. Try not to be so lazy next time! :oops:
- MuLab -
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

User avatar
sl23
Posts: 1140
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 »

Excellent, thank you, I'll keep that bookmarked! :D
- MuLab -