MeterStyles

Meters can use option values from other meters. Using the MeterStyle option, one meter may inherit options from one or more "parent" sections.

Usage

If an option is given on both the parent meter and the child meter, the child's setting overrides the parent's for that meter. If multiple parents are given, separated by pipes (|), options on later parents override those on earlier parents.

Inherited options are used just as if they were explicitly written in the child meter. For example, if the #CURRENTSECTION# variable is used in an inherited option, it resolves as the name of the child meter, not the parent. Similarly, if a relative position is used, such as X=5R, the meter immediately previous to the child meter is used, not the parent's.

The only options that cannot be inherited are:

  • Meter. The meter type must be explicitly set in order to identify a section as a meter.

  • MeterStyle itself. This means that MeterStyles cannot be inherited through more than one generation. In other words, meters cannot have "grandparents."

MeterStyle Sections

Meters may inherit options from sections that are not meters. A skin section of any name1 that does not have the Meter or Measure option is treated as a MeterStyle. A MeterStyle section is completely ignored by Rainmeter unless it is referenced in the MeterStyle option of a meter. Options that are not valid for the child meter are also simply ignored, which means that the parent and child can be different types.

1. Aside from [Rainmeter] and [Variables], which are reserved for special purposes.

Example

[MyFirstParent]
Meter=String
Text=I'm a parent!
X=10
FontColor=255,0,0
FontFace=Segoe UI
FontSize=15
AntiAlias=1
StringStyle=Bold
[MySecondParent]
StringStyle=Italic
FontColor=0,255,0
[MyChild]
Meter=String
MeterStyle=MyFirstParent | MySecondParent
FontColor=0,0,255

MyChild inherits all options from the MyFirstParent meter and the MySecondParent MeterStyle. This means it is displayed with all of the same font, color, size and other options given for those sections. The second parent's StringStyle option overrides the first parent's, which means the child meter displays italic text. Likewise, the child meter's FontColor option overrides both parents', so the text displays with a color of 0,0,255 (blue).