How can I set -fx-max-width to USE_PREF_SIZE in JavaFX css?

I am writing a JavaFX-8 application and was wondering if it is possible to set the min or max value of (for example) a button USE_PREF_SIZE

using css. The class Region

defines USE_PREF_SIZE

how Double.NEGATIVE_INFINITY

, but how to set negative infinity in css? The JavaFX Reference Manual defines -fx-min-width, -fx-pref-width, -fx-max-width

how <number>

and <number>

is defined by the following regex. [+|-]? [[0-9]+|[0-9]*"."[0-9]+]

So maybe this is not possible?

I tried (for fun) assigning a java path to negative infinity -1.0/0.0

and the css-parser accepted the value, but without the expected effect. Can someone explain why it doesn't print a warning or error?

I already know how to set USE_PREF_SIZE

by code and I also know that there is a hack to set min, pref and max to the same value, but I want to do it in a css file in a dynamic way.

Thank you in advance

+3


source to share


1 answer


It looks like you are not actually doing this at the moment ... however the CSS parser does support Infinity

...



It looks like they are pretty open to adding support for it if you open up a new bug (that support has beenInfinity

added ).

+3


source







All Articles