Cinder-View
Cinder-View copied to clipboard
Adding peripheral layout mode.
I increased the parent view bounds back, just because it shows the different modes and alignments more clearly.
Ah crap, sorry. I messed up the formatting here :( Let me fix.
Understanding the use case here, I'm proposing we add a new Layout
subclass, called BoxLayout
, that can handle fill and justification of each of its subviews (taking the css box model as a concept guide). Things it would handle:
- justification on both axes (left, right, center, top, bottom)
- fill (percent and pixels)
- padding and margin
Going to leave this open for now..
Agreed on BoxLayout. We can close this PR.
After thinking about this for a while, it is likely to be handy in some cases, even with a BoxLayout
for other uses.
I do however think we could use some work on the enum names. For one, I think renaming Mode
to Placement
would clear things up. Also, I propose that instead of DISTRIBUTE
that we call that one CENTERED
, and then instead of PERIPHERIAL
that we use DIVIDED
. Also open to other naming suggestions here.