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: Implement add a “align” parameter for ui.inline #2

Merged
merged 14 commits into from
Dec 6, 2022

Conversation

Nicolapps
Copy link

@Nicolapps Nicolapps commented Dec 3, 2022

This PR adds a new align parameter to ui.inline that allows users to specify the vertical alignment of the items.

The API is updated as follows:

 interface Inline {
   /** The components laid out inline. */
   items: Component[]
   /** Specifies how to lay out the individual components. Defaults to 'start'. */
   justify?: 'start' | 'end' | 'center' | 'between' | 'around'
+  /** Specifies how the individual components are aligned on the vertical axis. Defaults to 'center'. */
+  align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
   /** Whether to display the components inset from the parent form, with a contrasting background. */
   inset?: B
 }

The PR also adds a new example showing how values for the justify and align parameters of ui.inline work:

ui_inline_demo.mov

I also renamed the alignment parameter of the internal function XComponents to justify (more details here: 08d6813).

Closes 1535.

@Nicolapps Nicolapps marked this pull request as ready for review December 5, 2022 07:46
Copy link

@monal20 monal20 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Note that I looked over the files in ui/src and examples.

@monal20 monal20 merged commit 2115502 into extreme-sharks:master Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants