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
This commit is contained in:
anapnoe
2023-03-11 20:23:55 +02:00
parent 921a49e947
commit a4da344eba
2 changed files with 10 additions and 9 deletions
+7 -8
View File
@@ -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()
+3 -1
View File
@@ -3804,7 +3804,9 @@ input[type=range]::-ms-fill-upper {
display: block;
}
#setting_hidden_tabs{
display:none !important;
}
/*BREAKPOINT_CSS_CONTENT*/