It is currently April 19th, 2024, 2:21 am
Report bugs with the Rainmeter application and suggest features.
ikarus1969
Posts: 571 Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria
Post
by ikarus1969 » February 2nd, 2018, 8:11 am
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.
jsmorley
Developer
Posts: 22629 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » February 2nd, 2018, 12:40 pm
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.
ikarus1969
Posts: 571 Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria
Post
by ikarus1969 » February 2nd, 2018, 12:49 pm
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).
jsmorley
Developer
Posts: 22629 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » February 2nd, 2018, 1:00 pm
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.