Cinder-View icon indicating copy to clipboard operation
Cinder-View copied to clipboard

Adding peripheral layout mode.

Open num3ric opened this issue 8 years ago • 4 comments

peripheral_mode

I increased the parent view bounds back, just because it shows the different modes and alignments more clearly.

num3ric avatar Oct 20 '16 18:10 num3ric

Ah crap, sorry. I messed up the formatting here :( Let me fix.

num3ric avatar Oct 20 '16 18:10 num3ric

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..

richardeakin avatar Oct 20 '16 20:10 richardeakin

Agreed on BoxLayout. We can close this PR.

num3ric avatar Oct 25 '16 16:10 num3ric

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.

richardeakin avatar Nov 22 '16 02:11 richardeakin