infinitered / infinitered/rmq

distribute(:horizontal, alignment: :centered)

Open
#166 10 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
HTML
Stars
305
Forks
51
PR merge metrics
No merged PRs in 30d

Description

@markrickert and I were discussing this.

So layout has `centered: :horizontal` and such, but if you apply a layout to a set of views, it will get applied to each individually. But sometimes you want to apply something like that to a group of views. Dealing with groups is what `distribute` is good at. So the idea is to add some new params to `distribute` to handle this.

Perhaps this is overloading `distribute` too much and we should make a `group_layout` instead.

Something like this:

```
[ [a] [ b ] [c] ]
```

Then this

``` ruby
rmq(a,b,c).distribute(:horizontal, margin: 5, alignment: :centered)
```

Does this

```
[ [a] [ b ] [c] ]
```

Or this

``` ruby
rmq(a,b,c).distribute(:horizontal, margin: 5, alignment: :right)
```

Does this

```
[ [a] [ b ] [c] ]
```

^ in this case, does a 5 margin get applied between [c] and the parent's right?

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by locating the existing distribute implementation and the centered layout behavior, then resolve whether this belongs in distribute or a separate group_layout API. Done should match the requested horizontal alignment and margin behavior, with tests covering the shown alignment cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.