TomaszRewak / C-sharp-console-gui-framework

A GUI framework for C# console applications
MIT License
1.08k stars 45 forks source link

update border explanation #15

Closed kbilsted closed 4 years ago

TomaszRewak commented 4 years ago

I'm not entirely sure if this is the best place to put this statement, as this behavior is actually not limited just to the Border. And it's also a little bit of a simplification. In fact the Border (and this behavior might differ between controls) will always take all of the available space defined by its parent as a minimum size it should take.

Each container will provide its children with a size boundary defined by the MinSize and the MaxSize. Some of the containers (like the Background or Style) will simply propagate their parents' limits to their children. Others (like Margin and Border) will slightly modify those limits based on offsets. And finally, there are also those containers that completely override their parents' limits based on their own layout rules.

So the truth is a little bit more complex. Maybe it would be a good idea to create some kind of a table that would show what would be the size of a control (and its content if its a container) based on its size limits and its content size.

kbilsted commented 4 years ago

good idea.