Another version of FXThemes released.

This release adds new API to change windows corners and set native platform decorations on TRANSPARENT and UNDECORATED stages.

New version features

Change window corners

You can now change the corners of a Window to be either one of these:

  • Rectangle
  • Round
  • Less round

Here’s a video illustrating this feature in action:

Set native window decorations on a Stage

Setting the window corners to be round on a TRANSPARENT or UNDECORATED Stage has the effect of setting native window decorations on those Stages.

To be precise, these decorations are actually rendered by the platform itself (the Windows OS in this case) and so will look in line with standard platform window decorations.

Eating my own dog food

To test this out I did a small experiment. A login dialog with a transparent blur backdrop.

The video below shows this dialog in action:

To achieve this, I created a TRANSPARENT Stage (could also be an UNDECORATED Stage).

I used FXThemes to set native platform decorations on that Stage and make its corners round. Then I also set the background to have an “acrylic” transparent backdrop:

 
Win11ThemeWindowManager manager = 
   (Win11ThemeWindowManager) ThemeWindowManagerFactory.create();
manager.setWindowBackdrop(primaryStage, Backdrop.ACRYLIC);
manager.setWindowCornerPreference(primaryStage, CornerPreference.ROUND);

Besides the image animation that you see when you start to login which is achieved by using the standard JavaFX animation API on two ImageViews, FXSkins is also used for switching the skin of the progress bar and adding “shrink when press” button animations. Finally, some minor aesthetic tweaks to the Stage to achieve a glass like effect on the window (Stage).

Conclusion

A new version of FXThemes was released with new API to set the corners of a Window and also to set platform native decorations on UNDECORATED or TRANSPARENT stages.

Finally, I try to eat my own dog food 🥓🐕

As usual, check out the FXThemes documentation to know more about it and how to get it.

Leave a Reply

Your email address will not be published. Required fields are marked *