Popovers
Popovers copied to clipboard
The popover show should not be light in Dark Mode
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:
![](https://user-images.githubusercontent.com/7940186/170676735-f61ea02a-ecbf-48ba-94a2-5662d7786b80.jpeg)
Hmm, good point. Should it be .black
instead? I can also make it a static var
so you can change it
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.
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.
@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.
@aheze I have created PR for the changes.....Kindly review
Thanks!