Repository navigation
API turboframe.ui.shadow
Source: turboframe/ui/shadow.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.
Turbo Vision drop shadows.
In Turbo Vision every window, dialog and menu casts a shadow two columns to the right and one row down; the cells under it keep their characters but are drawn dark gray on black. Textual has no notion of this, so screens that want it use a compositor that post-processes the composited lines: after the normal front-to-back composition, the shadow cells are restyled.
A shadow only darkens what is behind its caster: cells covered by anything in front of the caster (a window above it, an open menu) are left alone.
ShadowCompositor, ShadowScreen, casts_tv_shadow, compute_shadow_spans, darken, enabled, install_shadows, shadow_regions, shadow_style
class ShadowCompositor(Compositor)
ShadowCompositor(casts_shadow: Callable[[Widget], bool])class ShadowScreen(Screen)
ShadowScreen(*args, **kwargs)A plain screen whose windows and menus cast Turbo Vision shadows.
def casts_tv_shadow(widget: Widget) -> boolWindows, dialogs and drop-down menus cast shadows, as in Turbo Vision.
def compute_shadow_spans(widgets: Sequence[tuple[Widget, Region, Region]], casts_shadow: Callable[[Widget], bool]) -> tuple[Spans, list[Region]]Shadow cells for a front-to-back list of (widget, region, clip).
Returns the cells to darken and the shadow rectangles (for dirty tracking).
def darken(strip: Strip, start: int, end: int) -> StripRestyle cells [start, end) of strip as shadow, keeping the characters.
True
def install_shadows(screen: Screen, casts_shadow: Callable[[Widget], bool] = <function casts_tv_shadow>) -> NoneGive screen a shadow-drawing compositor (call from its __init__); nothing when enabled is False.
def shadow_regions(region: Region) -> list[Region]The parts of region shifted by the shadow offset that region does not cover.
def shadow_style() -> StyleTurbo Vision's shadow (dark gray on black in the Borland palettes): every attribute off.
TurboFrame · part of Divengine · GPL-3.0-or-later · report an issue
Tutorial
Examples
The desktop
- The Desktop
- Application Mixins
- Windows and Lists
- Dialogs
- Histories
- Progress
- Themes and Colors
- Glyphs
- Settings and Recent Files
- Command Palette
Editing
Tasks
Languages
Running
Reference
Links