Skip to content

Commit

Permalink
moved into custom_radio component
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Dec 30, 2023
1 parent 745f13b commit 13090d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion gooey_ui/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ def custom_radio(
*,
disabled: bool = False,
label_visibility: LabelVisibility = "visible",
custom: dict,
) -> T | None:
if not key:
key = md5_values("custom_radio", label, options, help, label_visibility)
Expand All @@ -677,6 +676,17 @@ def custom_radio(
validate_value=False,
)
is_custom = value not in options
custom = {
"label": "Custom",
"input": lambda label, key: number_input(
label=label,
min_value=1,
max_value=60,
step=1,
key=key,
style={"margin-top": "-28px"},
),
}
with div(className="d-flex", style={"gap": "1ch", "flex-direction": "row-reverse"}):
with div(className="flex-grow-1"):
state.session_state.setdefault(f"custom-{key}", value)
Expand Down
11 changes: 0 additions & 11 deletions recipes/DeforumSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,6 @@ def render_settings(self):
"24": "Film: 24 FPS",
}[str(x)],
key="fps",
custom={
"label": "Custom",
"input": lambda label, key: st.number_input(
label=label,
min_value=1,
max_value=60,
step=1,
key=key,
style={"margin-top": "-28px"},
),
},
)

# st.selectbox(
Expand Down

0 comments on commit 13090d4

Please sign in to comment.