Reputation: 6152
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.
Upvotes: 7
Views: 448
Reputation: 41801
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.
Upvotes: 3
Reputation: 19860
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:
Upvotes: 4