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

feat(layout): add horizontal and vertical constructors #728

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

joshka
Copy link
Member

@joshka joshka commented Jan 2, 2024

  • feat(layout): add vertical and horizontal constructors
  • docs(layout): document constructors and setters

joshka added 2 commits January 2, 2024 14:52
This commit adds two new constructors to the `Layout` struct, which
allow the user to create a vertical or horizontal layout with default
values.

```rust
let layout = Layout::vertical([
    Constraint::Length(10),
    Constraint::Min(5),
    Constraint::Length(10),
]);

let layout = Layout::horizontal([
    Constraint::Length(10),
    Constraint::Min(5),
    Constraint::Length(10),
]);
```
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b459228) 92.3% compared to head (67c823b) 92.3%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #728   +/-   ##
=====================================
  Coverage   92.3%   92.3%           
=====================================
  Files         48      48           
  Lines      14769   14807   +38     
=====================================
+ Hits       13635   13673   +38     
  Misses      1134    1134           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joshka joshka merged commit 7ab12ed into main Jan 2, 2024
33 checks passed
@joshka joshka deleted the layout-constructors branch January 2, 2024 23:59
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