Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
08838105
Commit
08838105
authored
Aug 10, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment for InputAccordion
parent
faca8662
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
modules/ui_components.py
modules/ui_components.py
+18
-0
No files found.
modules/ui_components.py
View file @
08838105
...
...
@@ -74,6 +74,11 @@ class DropdownEditable(FormComponent, gr.Dropdown):
class
InputAccordion
(
gr
.
Checkbox
):
"""A gr.Accordion that can be used as an input - returns True if open, False if closed.
Actaully just a hidden checkbox, but creates an accordion that follows and is followed by the state of the checkbox.
"""
global_index
=
0
def
__init__
(
self
,
value
,
**
kwargs
):
...
...
@@ -91,6 +96,19 @@ class InputAccordion(gr.Checkbox):
self
.
accordion
=
gr
.
Accordion
(
kwargs
.
get
(
'label'
,
'Accordion'
),
open
=
value
,
elem_id
=
self
.
accordion_id
,
elem_classes
=
[
'input-accordion'
])
def
extra
(
self
):
"""Allows you to put something into the label of the accordion.
Use it like this:
```
with InputAccordion(False, label="Accordion") as acc:
with acc.extra():
FormHTML(value="hello", min_width=0)
...
```
"""
return
gr
.
Column
(
elem_id
=
self
.
accordion_id
+
'-extra'
,
elem_classes
=
'input-accordion-extra'
,
min_width
=
0
)
def
__enter__
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment