Style properties 'Value formatting parameters' inconsistent with XF Options 'Format parameters'

Xon

Well-known member
Affected version
2.2.6 Patch 2
With XF options; you can implement the following "Format parameters" values;
Code:
step=any
data-step=0.1
This allows any value to be entered, but configured the numberbox stepping function to increment by a fixed value. However the data-step attribute doesn't do anything for style properties.

I haven't fully explored the differences in the largely undocumented formatting options for style properties and XF options.
 
I haven't fully explored the differences in the largely undocumented formatting options for style properties and XF options.
I don't know if documentation has improved, but I am trying to find out if there is anything that will specify a default value if I am creating an addon.

My problem happens when creating a new field in style properties--specifically, Typography. In "Value formatting parameters," I can specify something like min=100 and max=900 but since the master style automatically assigns a "0" value, it throws an error when testing the new style property fields in a style I am modifying (not the master style), saying the value needs to be between 100 and 900 before I can save the style properties page (such as, Typography).

So there seems to be no "default=" option that I can tell (tried it, it didn't work). Similar fields use what is shown in the master style. Sure, I can change the "zero" values to something arbitrary, but I don't see that number entered into the master style (whose data we should never alter) having the ability to be saved to an addon.

It's a little hacky to remove the "min=" definition, but it does let a person continue without having to fill in values to correct the errors. (In my use case, values below the minimum aren't invalid and won't throw errors...but they also won't have any effect on the outcome. In other words, anything less than 100 is treated as 100. Hence, hacky.)

If these "Value formatting parameters" were documented, it would certainly help.
 
This allows any value to be entered, but configured the numberbox stepping function to increment by a fixed value. However the data-step attribute doesn't do anything for style properties.
@Xon have you tried using step=0.1? I tested it, and that works.

I edited another style properties field and found there was a step= property in there, not data_step=.

So there seems to be no "default=" option that I can tell (tried it, it didn't work).
I may have partially solved this. I can edit the appropriate .json file in ...../_output/style_properties/. If it says "property_value": "0", I believe I can change that to "property_value": "225" or whatever I want as a default when the addon is used. But, this probably throws off the matching of the hash value in _metadata.json. (Hopefully there is a way to update the hashes here?)

Doesn't work either...
 
Last edited:
@Xon have you tried using step=0.1? I tested it, and that works.

I edited another style properties field and found there was a step= property in there, not data_step=.
step=0.1 forces increments of stepping 0.1 and prevents entering 0.15.

The XF options configuration on the other hand:
Code:
step=any
data-step=0.1
This allows any numerical value, but if you click the up/down value it steps up/down by 0.1.

My problem happens when creating a new field in style properties--specifically, Typography. In "Value formatting parameters," I can specify something like min=100 and max=900 but since the master style automatically assigns a "0" value, it throws an error when testing the new style property fields in a style I am modifying (not the master style), saying the value needs to be between 100 and 900 before I can save the style properties page (such as, Typography).
There is a wonky work-around for this; Create the style property without a min value, assign it a value when the master style is selected and then set the min value via the "Value formatting parameters".

This actually saves the the value to the master style while being associated value with the add-on.
 
This allows any numerical value, but if you click the up/down value it steps up/down by 0.1.
That makes sense. I've never tried data-step before.

There is a wonky work-around for this; Create the style property without a min value, assign it a value when the master style is selected and then set the min value via the "Value formatting parameters".

This actually saves the the value to the master style while being associated value with the add-on.
I will give that a try. Thanks much!
 
Back
Top Bottom