euporie.core.layout.decor

Decorative widgets.

Functions

get_app()

Get the current active (running) Application.

has_focus(value)

Enable when this buffer has the focus.

to_container(container)

Make sure that the given object is a Container.

Classes

Char([char, style])

Represent a single character in a Screen.

ColorPaletteColor(base[, _base_override])

A representation of a color with adjustment methods.

Container()

Base class for user interface layout.

Dimension([min, max, weight, preferred])

Specified dimension (width/height) of a user control or window.

DropShadow([amount])

A transparent container which makes the background darker.

FastDictCache(get_value[, size])

Fast, lightweight cache which keeps at most size items.

FocusedStyle(body[, style_focus, style_hover])

Apply a style to child containers when focused or hovered.

Line([char, width, height, collapse, style])

Draw a horizontal or vertical line.

MouseEventType(value[, names, module, ...])

Pattern(char[, pattern])

Fill an area with a repeating background pattern.

Screen([default_char, initial_width, ...])

Two dimensional buffer of Char instances.

WritePosition(xpos, ypos, width, height)

class euporie.core.layout.decor.DropShadow(amount: float = 0.5)

Bases: Container

A transparent container which makes the background darker.

property cp: ColorPalette

Get the current app’s current color palette.

get_children() list[prompt_toolkit.layout.containers.Container]

Return an empty 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 wrapped container’s preferred height.

preferred_width(max_available_width: int) Dimension

Return the wrapped container’s preferred width.

reset() None

Reset the wrapped container - here, do nothing.

write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None

Draw the wrapped container with the additional style.

class euporie.core.layout.decor.FocusedStyle(body: AnyContainer, style_focus: str | Callable[[], str] = 'class:focused', style_hover: str | Callable[[], str] = '')

Bases: Container

Apply a style to child containers when focused or hovered.

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.

get_style() str

Determine the style to apply depending on the focus status.

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 wrapped container’s preferred height.

preferred_width(max_available_width: int) Dimension

Return the wrapped container’s preferred width.

reset() None

Reset the wrapped container.

write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None

Draw the wrapped container with the additional style.

class euporie.core.layout.decor.Line(char: str | None = None, width: int | None = None, height: int | None = None, collapse: bool = False, style: str = 'class:grid-line')

Bases: Container

Draw a horizontal or vertical line.

get_children() list

Return an empty list of the container’s children.

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 line.

preferred_width(max_available_width: int) Dimension

Return the preferred width of the line.

reset() None

Reset the state of the line. Does nothing.

write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None

Draw a continuous line in the write_position area.

Parameters:
class euporie.core.layout.decor.Pattern(char: str | Callable[[], str], pattern: int | Callable[[], int] = 1)

Bases: Container

Fill an area with a repeating background pattern.

get_children() list

Return an empty list of the container’s children.

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 an empty dimension (expand to available height).

preferred_width(max_available_width: int) Dimension

Return an empty dimension (expand to available width).

reset() None

Reset the pattern. Does nothing.

write_to_screen(screen: Screen, mouse_handlers: MouseHandlers, write_position: WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None

Fill the whole area of write_position with a pattern.

Parameters: