Toolkit decorations experiment

Michael Strauß michaelstrau2 at gmail.com
Thu Feb 2 18:56:42 UTC 2023


I have experimented with blurred window backgrounds as well as
blur-behind materials within the JavaFX scene graph.

Here's a screenshot of a JavaFX application using the effect that you
probably want:
https://user-images.githubusercontent.com/43553916/216404144-da1cb463-c650-4fc3-ae05-e2b21385d66b.png

I've implemented this effect for the Windows toolkit using
DirectComposition. Other platforms need their own implementations.

Blur-behind materials within JavaFX scene graph can be implemented in
a platform-independent way.
My solution would extend the effect infrastructure by adding a
`Node.backdropEffect` property, which complements the existing
`Node.effect` property.
`Node.backdropEffect` works similiarly to CSS's `backdrop-filter` (see
https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter).

This is how you would use the backdrop effect:

    var rect = new Rectangle();
    rect.setBackdropEffect(new GaussianBlur());

    // looks like a colorless sheet of glass
    rect.setFill(Color.TRANSPARENT);

    // looks like a red sheet of glass
    rect.setFill(Color.web("red", 0.5));


Maybe that could be a useful feature.



On Tue, Jan 31, 2023 at 4:13 PM Dirk Lemmermann <dlemmermann at gmail.com> wrote:
>
> Since you are venturing into this space …. would love to be able to create blurred backgrounds in windows. Apple has some apps where the sidebar is semi-transparent with a strong blur effect.
>


More information about the openjfx-dev mailing list