diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-03-21 05:18:14 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-03-25 06:00:37 +0000 |
commit | 43a0912a07376fd045095de0fea54de098b113ef (patch) | |
tree | 5c06bad2cde8560b31d27cc97822d27fcbb67d82 /modules/scripts.py | |
parent | 9b2f20540004c47733ee47fb6bf58a41161ac0da (diff) | |
download | stable-diffusion-webui-gfx803-43a0912a07376fd045095de0fea54de098b113ef.tar.gz stable-diffusion-webui-gfx803-43a0912a07376fd045095de0fea54de098b113ef.tar.bz2 stable-diffusion-webui-gfx803-43a0912a07376fd045095de0fea54de098b113ef.zip |
hide delete button for single-item dropdown
more stylistic changes
Diffstat (limited to 'modules/scripts.py')
-rw-r--r-- | modules/scripts.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/scripts.py b/modules/scripts.py index 40d8dcc6..8f55cf24 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -513,6 +513,18 @@ def reload_scripts(): scripts_postproc = scripts_postprocessing.ScriptPostprocessingRunner()
+def add_classes_to_gradio_component(comp):
+ """
+ this adds gradio-* to the component for css styling (ie gradio-button to gr.Button), as well as some others
+ """
+
+ comp.elem_classes = ["gradio-" + comp.get_block_name(), *(comp.elem_classes or [])]
+
+ if getattr(comp, 'multiselect', False):
+ comp.elem_classes.append('multiselect')
+
+
+
def IOComponent_init(self, *args, **kwargs):
if scripts_current is not None:
scripts_current.before_component(self, **kwargs)
@@ -521,8 +533,7 @@ def IOComponent_init(self, *args, **kwargs): res = original_IOComponent_init(self, *args, **kwargs)
- # this adds gradio-* to every component for css styling (ie gradio-button to gr.Button)
- self.elem_classes = ["gradio-" + self.get_block_name(), *(self.elem_classes or [])]
+ add_classes_to_gradio_component(self)
script_callbacks.after_component_callback(self, **kwargs)
|