euporie.core.layout.containers
Overrides for PTK containers which only render visible lines.
Functions
|
Turn a list of (style_str, text) tuples into another list where each string is exactly one character. |
|
Return the character width of this text fragment list. |
|
Get the current active (running) Application. |
|
Return width of a string. |
|
Convert the given value (which can be formatted text) into a list of text fragments. |
|
Turn callable or string into string. |
Classes
|
A write position which also hold bounding box information. |
Base class for user interface layout. |
|
|
A tuple of four integers with directions. |
|
Specified dimension (width/height) of a user control or window. |
A dummy control object that doesn't paint any content. |
|
|
Fast, lightweight cache which keeps at most size items. |
|
A FloatContainer which uses :py`BoundedWritePosition`s. |
|
Control that displays formatted text. |
|
Several layouts, one stacked above/under the other. |
|
Alignment for VSplit. |
|
Mouse event, sent to UIControl.mouse_handler. |
|
|
|
|
alias of |
|
|
Content generated by a user control. |
|
Several layouts, one stacked left/right of the other. |
|
Alignment for HSplit. |
|
Container that holds a control. |
|
Alignment of the Window content. |
|
Render information for the last render time of this control. |
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. |
- class euporie.core.layout.containers.FloatContainer(content: AnyContainer, floats: list[Float], modal: bool = False, key_bindings: KeyBindingsBase | None = None, style: str | Callable[[], str] = '', z_index: int | None = None)
Bases:
FloatContainer
A FloatContainer which uses :py`BoundedWritePosition`s.
- get_children() list[prompt_toolkit.layout.containers.Container]
Return the list of child
Container
objects.
- get_key_bindings() prompt_toolkit.key_binding.key_bindings.KeyBindingsBase | None
Returns a
KeyBindings
object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal.
- is_modal() bool
When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused.
- preferred_height(width: int, max_available_height: int) Dimension
Return the preferred height of the float container. (We don’t care about the height of the floats, they should always fit into the dimensions provided by the container.)
- preferred_width(max_available_width: int) Dimension
Return a
Dimension
that represents the desired width for this container.
- reset() None
Reset the state of this container and all the children. (E.g. reset scroll offsets, etc…)
- write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Write the actual content to the screen.
- Parameters:
screen –
Screen
mouse_handlers –
MouseHandlers
.parent_style – Style string to pass to the
Window
object. This will be applied to all content of the windows.VSplit
andHSplit
can use it to pass their style down to the windows that they contain.z_index – Used for propagating z_index from parent to child.
- class euporie.core.layout.containers.HSplit(children: Sequence[AnyContainer], window_too_small: Container | None = None, align: VerticalAlign = VerticalAlign.JUSTIFY, padding: AnyDimension = 0, padding_char: str | None = None, padding_style: str = '', width: AnyDimension = None, height: AnyDimension = None, z_index: int | None = None, modal: bool = False, key_bindings: KeyBindingsBase | None = None, style: str | Callable[[], str] = '')
Bases:
HSplit
Several layouts, one stacked above/under the other.
- get_children() list[prompt_toolkit.layout.containers.Container]
Return the list of child
Container
objects.
- get_key_bindings() prompt_toolkit.key_binding.key_bindings.KeyBindingsBase | None
Returns a
KeyBindings
object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal.
- is_modal() bool
When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused.
- preferred_height(width: int, max_available_height: int) Dimension
Return a
Dimension
that represents the desired height for this container.
- preferred_width(max_available_width: int) Dimension
Return a
Dimension
that represents the desired width for this container.
- reset() None
Reset the state of this container and all the children. (E.g. reset scroll offsets, etc…)
- write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Render the prompt to a Screen instance.
- Parameters:
screen – The
Screen
class to which the output has to be written.
- class euporie.core.layout.containers.VSplit(children: Sequence[AnyContainer], window_too_small: Container | None = None, align: HorizontalAlign = HorizontalAlign.JUSTIFY, padding: AnyDimension = 0, padding_char: str | None = None, padding_style: str = '', width: AnyDimension = None, height: AnyDimension = None, z_index: int | None = None, modal: bool = False, key_bindings: KeyBindingsBase | None = None, style: str | Callable[[], str] = '')
Bases:
VSplit
Several layouts, one stacked left/right of the other.
- get_children() list[prompt_toolkit.layout.containers.Container]
Return the list of child
Container
objects.
- get_key_bindings() prompt_toolkit.key_binding.key_bindings.KeyBindingsBase | None
Returns a
KeyBindings
object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal.
- is_modal() bool
When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused.
- preferred_height(width: int, max_available_height: int) Dimension
Return a
Dimension
that represents the desired height for this container.
- preferred_width(max_available_width: int) Dimension
Return a
Dimension
that represents the desired width for this container.
- reset() None
Reset the state of this container and all the children. (E.g. reset scroll offsets, etc…)
- write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Render the prompt to a Screen instance.
- Parameters:
screen – The
Screen
class to which the output has to be written.
- class euporie.core.layout.containers.Window(*args: Any, **kwargs: Any)
Bases:
Window
Container that holds a control.
- get_children() list[prompt_toolkit.layout.containers.Container]
Return the list of child
Container
objects.
- get_key_bindings() prompt_toolkit.key_binding.key_bindings.KeyBindingsBase | None
Returns a
KeyBindings
object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal.
- is_modal() bool
When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused.
- preferred_height(width: int, max_available_height: int) Dimension
Calculate the preferred height for this window.
- preferred_width(max_available_width: int) Dimension
Calculate the preferred width for this window.
- reset() None
Reset the state of this container and all the children. (E.g. reset scroll offsets, etc…)
- write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Write window to screen.