euporie.core.widgets.display
Define custom controls which re-render on resize.
Functions
|
Add a command to the centralized command system. |
|
Cast a value to a type. |
|
Return the ceiling of x as an Integral. |
|
Return the character width of this text fragment list. |
|
Get the current active (running) Application. |
|
Assign key-bindings to commands based on a dictionary. |
|
Update the key-binding registry. |
|
Run a function in an thread, but make sure it uses the same contextvars. |
|
Return a filter which indicates if a window is scrollable. |
|
Take a single list of (style_str, text) tuples and yield one such list for each line. |
|
Accept both booleans and Filters as input and turn it into a Filter. |
|
Turn callable or string into string. |
|
Wrap formatted text at a given width. |
Classes
|
Wrapper around any other container that can change the visibility. |
|
Class for storing and converting display data. |
|
Rich output displays. |
|
Web view displays. |
|
A window sub-class which can scroll left and right. |
|
Simple event to which event handlers can be attached. For instance::. |
|
Fast, lightweight cache which keeps at most size items. |
|
Class which loads and positions graphics references in a |
|
A container which renders a stand-alone margin. |
|
Mouse event, sent to UIControl.mouse_handler. |
|
|
|
|
|
Margin displaying a scrollbar. |
|
Very simple cache that discards the oldest item when the cache size is exceeded. |
|
|
|
Content generated by a user control. |
Base class for all user interface controls. |
|
|
Several layouts, one stacked left/right of the other. |
|
Container that holds a control. |
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. |
- class euporie.core.widgets.display.Display(datum: Datum, height: AnyDimension = None, width: AnyDimension = None, focusable: FilterOrBool = False, focus_on_click: FilterOrBool = False, wrap_lines: FilterOrBool = False, always_hide_cursor: FilterOrBool = True, scrollbar: FilterOrBool = True, scrollbar_autohide: FilterOrBool = True, dont_extend_height: FilterOrBool = True, dont_extend_width: FilterOrBool = False, style: str | Callable[[], str] = '')
Bases:
object
Rich output displays.
A container for displaying rich output data.
- property datum: Any
Return the display’s current data.
- class euporie.core.widgets.display.DisplayControl(datum: Datum, focusable: FilterOrBool = False, focus_on_click: FilterOrBool = False, wrap_lines: FilterOrBool = False, dont_extend_width: FilterOrBool = False, threaded: bool = False)
Bases:
UIControl
Web view displays.
A control which displays rendered HTML content.
- create_content(width: int, height: int) UIContent
Generate the content for this user control.
- Returns:
A
UIContent
instance.
- property datum: Any
Return the control’s display data.
- get_content(datum: Datum, width: int, height: int, loading: bool, cursor_position: Point, color_palette: ColorPalette) UIContent
Create a cacheable UIContent.
- get_key_bindings() KeyBindingsBase | None
Return key bindings that are specific for this user control.
- Returns:
- A
KeyBindings
object if some key bindings are specified, or None otherwise.
- A
- get_lines(datum: Datum, width: int | None, height: int | None, fg: str, bg: str, wrap_lines: bool = False) list[StyleAndTextTuples]
Render the lines to display in the control.
- get_max_line_width(datum: Datum, width: int | None, height: int | None, wrap_lines: bool = False) int
Get the maximum lines width for a given rendering.
- mouse_handler(mouse_event: MouseEvent) NotImplementedOrNone
Mouse handler for this control.
- preferred_height(width: int, max_available_height: int, wrap_lines: bool, get_line_prefix: GetLinePrefixCallable | None) int | None
Calculate and return the preferred height of the control.
- class euporie.core.widgets.display.DisplayWindow(content: UIControl | None = None, width: AnyDimension = None, height: AnyDimension = None, z_index: int | None = None, dont_extend_width: FilterOrBool = False, dont_extend_height: FilterOrBool = False, ignore_content_width: FilterOrBool = False, ignore_content_height: FilterOrBool = False, left_margins: Sequence[Margin] | None = None, right_margins: Sequence[Margin] | None = None, scroll_offsets: ScrollOffsets | None = None, allow_scroll_beyond_bottom: FilterOrBool = False, wrap_lines: FilterOrBool = False, get_vertical_scroll: Callable[[Window], int] | None = None, get_horizontal_scroll: Callable[[Window], int] | None = None, always_hide_cursor: FilterOrBool = False, cursorline: FilterOrBool = False, cursorcolumn: FilterOrBool = False, colorcolumns: None | list[ColorColumn] | Callable[[], list[ColorColumn]] = None, align: WindowAlign | Callable[[], WindowAlign] = WindowAlign.LEFT, style: str | Callable[[], str] = '', char: None | str | Callable[[], str] = None, get_line_prefix: GetLinePrefixCallable | None = None)
Bases:
Window
A window sub-class which can scroll left and right.
- content: DisplayControl
- 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.