ResponsivePane is an attempt to do something in that way, but I chose a 
slightly different approach where the system automatically switches between 
different layouts and CSS files depending on the window's size. It has a common 
area (reusable nodes) and then specific layouts per size.
https://tbeernot.wordpress.com/2016/12/11/responsivepane/
https://github.com/JFXtras/jfxtras/blob/9.0/jfxtras-common/src/main/java/jfxtras/scene/layout/responsivepane/ResponsivePane.java

It worked very well, I used it to transition between desktop, tablet en phone 
screens. Except problems with higher screen DPI's, which I was not able to 
solve because the DPI info JavaFX gave me was inaccurate.



On 28-1-2020 00:02, Pedro Duque Vieira wrote:
Hi,

AFAIK, -fx-padding values are also affected as long as they're also defined
in em.

I agree, would also be nice for other things to scale automatically,
depending on the font size defined in root. I don't think other properties
besides -fx-padding also scale.

One thing that would be nice to have to be able to do responsive design as
we can do on the web, would be to have things like media queries (css rules
that only apply on specified screen sizes), being able to specify layout
through CSS, other properties responding to changes in font size in the
root when defined in em.

Cheers,


Reply via email to