It is currently March 28th, 2024, 1:57 pm

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

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

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

Post 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
Last edited by ikarus1969 on February 2nd, 2018, 12:50 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

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

Post 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.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

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

Post 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).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

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

Post 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.
Post Reply