euporie.core.margins
Contain margins.
Functions
|
Cast a value to a type. |
|
Get the current active (running) Application. |
|
Accept both booleans and Filters as input and turn it into a Filter. |
Classes
|
Metaclass for defining Abstract Base Classes (ABCs). |
A margin sub-class which handles mouse events. |
|
Base class for user interface layout. |
|
|
Specified dimension (width/height) of a user control or window. |
|
Control that displays formatted text. |
|
Base interface for a margin. |
|
A container which renders a stand-alone margin. |
|
|
|
Mouse event, which also store relative position of the mouse event in a cell. |
|
|
Margin that displays the line numbers of a |
|
A margin which indicates lines extending beyond the edge of the window. |
|
|
|
|
Store the relative position or the mouse within a terminal cell. |
|
Margin displaying a scrollbar. |
|
Container that holds a control. |
- class euporie.core.margins.ClickableMargin
Bases:
prompt_toolkit.layout.margins.Margin
A margin sub-class which handles mouse events.
- abstract create_margin(window_render_info: WindowRenderInfo, width: int, height: int) StyleAndTextTuples
Creates a margin. This should return a list of (style_str, text) tuples.
- Parameters
window_render_info –
WindowRenderInfo
instance, generated after rendering and copying the visible part of theUIControl
into theWindow
.width – The width that’s available for this margin. (As reported by
get_width()
.)height – The height that’s available for this margin. (The height of the
Window
.)
- abstract get_width(get_ui_content: Callable[[], prompt_toolkit.layout.controls.UIContent]) int
Return the width that this margin is going to consume.
- Parameters
get_ui_content – Callable that asks the user control to create a
UIContent
instance. This can be used for instance to obtain the number of lines.
- set_write_position(write_position: WritePosition) None
Set the write position of the menu.
- write_position: WritePosition | None
- class euporie.core.margins.MarginContainer(margin: Margin, target: ScrollableContainer)
Bases:
prompt_toolkit.layout.containers.Window
A container which renders a stand-alone margin.
- create_fragments() StyleAndTextTuples
Generate text fragments to display.
- get_children() list[prompt_toolkit.layout.containers.Container]
Return the list of child
Container
objects.
- get_key_bindings() KeyBindingsBase | None
Return a
KeyBindings
object.
- preferred_height(width: int, max_available_height: int) prompt_toolkit.layout.dimension.Dimension
Return a thedesired height for this container.
- preferred_width(max_available_width: int) prompt_toolkit.layout.dimension.Dimension
Return a the desired width for this container.
- 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.
- class euporie.core.margins.NumberedDiffMargin
Bases:
prompt_toolkit.layout.margins.Margin
Margin that displays the line numbers of a
Window
.- create_margin(window_render_info: WindowRenderInfo, width: int, height: int) StyleAndTextTuples
Generate the margin’s content.
- style = 'class:line-number'
- class euporie.core.margins.OverflowMargin
Bases:
prompt_toolkit.layout.margins.Margin
A margin which indicates lines extending beyond the edge of the window.
- create_margin(window_render_info: WindowRenderInfo, width: int, height: int) StyleAndTextTuples
Generate the margin’s content.
- class euporie.core.margins.ScrollbarMargin(display_arrows: Union[prompt_toolkit.filters.base.Filter, bool] = True, up_arrow_symbol: str = '▴', down_arrow_symbol: str = '▾', autohide: Union[prompt_toolkit.filters.base.Filter, bool] = False, smooth: bool = True, style: str = '')
Bases:
euporie.core.margins.ClickableMargin
Margin displaying a scrollbar.
- Parameters
display_arrows – Display scroll up/down arrows.
up_arrow – Character to use for the scrollbar’s up arrow
down_arrow – Character to use for the scrollbar’s down arrow
smooth – Use block character to move scrollbar more smoothly
- create_margin(window_render_info: WindowRenderInfo | None, width: int, height: int, margin_render_info: WindowRenderInfo | None = None) StyleAndTextTuples
Create the margin’s formatted text.
- eighths = '█▇▆▅▄▃▂▁ '
- mouse_handler(mouse_event: PtkMouseEvent) NotImplementedOrNone
Type compatible mouse handler.
- async repeat(mouse_event: prompt_toolkit.mouse_events.MouseEvent, timeout: float = 0.1) None
Repeat a mouse event after a timeout.
- set_write_position(write_position: WritePosition) None
Set the write position of the menu.
- write_position: WritePosition | None