euporie.core.layout.decor
Decorative widgets.
Functions
|
Get the current active (running) Application. |
|
Enable when this buffer has the focus. |
|
Make sure that the given object is a |
Classes
|
Represent a single character in a |
|
A representation of a color with adjustment methods. |
Base class for user interface layout. |
|
|
Specified dimension (width/height) of a user control or window. |
|
A transparent container which makes the background darker. |
|
Fast, lightweight cache which keeps at most size items. |
|
Apply a style to child containers when focused or hovered. |
|
Draw a horizontal or vertical line. |
|
|
|
Fill an area with a repeating background pattern. |
|
Two dimensional buffer of |
|
- 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.
- 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.
- 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.
- 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_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.
- 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:
screen – The
Screen
class to which the output has to be written.mouse_handlers –
prompt_toolkit.layout.mouse_handlers.MouseHandlers
.write_position – A
prompt_toolkit.layout.screen.WritePosition
object defining where this container should be drawn.erase_bg – If true, the background will be erased prior to drawing.
parent_style – Style string to pass to the
Window
object. This will be applied to all content of the windows.VSplit
andprompt_toolkit.layout.containers.HSplit
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.decor.Pattern(char: str | Callable[[], str], pattern: int | Callable[[], int] = 1)
Bases:
Container
Fill an area with a repeating background pattern.
- 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).
- 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:
screen – The
Screen
class to which the output has to be written.mouse_handlers –
prompt_toolkit.layout.mouse_handlers.MouseHandlers
.write_position – A
prompt_toolkit.layout.screen.WritePosition
object defining where this container should be drawn.erase_bg – If true, the background will be erased prior to drawing.
parent_style – Style string to pass to the
Window
object. This will be applied to all content of the windows.VSplit
andprompt_toolkit.layout.containers.HSplit
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.