Skip to content

Commit

Permalink
fix button group align
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Oct 1, 2024
1 parent 94206d8 commit ff69212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit ff69212

Please sign in to comment.