[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449
Open
DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Open
[JEWEL-1285] Update JDialogRenderer to Support Custom Window Shape#3449DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Conversation
3c9e719 to
3a663ea
Compare
add missing jbpopuprenderer to commits
3a663ea to
e113bc8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
During the development of the Got It component, we ran into a limitation of our current
JDialogRenderer. Currently, it can only render windows with rounded corners. While this works perfectly for menus and other types of popups, it fails to provide the best UX for the Got It component since it has a custom shape.So, this PR paves the way so that our Got It component can be rendered in all its glory!
Changes
Popupthat takewindowShape: ((IntSize) -> java.awt.Shape)? = null,. Deprecated variations without it.windowShape: ((IntSize) -> java.awt.Shape)? = null,lambda parameter toPopupRendererand passed it down to bothJDialogRendererandJBPopupRendererJDialogRenderercode to apply the custom window shape defined by the factory lambda if:compose.interop.blendingis disabledwindowShapeis not nullDemo
Screen.Recording.2026-03-05.at.16.08.49.mov
Closeup of Jagged Arrow Shape
Note
Keep in mind this only ever happens if users provide a custom shape via the new factory parameter AND don't enable
compose.interop.blending!Curiously, this minor artifact is not present when the arrow is to the right. No idea why, though.
Release notes
New features
Popupis available which take awindowShapefactory. With this, you can create a custom shape that'll be applied to the window which holds the popup. Bear in mind that this factory is only useful in the following scenario:jewel.customPopupRenderflag enabledcompose.interop.blendingenabledWindowTranslucencycan't render concave corners properly since it forces pixels to be either completely off or on. This means that depending on your custom shape, you can have jagged edges. For this reason, it's highly encouraged to also enablecompose.interop.blendingin your system properties.Deprecated API
Popupcomponents without thewindowShapeparameter are now deprecated.