aboutsummaryrefslogtreecommitdiff
path: root/modules/ui_components.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ui_components.py')
-rw-r--r--modules/ui_components.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/ui_components.py b/modules/ui_components.py
index 97acff06..9aec3097 100644
--- a/modules/ui_components.py
+++ b/modules/ui_components.py
@@ -11,6 +11,16 @@ class ToolButton(gr.Button, gr.components.FormComponent):
return "button"
+class ToolButtonTop(gr.Button, gr.components.FormComponent):
+ """Small button with single emoji as text, with extra margin at top, fits inside gradio forms"""
+
+ def __init__(self, **kwargs):
+ super().__init__(variant="tool-top", **kwargs)
+
+ def get_block_name(self):
+ return "button"
+
+
class FormRow(gr.Row, gr.components.FormComponent):
"""Same as gr.Row but fits inside gradio forms"""
@@ -37,3 +47,4 @@ class FormColorPicker(gr.ColorPicker, gr.components.FormComponent):
def get_block_name(self):
return "colorpicker"
+