From 9e23bacfbcb35f46f28539f71b2bc917276634b8 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Sun, 12 Mar 2023 17:07:03 -0600 Subject: [PATCH] Make extra networks button togglable --- modules/ui_extra_networks.py | 4 ++-- style.css | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 01df5e90..50e2093e 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -219,10 +219,10 @@ def create_ui(container, button, tabname): def toggle_visibility(is_visible): is_visible = not is_visible - return is_visible, gr.update(visible=is_visible) + return is_visible, gr.update(visible=is_visible), gr.update(variant=("primary" if is_visible else "tool")) state_visible = gr.State(value=False) - button.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container]) + button.click(fn=toggle_visibility, inputs=[state_visible], outputs=[state_visible, container, button]) def refresh(): res = [] diff --git a/style.css b/style.css index 2f26ad02..e82aebf3 100644 --- a/style.css +++ b/style.css @@ -968,3 +968,10 @@ footer { [id*='_prompt_container'] > div { margin: 0!important; } + +button[id$='_extra_networks'] { + margin: 0.6em 0em 0.55em 0; + max-width: 2.5em; + min-width: 2.5em !important; + height: 2.4em; +}