Wednesday, 9 April 2014

FX 2.2 to FX 8.0 Part 3 (spacing & layout)

Ok, so now I can login and can start checking out various views and editors. Two things got me here:

1.  The first is that the vertical height of TextFields are different in Modena. So unless your layout can auto grow vertically things become a bit squashed, especially if its compact:

In FX 2.2 it looked like so:

I used a GridPane for the above layout but I hadn't specified a vgap, nor a top and bottom inset padding in FX 2.2 as it wasn't necessary. After adding a vgap="2.0" to GridPane,  and padding of top="4.0" and bottom="2.0" it looked better:

And with FX 8.0 Caspian it looks like so:

2.  The second snag was that because of the above some of the screens that I had designed when first using SceneBuilder and the default AnchorPane didn't adjust well to Modena. Labels and TextFields sometimes became ever so slightly out of line changing a GUI that was smart into something sloppy. Other times fields would creep up or encroach on one another because they were too close:

And this is how it looked in FX 2.2:

So some screens needed to be redone using GridPane and others I could just adjust the space between components, like this:

Next some shocking Tree behavior .... see part 4.

No comments:

Post a Comment