1# llimphi-widget-panes23A tmux-style BSP pane tree.
45The missing piece for "mount any tawasuyu component in an interchangeable layout
6with resizable splits". The widget knows nothing about the domains: it hosts
7opaque leaves (`View<Msg>`) in a binary tree the user splits
8(horizontal/vertical), closes, focuses (click) and resizes (dragging the
9dividers). tmux, but in-process and on Llimphi's Elm loop.
1011Not to be confused with `llimphi-widget-panel` (the chrome of ONE titled panel):
12this is the tree of N panes.
1314## Model1516- `Layout` is the tree's **structure** (which leaf lives where, with which ratio
17 per split). It lives in the host's `Model` and is manipulated with
18 `Layout::split`, `Layout::without` and `Layout::resize`.
19- The **content** of each leaf is provided by the host through a
20 `FnMut(PaneId) -> View<Msg>` closure invoked while building the view — which is
21 why it can borrow the `Model` (it need not be `'static`).
22- The resize handler *is* stored in the view tree (the draggable divider takes
23 it), so that one must be `'static + Send + Sync`. The focus one is evaluated at
24 build time (because `on_click` takes the `Msg` by value), so it carries no such
25 restriction.
2627## Why not `Box<dyn Any>`2829Same as the rest of the repo: the host keeps an `enum` of its panel types and
30dispatches statically. The widget is generic over `Msg`; the host decides how to
31materialize each leaf. Zero downcasting.
3233---
3435Part of **llimphi** — see [llimphi](../../README.md).
README.md
llimphi-widget-panes
A tmux-style BSP pane tree.
The missing piece for "mount any tawasuyu component in an interchangeable layout
with resizable splits". The widget knows nothing about the domains: it hosts
opaque leaves (View<Msg>) in a binary tree the user splits
(horizontal/vertical), closes, focuses (click) and resizes (dragging the
dividers). tmux, but in-process and on Llimphi's Elm loop.
Not to be confused with llimphi-widget-panel (the chrome of ONE titled panel):
this is the tree of N panes.
Model
Layout is the tree's structure (which leaf lives where, with which ratio
per split). It lives in the host's Model and is manipulated with
Layout::split, Layout::without and Layout::resize.
The content of each leaf is provided by the host through a
FnMut(PaneId) -> View<Msg> closure invoked while building the view — which is
why it can borrow the Model (it need not be 'static).
The resize handler is stored in the view tree (the draggable divider takes
it), so that one must be 'static + Send + Sync. The focus one is evaluated at
build time (because on_click takes the Msg by value), so it carries no such
restriction.
Why not Box<dyn Any>
Same as the rest of the repo: the host keeps an enum of its panel types and
dispatches statically. The widget is generic over Msg; the host decides how to
materialize each leaf. Zero downcasting.