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

fix: button group align #917

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugins/ui/src/deephaven/ui/components/button_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Orientation,
# Layout
AlignSelf,
ButtonGroupAlignment,
CSSProperties,
DimensionValue,
JustifySelf,
Expand All @@ -19,7 +20,7 @@ def button_group(
*children: Any,
is_disabled: bool | None = None,
orientation: Orientation = "horizontal",
alignment: AlignSelf = "start",
align: ButtonGroupAlignment = "start",
flex: LayoutFlex | None = None,
flex_grow: float | None = None,
flex_shrink: float | None = None,
Expand Down Expand Up @@ -68,7 +69,7 @@ def button_group(
*children: The children of the button group.
is_disabled: Whether the button group is disabled.
orientation: The axis the ButtonGroup should align with. Setting this to 'vertical' will prevent any switching behaviours between 'vertical' and horizontal'.
alignment: The alignment of the buttons within the ButtonGroup.
align: The alignment of the buttons within the ButtonGroup.
flex: When used in a flex layout, specifies how the element will grow or shrink to fit the space available.
flex_grow: When used in a flex layout, specifies how the element will grow to fit the space available.
flex_shrink: When used in a flex layout, specifies how the element will shrink to fit the space available.
Expand Down Expand Up @@ -109,7 +110,7 @@ def button_group(
*children,
is_disabled=is_disabled,
orientation=orientation,
alignment=alignment,
align=align,
flex=flex,
flex_grow=flex_grow,
flex_shrink=flex_shrink,
Expand Down
2 changes: 2 additions & 0 deletions plugins/ui/src/deephaven/ui/components/types/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@

Alignment = Literal["start", "end"]

ButtonGroupAlignment = Literal["start", "center", "end"]

LayoutFlex = Union[str, float, bool]
"""
The flex CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container.
Expand Down
Loading