Faster Blur? || Glassmorphism UI

I’m almost there on applying that blur to a combobox!

I’m overriding drawPopupMenuBackgroundWithOptions and it works fine for the main popup, but not for any sub-menu. Am I missing something?

TL;DR: how to get the bounds for the displayed submenu?

Thanks

1 Like

anybody?

I don’t know a lot about popup menus I’m afraid, other than the fact they’re notoriously difficult to stylise :laughing:

Have you looked into the relevant code in the popup menus to see where the sub-menus are spawned, and how they might be styled differently to main menus?

I also don’t know much about JUCE’s PopupMenu, but did you explicitly set the same look and feel for the submenus?

Just wondering, how did you actually implement your own drop shadow using stack blur?
Since the gin stack blur is for images, I assume you’re baking the path into an image and then blurring it?

This is how I’m using it. Generate the image and blur it in the resized() function and store the resulting image as a member.

Yeah, exactly. This is the free function I’m using to get fast css/figma-consistent results with StackBlur: renderDropShadow.h · GitHub

As in my usage example, I almost always have several shadows on top of one another. Here’s an example, all vector with inner/drop shadow:

image

10 Likes

super nice, could probably be improved by caching the rendered path and only re-rendering when necessary

1 Like

Love this idea. Stack Blur is very fast compared with the JUCE implementation but not free. I had a few other optimization ideas, but this one sounds nice. Instead of a free function, it would have to be a bit more like JUCE’s DropShadower, a member of a component, holding a path and a cached image…

Yeah I definitely recommend it! I did something very similar to you, but as you said, made it similar to juce::DropShadower. Basically just store a Path object and an associated rendered shadow Image and if the Path ever changes from the one stored, rerender it, etc. Though the stack blur is much faster than Juce’s you still don’t want to be rerendering every paint cycle

-Sent from mobile

2 Likes