Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Helper functions for focus handling.
Synopsis
- isNodeFocused :: WidgetEnv s e -> WidgetNode s e -> Bool
- isNodeInfoFocused :: WidgetEnv s e -> WidgetNodeInfo -> Bool
- isNodeParentOfFocused :: WidgetEnv s e -> WidgetNode s e -> Bool
- parentPath :: WidgetNode s e -> Path
- isPathParent :: Path -> Path -> Bool
- nextTargetStep :: WidgetNode s e -> Path -> Maybe PathStep
- isFocusCandidate :: WidgetNode s e -> Path -> FocusDirection -> Bool
- isTargetReached :: WidgetNode s e -> Path -> Bool
- isTargetValid :: WidgetNode s e -> Path -> Bool
- isNodeParentOfPath :: WidgetNode s e -> Path -> Bool
- isNodeBeforePath :: WidgetNode s e -> Path -> Bool
- isNodeAfterPath :: WidgetNode s e -> Path -> Bool
- handleFocusChange :: WidgetNode s e -> Path -> [Path -> WidgetRequest s e] -> Maybe (WidgetResult s e)
Documentation
isNodeFocused :: WidgetEnv s e -> WidgetNode s e -> Bool Source #
Checks if the given node is focused.
isNodeInfoFocused :: WidgetEnv s e -> WidgetNodeInfo -> Bool Source #
Checks if the given nodeInfo is focused.
isNodeParentOfFocused :: WidgetEnv s e -> WidgetNode s e -> Bool Source #
Checks if the given node is a parent of the focused node.
parentPath :: WidgetNode s e -> Path Source #
Returns the parent path of a node.
isPathParent :: Path -> Path -> Bool Source #
Returns whether the first path is parent of the second path.
nextTargetStep :: WidgetNode s e -> Path -> Maybe PathStep Source #
Returns the index of the child matching the next step implied by target.
isFocusCandidate :: WidgetNode s e -> Path -> FocusDirection -> Bool Source #
Checks if the node is a candidate for next focus in the given direction. The node must be focusable, enabled and visible, plus having the correct position considering the direction.
isTargetReached :: WidgetNode s e -> Path -> Bool Source #
Checks if the node's path matches the target.
isTargetValid :: WidgetNode s e -> Path -> Bool Source #
Checks if the node has a child matching the next target step.
isNodeParentOfPath :: WidgetNode s e -> Path -> Bool Source #
Checks if the node is parent of the provided path.
isNodeBeforePath :: WidgetNode s e -> Path -> Bool Source #
Checks if the node's path is after the target (higher or to the left).
isNodeAfterPath :: WidgetNode s e -> Path -> Bool Source #
Checks if the node's path is after the target (deeper or to the right).
:: WidgetNode s e | The node receiving the event. |
-> Path | The path of next/prev target, accordingly. |
-> [Path -> WidgetRequest s e] | Getter for reqs handler in a config type. |
-> Maybe (WidgetResult s e) | The result. |
Generates a result with events and requests associated to a focus change.