Popovers icon indicating copy to clipboard operation
Popovers copied to clipboard

The popover show should not be light in Dark Mode

Open MainasuK opened this issue 2 years ago • 6 comments

https://github.com/aheze/Popovers/blob/47b82f57f7b1e56e962cf9047e9b6ceddf52d294/Sources/Templates/Shadow.swift#L26-L31

Hello. I'm try to intergrade a popover for custom SwiftUI control. I notice the shadow template is implement with .label color. This color works well in Light Mode. But for the Dark Mode the shadow color should still be black and we needs elevate the modal background color (from black to gray) to make popover looks like floating.

For example the iPad slide over window:

MainasuK avatar May 27 '22 09:05 MainasuK

Hmm, good point. Should it be .black instead? I can also make it a static var so you can change it

aheze avatar May 27 '22 15:05 aheze

Yes. Black is the correct choice. And that's enough for most of the usages.

That's could be modified now by:

.popoverShadow(shadow: {
    var shadow = Templates.Shadow.system
    shadow.color = Color(.black.withAlphaComponent(0.3))
    return shadow
}())

And opening the modifier is also a good idea.

MainasuK avatar Jun 20 '22 03:06 MainasuK

Hi @aheze, I also would like to ask if it is possible to customize the Template.Container logic for applying shadow as well.

By default it applies Color(.label.withAlphaComponent(0.25)). Could it be done such that if shadow was not provided, we do not automatically pass the shadow?

Otherwise, I could extend Template with another container to modify my own version of container, but I also require the BackgroundWithArrow to be public.

JohnKuan avatar Dec 02 '22 01:12 JohnKuan

@aheze I have created a PR to have some modification to the Container's shadow. https://github.com/aheze/Popovers/pull/62 Let me know if you have any concerns or additional area you would like to replicate this behavior on other areas.

JohnKuan avatar Dec 02 '22 02:12 JohnKuan

@aheze I have created PR for the changes.....Kindly review

kheravarun08 avatar Feb 07 '23 06:02 kheravarun08

Thanks!

aheze avatar Feb 07 '23 08:02 aheze