Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding peripheral layout mode. #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

num3ric
Copy link
Contributor

@num3ric num3ric commented Oct 20, 2016

peripheral_mode

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

@num3ric
Copy link
Contributor Author

num3ric commented Oct 20, 2016

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

@richardeakin
Copy link
Owner

richardeakin commented Oct 20, 2016

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

@num3ric
Copy link
Contributor Author

num3ric commented Oct 25, 2016

Agreed on BoxLayout. We can close this PR.

@richardeakin
Copy link
Owner

richardeakin commented Nov 22, 2016

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 richardeakin changed the base branch from layout to master January 26, 2017 00:21
@richardeakin richardeakin reopened this Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants