Skip to content

Commit

Permalink
Update dialogs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JKLs12 authored Jan 30, 2025
1 parent 165258d commit 56ac7ec
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/prompt_toolkit/shortcuts/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
from prompt_toolkit.key_binding.bindings.focus import focus_next, focus_previous
from prompt_toolkit.key_binding.defaults import load_key_bindings
from prompt_toolkit.key_binding.key_bindings import KeyBindings, merge_key_bindings
from prompt_toolkit.layout import Layout
from prompt_toolkit.layout import Layout, Float, FloatContainer
from prompt_toolkit.layout.containers import AnyContainer, HSplit
from prompt_toolkit.layout.dimension import Dimension as D
from prompt_toolkit.layout.menus import CompletionsMenu
from prompt_toolkit.styles import BaseStyle
from prompt_toolkit.validation import Validator
from prompt_toolkit.widgets import (
Expand Down Expand Up @@ -143,10 +144,28 @@ def ok_handler() -> None:
body=HSplit(
[
Label(text=text, dont_extend_height=True),
textfield,
ValidationToolbar(),
FloatContainer(
HSplit(
[
textfield
],
height=D(min=8, preferred=10, max=16)
),
[
Float(
xcursor=True,
ycursor=True,
transparent=True,
content=CompletionsMenu(
max_height=16,
scroll_offset=1
)
)
]
),
ValidationToolbar()
],
padding=D(preferred=1, max=1),
padding=D(preferred=1, max=1)
),
buttons=[ok_button, cancel_button],
with_background=True,
Expand Down

0 comments on commit 56ac7ec

Please # to comment.