euporie.core.widgets.decor
Decorative widgets.
Functions
|
Register a new config item. |
|
Get the current active (running) Application. |
|
Enable when this buffer has the focus. |
|
Make sure that the given object is a |
|
Accept both booleans and Filters as input and turn it into a Filter. |
Classes
|
Draw a border around any container. |
|
Represent a single character in a |
|
A representation of a color with adjustment methods. |
|
Wrapper around any other container that can change the visibility. |
Base class for user interface layout. |
|
|
A tuple of four bools with directions. |
|
Specified dimension (width/height) of a user control or window. |
|
A transparent container which makes the background darker. |
|
Container class that dynamically returns any Container. |
|
Fast, lightweight cache which keeps at most size items. |
|
Float for use in a |
|
Container which can contain another container for the background, as well as a list of floating containers on top of it. |
|
Apply a style to child containers when focused or hovered. |
|
Several layouts, one stacked above/under the other. ::. |
|
Draw a horizontal or vertical line. |
|
|
Two dimensional raster of callbacks for mouse events. |
|
|
Fill an area with a repeating background pattern. |
|
Two dimensional buffer of |
|
Draw a shadow underneath/behind this container. |
|
Several layouts, one stacked left/right of the other. ::. |
|
Container that holds a control. |
|
- class euporie.core.widgets.decor.Border(body: AnyContainer, border: GridStyle | None = ┌─┬┐ │ ││ ├─┼┤ └─┴┘, style: str | Callable[[], str] = 'class:border', show_borders: DiBool | None = None)
Bases:
object
Draw a border around any container.
- class euporie.core.widgets.decor.DropShadow(amount: float = 0.5)
Bases:
prompt_toolkit.layout.containers.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) prompt_toolkit.layout.dimension.Dimension
Return the wrapped container’s preferred height.
- preferred_width(max_available_width: int) prompt_toolkit.layout.dimension.Dimension
Return the wrapped container’s preferred width.
- write_to_screen(screen: prompt_toolkit.layout.screen.Screen, mouse_handlers: prompt_toolkit.layout.mouse_handlers.MouseHandlers, write_position: prompt_toolkit.layout.screen.WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Draw the wrapped container with the additional style.
- class euporie.core.widgets.decor.FocusedStyle(body: AnyContainer, style_focus: str | Callable[[], str] = 'class:focused', style_hover: str | Callable[[], str] = '')
Bases:
prompt_toolkit.layout.containers.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) prompt_toolkit.layout.dimension.Dimension
Return the wrapped container’s preferred height.
- preferred_width(max_available_width: int) prompt_toolkit.layout.dimension.Dimension
Return the wrapped container’s preferred width.
- write_to_screen(screen: prompt_toolkit.layout.screen.Screen, mouse_handlers: prompt_toolkit.layout.mouse_handlers.MouseHandlers, write_position: prompt_toolkit.layout.screen.WritePosition, parent_style: str, erase_bg: bool, z_index: int | None) None
Draw the wrapped container with the additional style.
- class euporie.core.widgets.decor.Line(char: str | None = None, width: int | None = None, height: int | None = None, collapse: bool = False, style: str = 'class:grid-line')
Bases:
prompt_toolkit.layout.containers.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) prompt_toolkit.layout.dimension.Dimension
Return the preferred height of the line.
- preferred_width(max_available_width: int) prompt_toolkit.layout.dimension.Dimension
Return the preferred width of the line.
- write_to_screen(screen: prompt_toolkit.layout.screen.Screen, mouse_handlers: prompt_toolkit.layout.mouse_handlers.MouseHandlers, write_position: prompt_toolkit.layout.screen.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.widgets.decor.Pattern(char: str | Callable[[], str], pattern: int | Callable[[], int] = 1)
Bases:
prompt_toolkit.layout.containers.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) prompt_toolkit.layout.dimension.Dimension
Return an empty dimension (expand to available height).
- preferred_width(max_available_width: int) prompt_toolkit.layout.dimension.Dimension
Return an empty dimension (expand to available width).
- write_to_screen(screen: prompt_toolkit.layout.screen.Screen, mouse_handlers: prompt_toolkit.layout.mouse_handlers.MouseHandlers, write_position: prompt_toolkit.layout.screen.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.