From 3cd584b35b28f7cad997a52b785528d22a2682f0 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 4 Oct 2024 16:03:14 -0400 Subject: [PATCH] fix en height Signed-off-by: Vladimir Mandic --- modules/shared.py | 2 +- modules/ui_javascript.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/shared.py b/modules/shared.py index d4afea85a..abcfbdbab 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -844,7 +844,7 @@ options_templates.update(options_section(('extra_networks', "Networks"), { "extra_networks_sort": OptionInfo("Default", "Sort order", gr.Dropdown, {"choices": ['Default', 'Name [A-Z]', 'Name [Z-A]', 'Date [Newest]', 'Date [Oldest]', 'Size [Largest]', 'Size [Smallest]']}), "extra_networks_view": OptionInfo("gallery", "UI view", gr.Radio, {"choices": ["gallery", "list"]}), "extra_networks_card_cover": OptionInfo("sidebar", "UI position", gr.Radio, {"choices": ["cover", "inline", "sidebar"]}), - "extra_networks_height": OptionInfo(55, "UI height (%)", gr.Slider, {"minimum": 10, "maximum": 100, "step": 1}), + "extra_networks_height": OptionInfo(0, "UI height (%)", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}), # set in ui_javascript "extra_networks_sidebar_width": OptionInfo(35, "UI sidebar width (%)", gr.Slider, {"minimum": 10, "maximum": 80, "step": 1}), "extra_networks_card_size": OptionInfo(160, "UI card size (px)", gr.Slider, {"minimum": 20, "maximum": 2000, "step": 1}), "extra_networks_card_square": OptionInfo(True, "UI disable variable aspect ratio"), diff --git a/modules/ui_javascript.py b/modules/ui_javascript.py index 4ed7a1ce0..421a7197c 100644 --- a/modules/ui_javascript.py +++ b/modules/ui_javascript.py @@ -57,6 +57,8 @@ def html_css(css: str): usercss = os.path.join(data_path, "user.css") if os.path.exists(os.path.join(data_path, "user.css")) else None if modules.shared.opts.theme_type == 'Standard': + if shared.opts.extra_networks_height == 0: + shared.opts.extra_networks_height = 55 themecss = os.path.join(script_path, "javascript", f"{modules.shared.opts.gradio_theme}.css") if os.path.exists(themecss): head += stylesheet(themecss) @@ -64,6 +66,8 @@ def html_css(css: str): else: modules.shared.log.error(f'UI theme: css="{themecss}" not found') elif modules.shared.opts.theme_type == 'Modern': + if shared.opts.extra_networks_height == 0: + shared.opts.extra_networks_height = 87 theme_folder = next((e.path for e in modules.extensions.extensions if e.name == 'sdnext-modernui'), None) themecss = os.path.join(theme_folder or '', 'themes', f'{modules.shared.opts.gradio_theme}.css') if os.path.exists(themecss):