Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make extra networks button togglable #8569

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make extra networks button togglable
  • Loading branch information
missionfloyd committed Mar 12, 2023
commit 9e23bacfbcb35f46f28539f71b2bc917276634b8
4 changes: 2 additions & 2 deletions modules/ui_extra_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
7 changes: 7 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}