IgnaceMaes / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
2.9k stars 838 forks source link

Light and Shadow? #81

Open corliss opened 8 years ago

corliss commented 8 years ago

A major design principle of Material Design is Light and Shadow. Currently MaterialSkin does not implement any lighting or shadow effects. Is this planned?

IgnaceMaes commented 8 years ago

MaterialSkin components currently all have the property Depth that describes this. However, this hasn't been implemented yet.

The difficulty is that all controls take care of their own rendering. Shadows, described with depth, should be caluclated relatively. e.g. if control with depth 4 'sits' on a control with depth 2 the shadow should be less hard than when it would be placed on a control with depth 0. This makes the calculation harder.

You could decide not to calculate depths relatively, but there would still be a though difficulty. Controls can't draw out of their bounds.

What I'm thinking of right now is creating a sort of 'Depth Container Control' that would wrap any MaterialSkin component and that would handle the depth.

I see MaterialSkin as a secondary project for me, so I do not have anything planned myself to work on it.

MikeGWem commented 8 years ago

As pointed out above, shadow effects need to be implemented by the container for any controls requiring such effects. I have implemented a simple approach to support "card" like objects built from panels and posted the code to StackOverflow here http://stackoverflow.com/questions/2463519/drop-shadow-in-winforms-controls in response to a 6 year old question on the subject.