From a4da344ebaab687e751caa249e40248312f778e6 Mon Sep 17 00:00:00 2001 From: anapnoe <124302297+anapnoe@users.noreply.github.com> Date: Sat, 11 Mar 2023 20:23:55 +0200 Subject: [PATCH] hidden tabs already implemented no need to restart the ui I just keep it hidden so in the next merge I don't have to fix it why people use python to hide some buttons I don't understand this is a single page app if for example you don't create at all the img2img interface and you send from txt2img or pngInfo commands to a non existing interface what you think it should happen ? please use javascript to modify the view on the client side not python --- modules/ui.py | 15 +++++++-------- style.css | 4 +++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/ui.py b/modules/ui.py index 974c0eea..0dc0f769 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1711,9 +1711,10 @@ def create_ui(): # print(selected) # return gr.Tabs.update(selected=selected) - shared.tab_names = [] - for _interface, label, _ifid in interfaces: - shared.tab_names.append(label) + + # shared.tab_names = [] + # for _interface, label, _ifid in interfaces: + # shared.tab_names.append(label) with gr.Blocks(css=css, analytics_enabled=False, title="Stable Diffusion") as demo: @@ -1745,17 +1746,15 @@ def create_ui(): parameters_copypaste.connect_paste_params_buttons() with gr.Tabs(elem_id="tabs") as tabs: - - # with gr.Row(elem_id="nav_menu_header_tabs"): # for interface, label, ifid in interfaces: # btn = gr.Button(label, elem_id='tab_clone_' + ifid) # btn.click(change_tab, btn, tabs) for interface, label, ifid in interfaces: - if label in shared.opts.hidden_tabs: - continue - + # if label in shared.opts.hidden_tabs: + # continue + with gr.TabItem(label, id=ifid, elem_id='tab_' + ifid): interface.render() diff --git a/style.css b/style.css index fcc30a29..e59dee1e 100644 --- a/style.css +++ b/style.css @@ -3804,7 +3804,9 @@ input[type=range]::-ms-fill-upper { display: block; } - +#setting_hidden_tabs{ + display:none !important; +} /*BREAKPOINT_CSS_CONTENT*/ \ No newline at end of file