Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
114
Issue boards
Milestones
Wiki
Code
Merge requests
22
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
clive
Merge requests
!3
Preliminary version of Form, some performance fixes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Preliminary version of Form, some performance fixes
mzebrak/form-example
into
develop
Overview
0
Commits
15
Pipelines
1
Changes
24
Merged
Mateusz Żebrak
requested to merge
mzebrak/form-example
into
develop
1 year ago
Overview
0
Commits
15
Pipelines
1
Changes
24
Expand
Requires:
!2 (merged)
Edited
1 year ago
by
Mateusz Żebrak
0
0
Merge request reports
Compare
develop
version 1
3c91c33a
1 year ago
develop (base)
and
latest version
latest version
3c91c33a
15 commits,
1 year ago
version 1
3c91c33a
64 commits,
1 year ago
24 files
+
559
−
61
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
24
Search (e.g. *.vue) (Ctrl+P)
clive/ui/components/buttons_menu.py
+
10
−
4
Options
from
__future__
import
annotations
from
abc
import
ABC
,
abstractmethod
from
typing
import
TYPE_CHECKING
,
Sequence
from
typing
import
TYPE_CHECKING
,
Any
,
Sequence
,
TypeVar
from
prompt_toolkit.layout
import
HorizontalAlign
,
VSplit
from
prompt_toolkit.widgets
import
Button
@@ -11,12 +11,14 @@ from clive.ui.component import Component
if
TYPE_CHECKING
:
from
prompt_toolkit.key_binding
import
KeyBindings
T
=
TypeVar
(
"
T
"
,
bound
=
Component
[
Any
])
class
ButtonsMenu
(
Component
,
ABC
):
def
__init__
(
self
)
->
None
:
class
ButtonsMenu
(
Component
[
T
],
ABC
):
def
__init__
(
self
,
parent
:
T
)
->
None
:
self
.
_buttons
=
self
.
_create_buttons
()
self
.
_key_bindings
=
self
.
_get_key_bindings
()
super
().
__init__
()
super
().
__init__
(
parent
)
def
_create_container
(
self
)
->
VSplit
:
return
VSplit
(
@@ -25,6 +27,10 @@ class ButtonsMenu(Component, ABC):
padding
=
1
,
)
@property
def
key_bindings
(
self
)
->
KeyBindings
:
return
self
.
_key_bindings
@abstractmethod
def
_create_buttons
(
self
)
->
Sequence
[
Button
]:
"""
Creates buttons for the component.
"""
Loading