[go: up one dir, main page]

Skip to content

Commit

Permalink
updated code to use min_... instead of just ...
Browse files Browse the repository at this point in the history
  • Loading branch information
mad-moo committed Aug 14, 2024
1 parent 3d53ec8 commit 1149528
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion rio/components/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def build(self) -> rio.Component:
return rio.Button(
rio.Column(
rio.Text("Click repeatedly to fill up the progress bar"),
rio.ProgressBar(self.clicks / 10, width=15, height=1),
rio.ProgressBar(self.clicks / 10, min_width=15, min_height=1),
),
on_press=self._on_button_press,
)
Expand Down
4 changes: 2 additions & 2 deletions rio/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,8 @@ def build_content() -> rio.Component:
rio.Icon(
icon,
fill=self.session.theme.heading2_style.fill,
width=icon_size,
height=icon_size,
min_width=icon_size,
min_height=icon_size,
)
)

Expand Down
4 changes: 2 additions & 2 deletions rio/components/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class Icon(FundamentalComponent):
rio.Icon(
"material/castle",
fill=rio.Color.from_hex("ff0000"),
height=2.5,
width=2.5,
min_height=2.5,
min_width=2.5,
)
```
"""
Expand Down
8 changes: 4 additions & 4 deletions rio/components/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class Image(FundamentalComponent):
rio.Image(
Path("example_image.png"),
fill_mode="fit",
width=20,
height=20,
min_width=20,
min_height=20,
corner_radius=2,
)
```
Expand All @@ -98,8 +98,8 @@ class Image(FundamentalComponent):
rio.Image(
Path(self.session.assets / "example_image.png"),
fill_mode="fit",
width=20,
height=20,
min_width=20,
min_height=20,
corner_radius=2,
)
```
Expand Down
4 changes: 2 additions & 2 deletions rio/components/scroll_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class ScrollContainer(FundamentalComponent):
```python
rio.ScrollContainer(
content=rio.Icon("material/castle", width=50, height=50),
height=10,
content=rio.Icon("material/castle", min_width=50, min_height=50),
min_height=10,
)
```
"""
Expand Down
12 changes: 6 additions & 6 deletions rio/components/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ class Stack(FundamentalComponent):
# bottom
rio.Icon(
"material/castle",
width=50,
height=50,
min_width=50,
min_height=50,
fill=rio.Color.from_hex("00ff00"),
),
# middle
rio.Icon(
"material/castle",
width=30,
height=30,
min_width=30,
min_height=30,
fill=rio.Color.from_hex("ff0000"),
),
# top
rio.Icon(
"material/castle",
width=10,
height=10,
min_width=10,
min_height=10,
fill=rio.Color.from_hex("000000"),
),
)
Expand Down
2 changes: 1 addition & 1 deletion rio/components/switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def build(self) -> rio.Component:
content = (
rio.Rectangle(
fill=rio.Color.from_hex("00bf63"),
height=12,
min_height=12,
)
if self.show_content
else None # No content if show_content is False
Expand Down
2 changes: 1 addition & 1 deletion rio/debug/dev_tools/layout_subpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def _build_margin_controls(self) -> rio.Component:
),
3,
0,
width=3,
min_width=3,
)

return result
Expand Down

0 comments on commit 1149528

Please sign in to comment.