| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NanoUI.Store
Description
The widget store: per-widget state in maps by value type, keyed by widget
id and Slot.
Synopsis
- data WidgetStore = WidgetStore {
- storeMirrorGen :: !Word64
- storeOpenSelect :: !Int
- storeInt :: !(IntMap Int)
- storeFloat :: !(IntMap Float)
- storeDouble :: !(IntMap Double)
- storePoint :: !(IntMap (Float, Float))
- storeText :: !(IntMap Text)
- storeIntSet :: !(IntMap IntSet)
- storeFloatList :: !(IntMap [Float])
- storeIntList :: !(IntMap [Int])
- storeDyn :: !(IntMap Dynamic)
- emptyWidgetStore :: WidgetStore
- mirrorStoresChanged :: WidgetStore -> WidgetStore -> Bool
- bumpMirror :: WidgetStore -> WidgetStore
- slotKey :: Slot -> Int -> Int
- data Slot
- = SlotCursor
- | SlotAnchor
- | SlotDrag
- | SlotDragW
- | SlotDrop
- | SlotDropPos
- | SlotWinSize
- | SlotMenuOpen
- | SlotMenuPos
- | SlotScrollCfg
- | SlotScrollOff
- | SlotScrollCross
- | SlotScrollLinkX
- | SlotScrollLinkY
- | SlotScrollStep
- | SlotScrollAxes
- | SlotScrollViewPos
- | SlotScrollViewSize
- | SlotScrollRange
- | SlotScrollContent
- | SlotTextAreaRow
- | SlotTextAreaCol
- | SlotTextAreaPrefCol
- | SlotTextAreaScroll
- | SlotTextAreaViewport
- | SlotTextAreaAnchorRow
- | SlotTextAreaAnchorCol
- | SlotTextAreaContentW
- | SlotTextAreaContentH
- | SlotTextAreaContentFont
- | SlotTextAreaBuffer
- | SlotTextAreaChanged
- | SlotTextHistory
- | SlotTextMode
- | SlotTextAreaWidths
- | SlotTextInputScroll
- | SlotSearchCommitted
- | SlotSearchAge
- | SlotComboHighlight
- | SlotComboScroll
- | SlotComboCount
- | SlotComboScrollX
- | SlotComboContentW
- | SlotComboDrag
- | SlotComboDragOff
- | SlotComboCommitted
- | SlotComboFocus
- | SlotComboLive
- | SlotPaneGest
- | SlotPaneGrab
- | SlotPaneFocus
- | SlotPaneMax
- | SlotPaneResize
- | SlotPaneNext
- | SlotSeen
- | SlotColorBase
- | SlotNumericHeld
- | SlotNumericRepeat
- boolInt :: Bool -> Int
- intBool :: Int -> Bool
- anySelectOpen :: WidgetStore -> Bool
- isSelectOpen :: WidgetStore -> Int -> Bool
- setSelectOpen :: WidgetStore -> Int -> Bool -> WidgetStore
- closeSelects :: WidgetStore -> WidgetStore
- ptrEq :: a -> a -> Bool
- eqByPtr :: Eq a => a -> a -> Bool
Documentation
data WidgetStore Source #
Widget state for every widget, in maps by value type. Same-type fields
that share a widget key use slotKey.
Constructors
| WidgetStore | |
Fields
| |
Instances
| Eq WidgetStore Source # | |
Defined in NanoUI.Store | |
| Show WidgetStore Source # | |
Defined in NanoUI.Store Methods showsPrec :: Int -> WidgetStore -> ShowS # show :: WidgetStore -> String # showList :: [WidgetStore] -> ShowS # | |
mirrorStoresChanged :: WidgetStore -> WidgetStore -> Bool Source #
bumpMirror :: WidgetStore -> WidgetStore Source #
Every built-in slot.
Constructors
| SlotCursor | |
| SlotAnchor | |
| SlotDrag | |
| SlotDragW | |
| SlotDrop | |
| SlotDropPos | |
| SlotWinSize | |
| SlotMenuOpen | |
| SlotMenuPos | |
| SlotScrollCfg | |
| SlotScrollOff | |
| SlotScrollCross | |
| SlotScrollLinkX | |
| SlotScrollLinkY | |
| SlotScrollStep | |
| SlotScrollAxes | |
| SlotScrollViewPos | |
| SlotScrollViewSize | |
| SlotScrollRange | |
| SlotScrollContent | |
| SlotTextAreaRow | |
| SlotTextAreaCol | |
| SlotTextAreaPrefCol | |
| SlotTextAreaScroll | |
| SlotTextAreaViewport | |
| SlotTextAreaAnchorRow | |
| SlotTextAreaAnchorCol | |
| SlotTextAreaContentW | Cached text-area content extent (max line width, line count * line height) and the node font size they were measured at. Recomputing the width scans every character of the document, so it is cached and only refreshed when the text or font changes. |
| SlotTextAreaContentH | |
| SlotTextAreaContentFont | |
| SlotTextAreaBuffer | Cached |
| SlotTextAreaChanged | Set (value 1) to signal that the text area's text changed through a path
that does not flow through |
| SlotTextHistory | A text field's undo history with the text it was recorded against, in
|
| SlotTextMode | Which kind of text field a widget id is: 1 single-line, 2 multi-line. Commands sent to the id between frames read it. |
| SlotTextAreaWidths | A text area's measured line widths, in |
| SlotTextInputScroll | |
| SlotSearchCommitted | Search-field debounce bookkeeping. Text slots on the text widget id: the last committed query and the monotonic timestamp of the last edit. |
| SlotSearchAge | |
| SlotComboHighlight | Combo box suggestion state (storeInt/storeFloat, keyed by the field widget): the highlighted option index (absolute into the filtered list), the start of the visible window slice (keyboard wheel scrollbar scrolling), and the scrollbar bookkeeping the overlay painter and the widget's thumb-drag gesture share (total filtered count, widest row, x offset, drag axis + grab offset). |
| SlotComboScroll | |
| SlotComboCount | |
| SlotComboScrollX | |
| SlotComboContentW | |
| SlotComboDrag | |
| SlotComboDragOff | |
| SlotComboCommitted | The last committed value (storeText): typing edits the live field text but only Enter, a row click, or losing focus commits it (Escape reverts). |
| SlotComboFocus | Had-focus flag (storeInt) so the widget can see the focus-lost transition on the frame after blur and commit then. |
| SlotComboLive | The field text as the widget last produced it (storeText): a frame-start value that differs from it changed externally (a frame-side row pick or a clipboard menu action), not by typing. |
| SlotPaneGest | PaneGrid gesture slot (storeInt): 0 none, positive = dragged pane id,
negative = split id being resized. Mirrors |
| SlotPaneGrab | PaneGrid drag grab offset (storePoint): (mouse - pane origin) at grab start. |
| SlotPaneFocus | PaneGrid keyboard-navigation focus: focused pane id (0 = none, auto-first). |
| SlotPaneMax | PaneGrid maximize state: maximized pane id (0 = none). |
| SlotPaneResize | PaneGrid resize start (storePoint): (ratio, main-axis mouse) captured when a divider is first grabbed, so dragging moves it by delta rather than snapping. |
| SlotPaneNext | PaneGrid id seed (storeInt): next split / pane id to allocate. Strictly monotonic per grid: ids are never reused, so per-pane state keyed by pane id cannot collide with a closed pane's state. |
| SlotSeen | The value a controlled widget last returned to its caller. |
| SlotColorBase | A colour picker's opening colour. |
| SlotNumericHeld | The stepper arrow a numeric field's press holds: 1 up, -1 down. |
| SlotNumericRepeat | When a numeric field's held stepper arrow next repeats, in monotonic seconds. |
Instances
anySelectOpen :: WidgetStore -> Bool Source #
isSelectOpen :: WidgetStore -> Int -> Bool Source #
setSelectOpen :: WidgetStore -> Int -> Bool -> WidgetStore Source #