Page 1 of 1

Bug? changing (removing) Postfix doesn't work (in a special case)

Posted: February 2nd, 2018, 8:11 am
by ikarus1969
Hello!
Recently i stumbled across the following:

i have a text-meter with an associated style-definition that has a postix in it (Postfix="B")

On an if-condition i have a !SetOption-Bang that removes the postfix. That does not work.

After testing i found out:
  • removing the postfix with a bang only works if the postfix is defined on the meter and not on its style-definition
  • setting the postifx to some value works no matter if the postfix is defined in a style or on the meter itself
Here's a small skin you can use for testing:

Code: Select all

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

[Measure_Time]
Measure=TIME
Format="%S"

[Measure_CALC]
Measure=CALC
Formula=Measure_Time % 2
IfCondition=Measure_CALC = 0
IfTrueAction=[!SetOption "Meter_Text" "Postfix" ""][!UpdateMeter "Meter_Text"][!Redraw]
IfFalseAction=[!SetOption "Meter_Text" "Postfix" "B"][!UpdateMeter "Meter_Text"][!Redraw]
DynamicVariables=1

[Style_With_Postfix]
Postfix="B"
InlineSetting= Face   | Arial
InlineSetting2=Size   | 32
InlineSetting3=Weight | 600
SolidColor=FFFFFFFF
AntiAlias=1
DynamicVariables=1


[Meter_Text]
Meter=STRING
MeterStyle=Style_With_Postfix
MeasureName=Measure_Time

Re: Bug? changing (removing) Postfix doesn't work (in a special case)

Posted: February 2nd, 2018, 12:40 pm
by jsmorley
ikarus1969 wrote:Hello!
Recently i stumbled across the following:

i have a text-meter with an associated style-definition that has a postix in it (Postfix="B")

On an if-condition i have a !SetOption-Bang that removes the postfix. That does not work.

After testing i found out:
  • removing the postfix with a bang only works if the postfix is defined on the meter and not on its style-definition
  • setting the postifx to some value works no matter if the postfix is defined in a style or on the meter itself
Here's a small skin you can use for testing:

Code: Select all

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

[Measure_Time]
Measure=TIME
Format="%S"

[Measure_CALC]
Measure=CALC
Formula=Measure_Time % 2
IfCondition=Measure_CALC = 0
IfTrueAction=[!SetOption "Meter_Text" "Postfix" ""][!UpdateMeter "Meter_Text"][!Redraw]
IfFalseAction=[!SetOption "Meter_Text" "Postfix" "B"][!UpdateMeter "Meter_Text"][!Redraw]
DynamicVariables=1

[Style_With_Postfix]
Postfix="B"
InlineSetting= Face   | Arial
InlineSetting2=Size   | 32
InlineSetting3=Weight | 600
SolidColor=FFFFFFFF
AntiAlias=1
DynamicVariables=1


[Meter_Text]
Meter=STRING
MeterStyle=Style_With_Postfix
MeasureName=Measure_Time
That is the expected behavior for any option defined in a MeterStyle.

It is defined in the style. If you use !SetOption to add it to the meter, then that overrides the style. If you use !SetOption to remove it from the meter, then it goes back to being defined by the style.

Re: Bug? changing (removing) Postfix doesn't work (in a special case)

Posted: February 2nd, 2018, 12:49 pm
by ikarus1969
Ah, ok, now i understand - thank you!
My fault was to think if i remove a property it is removed (and doesn't go back to a style).

Re: Bug? changing (removing) Postfix doesn't work (in a special case)

Posted: February 2nd, 2018, 1:00 pm
by jsmorley
ikarus1969 wrote:Ah, ok, now i understand - thank you!
My fault was to think if i remove a property it is removed (and doesn't go back to a style).
Glad to help.