| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NanoUI.Widgets.PaneGrid
Description
Interactive pane grid with resizable dividers, modelled on iced's
PaneGrid.
The grid is a binary split tree (GridNode)
persisted per widget as a Data.Dynamic value in the widget store.
Panes are rendered through the user-provided pgViewPane, which receives a
PaneGridCtx with immediate-mode actions to split, close, maximize, or
restore the pane. Dividers can be dragged to resize; panes can be grabbed by
their pick rect and dropped onto another pane (center = swap, edge = split)
or onto the grid's outer edge to restructure the whole grid at top level;
arrow keys navigate between panes; mx maximizeclose and Escape
restores while the grid is focused.
Synopsis
- data GridAxis
- data PaneGridConfig (es :: [Effect]) = PaneGridConfig {}
- defaultPaneGridConfig :: forall (es :: [Effect]). PaneGridConfig es
- data PaneGridCtx (es :: [Effect]) = PaneGridCtx {
- pgcPaneId :: !Word64
- pgcRect :: !Rect
- pgcMaximized :: !Bool
- pgcDragging :: !Bool
- pgcDndActive :: !Bool
- pgcSplit :: !(GridAxis -> Eff es Word64)
- pgcClose :: !(Eff es ())
- pgcMaximize :: !(Eff es ())
- pgcRestore :: !(Eff es ())
- data PaneView = PaneView {
- pvTitle :: !Text
- pvDraggable :: !Bool
- pvDragPick :: !(Maybe Rect)
- data PaneGridResponse = PaneGridResponse {
- pgrChanged :: !Bool
- pgrPaneCount :: !Int
- pgrPanes :: ![Word64]
- pgrFocusedPane :: !Word64
- pgrMaximizedPane :: !Word64
- paneGrid :: forall (es :: [Effect]). Ui :> es => PaneGridConfig es -> Eff es PaneGridResponse
Documentation
Divider orientation. AxisV draws a vertical divider (panes left/right),
AxisH draws a horizontal divider (panes stacked top/bottom).
Instances
| Eq GridAxis Source # | |
| Ord GridAxis Source # | |
Defined in NanoUI.Widgets.SplitPane | |
| Bounded GridAxis Source # | |
| Enum GridAxis Source # | |
Defined in NanoUI.Widgets.SplitPane | |
| Show GridAxis Source # | |
data PaneGridConfig (es :: [Effect]) Source #
Configuration for a pane grid. pgViewPane can run arbitrary widget code,
so the config carries the caller's effect row.
Constructors
| PaneGridConfig | |
Fields
| |
defaultPaneGridConfig :: forall (es :: [Effect]). PaneGridConfig es Source #
data PaneGridCtx (es :: [Effect]) Source #
Actions handed to a pane so it can mutate the grid immediately.
Constructors
| PaneGridCtx | |
Fields
| |
What a pane renders to this frame. The pane's content (including any title
bar / header) is drawn entirely by the caller in pgViewPane; a header is
purely optional and nothing here depends on one existing.
Constructors
| PaneView | |
Fields
| |
data PaneGridResponse Source #
Outcome of one frame of the grid. The pane list, focus, and maximize
fields report the state after this pass: actions run by pane content
(pgcSplit, pgcClose, ...) and the keyboard handling below take effect
in these values and from the next frame's layout onward.
Constructors
| PaneGridResponse | |
Fields
| |
Instances
| Eq PaneGridResponse Source # | |
Defined in NanoUI.Widgets.PaneGrid Methods (==) :: PaneGridResponse -> PaneGridResponse -> Bool # (/=) :: PaneGridResponse -> PaneGridResponse -> Bool # | |
| Show PaneGridResponse Source # | |
Defined in NanoUI.Widgets.PaneGrid Methods showsPrec :: Int -> PaneGridResponse -> ShowS # show :: PaneGridResponse -> String # showList :: [PaneGridResponse] -> ShowS # | |
paneGrid :: forall (es :: [Effect]). Ui :> es => PaneGridConfig es -> Eff es PaneGridResponse Source #