Skip to content

Conversation

faogustavo
Copy link
Collaborator

  • Disabled native shadow APIs for JBPopupRenderer and JDialogRenderer
  • Using the drop shadow API to replicate the same UI style

Evidences

Where Before Swing Shadow CfD Drop Shadow
IDE - image image
Stand Alone image image image

Shadow(
radius = style.metrics.shadowSize,
color = colors.shadow,
offset = DpOffset(0.dp, style.metrics.shadowSize / 2),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Swing, it was using the same size from the shadow as the offset, to prevent shadow on top.

On this Compose call, only half of the value is needed to reproduce the desired UI.

full size base-line half size
Image Image Image

.setCancelOnClickOutside(currentProperties.dismissOnClickOutside)
.setCancelOnWindowDeactivation(currentProperties.dismissOnClickOutside)
.setLocateWithinScreenBounds(false)
.setShowShadow(false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right approach — we should use the same shadow that other popups do (which is drawn by the OS, now Swing).

Us drawing our own shadow is the right choice only when we're not using native popups. It's a fallback.

If the native popups don't show shadows, I think the issue may be in CMP clipping it out (that famous custom property I keep asking you about and that I do not think should be at all necessary for native popups!)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to make sure we only use it when the native pop-up flag is disabled.

Swing Compose
image image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :) Does the native popup shadow work now, or do we still need a separate bug for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be good. I'll boot the Windows/Linux VMs to ensure it works on other platforms as well. But all CMP and Native shadows should have the same appearance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's not working because we need to use the 'Undecorated' window type to hide the navigation bar. I'll check if there are other ways to achieve similar results.

The "Window.shadow" property only applies to MacOS :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants