aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-03-21 08:18:14 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-03-21 08:18:14 +0300
commitf93547be18641039aca24e8166f0ed7d495da15e (patch)
tree808389d985d29cbe5f84aa846f58985a97ac3dbf /modules
parent46482decd5ec7c15811e1db5f992b0f616472cfe (diff)
hide delete button for single-item dropdown
more stylistic changes
Diffstat (limited to 'modules')
-rw-r--r--modules/scripts.py15
-rw-r--r--modules/ui.py2
-rw-r--r--modules/ui_common.py2
3 files changed, 16 insertions, 3 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)
diff --git a/modules/ui.py b/modules/ui.py
index 6e0ac89f..c5b0e876 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1601,11 +1601,13 @@ def create_ui():
for i, k, item in quicksettings_list:
component = component_dict[k]
+ info = opts.data_labels[k]
component.change(
fn=lambda value, k=k: run_settings_single(value, key=k),
inputs=[component],
outputs=[component, text_settings],
+ show_progress=info.refresh is not None,
)
text_settings.change(
diff --git a/modules/ui_common.py b/modules/ui_common.py
index d4e00829..7b752b45 100644
--- a/modules/ui_common.py
+++ b/modules/ui_common.py
@@ -129,7 +129,7 @@ Requested path was: {f}
generation_info = None
with gr.Column():
- with gr.Row(elem_id=f"image_buttons_{tabname}"):
+ with gr.Row(elem_id=f"image_buttons_{tabname}", elem_classes="image-buttons"):
open_folder_button = gr.Button(folder_symbol, visible=not shared.cmd_opts.hide_ui_dir_config)
if tabname != "extras":