mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
Some fixes to disabled buttons (#3288)
* Fixes to button disable * button * formatting * fixes * formatter
This commit is contained in:
parent
5df113a4d6
commit
06c4cd705f
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## New Features:
|
## New Features:
|
||||||
- Updated image upload component to accept all image formats, including lossless formats like .webp by [@fienestar](https://github.com/fienestar) in [PR 3225](https://github.com/gradio-app/gradio/pull/3225)
|
- Updated image upload component to accept all image formats, including lossless formats like .webp by [@fienestar](https://github.com/fienestar) in [PR 3225](https://github.com/gradio-app/gradio/pull/3225)
|
||||||
- Adds a disabled mode to the `gr.Button` component by setting `interactive=False` by [@abidlabs](https://github.com/abidlabs) in [PR 3266](https://github.com/gradio-app/gradio/pull/3266)
|
- Adds a disabled mode to the `gr.Button` component by setting `interactive=False` by [@abidlabs](https://github.com/abidlabs) in [PR 3266](https://github.com/gradio-app/gradio/pull/3266) and [PR 3288](https://github.com/gradio-app/gradio/pull/3288)
|
||||||
|
|
||||||
|
|
||||||
## Bug Fixes:
|
## Bug Fixes:
|
||||||
|
@ -2945,13 +2945,13 @@ class Button(Clickable, IOComponent, SimpleSerializable):
|
|||||||
visible: bool | None = None,
|
visible: bool | None = None,
|
||||||
interactive: bool | None = None,
|
interactive: bool | None = None,
|
||||||
):
|
):
|
||||||
return {
|
updated_config = {
|
||||||
"variant": variant,
|
"variant": variant,
|
||||||
"visible": visible,
|
"visible": visible,
|
||||||
"value": value,
|
"value": value,
|
||||||
"interactive": interactive,
|
|
||||||
"__type__": "update",
|
"__type__": "update",
|
||||||
}
|
}
|
||||||
|
return IOComponent.add_interactive_to_config(updated_config, interactive)
|
||||||
|
|
||||||
def style(self, *, full_width: bool | None = None, **kwargs):
|
def style(self, *, full_width: bool | None = None, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -886,8 +886,8 @@ def tex2svg(formula, *args):
|
|||||||
svg_start = xml_code.index("<svg ")
|
svg_start = xml_code.index("<svg ")
|
||||||
svg_code = xml_code[svg_start:]
|
svg_code = xml_code[svg_start:]
|
||||||
svg_code = re.sub(r"<metadata>.*<\/metadata>", "", svg_code, flags=re.DOTALL)
|
svg_code = re.sub(r"<metadata>.*<\/metadata>", "", svg_code, flags=re.DOTALL)
|
||||||
svg_code = re.sub(r' width="[^"]+"', '', svg_code)
|
svg_code = re.sub(r' width="[^"]+"', "", svg_code)
|
||||||
svg_code = re.sub(r' height="[^"]+"', '', svg_code)
|
svg_code = re.sub(r' height="[^"]+"', "", svg_code)
|
||||||
copy_code = f"<span style='font-size: 0px'>{formula}</span>"
|
copy_code = f"<span style='font-size: 0px'>{formula}</span>"
|
||||||
return f"{copy_code}{svg_code}"
|
return f"{copy_code}{svg_code}"
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
button[disabled] {
|
button[disabled] {
|
||||||
|
opacity: 0.5;
|
||||||
|
filter: grayscale(30%);
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user