It is currently April 19th, 2024, 11:45 am

[Suggestion] Parametrized styles/Meter templates

Report bugs with the Rainmeter application and suggest features.
marko
Posts: 1
Joined: January 4th, 2017, 10:58 am

[Suggestion] Parametrized styles/Meter templates

Post by marko »

In my skins I tend to use many repetitive elements. An example is a program launcher where each meter has a different location, displays a different icon and launches its associated program, but otherwise behaves identically. Styles and variables let me streamline the skins somewhat, but ideally, I'd like to be able to create a template and instatiate it, something like this:

Code: Select all

[Launcher]
template=image
templateVar=xPosition
templateVar2=yPosition
templateVar3=iconName
templateVar4=linkName
imageName=$iconName$
imageAlpha=255
x=(#launcherOffset#+$xPosition$)
y=(#launcherOffset#+$yPosition$)
mouseOverAction=[!SetOption $@$ imageAlpha 255][!Update]
mouseLeaveAction=[!SetOption $@$ imageAlpha 100][!Update]
leftMouseDownAction=["$linkName$"]

Code: Select all

[LauncherSet]
instance=Launcher | Launcher1 | 10 | 20 | #@#exclamationMark.png | http:\\exclamation.site.com
instance2=Launcher | Launcher2 | 20 |30 | #@#myProgram.png | c:\myAmazingProgram.exe
This would be the equivalent of writing out two image meters with $variables$ replaced by the corresponding values from the instance statement. In other words, the $variables$ are resolved once only when skin is refreshed and only exist within this particular instance-for all practical purposes, they are constants. The variable $@$ would resolve to the meter name, in this case Launcher1 and Launcher2. And of course, actual #variables# can be used in the instance statement, so I could control what gets loaded and how by editing the, say, variables.inc file.

Would you consider adding this sort of functionality?