I would like to emulate the default shadow applied to NSWindows with a CALayer shadow. I can't quite figure out the exact values for the the following properties though:
theLayer.shadowOffset = ?;
theLayer.shadowRadius = ?;
theLayer.shadowOpacity = ?;
I assume that the shadowColor is black (the default).
Does anyone have an idea what those values could be to get a native (Snow) Leopard window shadow?
EDIT:
To clarify, I'm asking if there's any system API that can give me those values. I don't want to hard code those values, as they have changed in the past and probably will change again at some point in the future.
First, it depends on if a window is in background or in foreground. Windows in foreground have a bigger shadow compared to windows in the background.
For foreground windows you could try the following values:
A word of warning: the window shadow values have changed before (from Leopard to Snow Leopard), so hardcoding values will likely end up looking off in future OS versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With