| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Reflex.Vty.Widget.Layout
Description
Synopsis
- data Orientation
- data Constraint
- data Layout t m a
- runLayout :: (MonadFix m, MonadHold t m, PostBuild t m, Monad m, MonadNodeId m) => Dynamic t Orientation -> Int -> Event t Int -> Layout t m a -> VtyWidget t m a
- data TileConfig t = TileConfig {}
- tile :: (Reflex t, Monad m, MonadNodeId m) => TileConfig t -> VtyWidget t m (Event t x, a) -> Layout t m a
- fixed :: (Reflex t, Monad m, MonadNodeId m) => Dynamic t Int -> VtyWidget t m a -> Layout t m a
- stretch :: (Reflex t, Monad m, MonadNodeId m) => VtyWidget t m a -> Layout t m a
- col :: (MonadFix m, MonadHold t m, PostBuild t m, MonadNodeId m) => Layout t m a -> VtyWidget t m a
- row :: (MonadFix m, MonadHold t m, PostBuild t m, MonadNodeId m) => Layout t m a -> VtyWidget t m a
- tabNavigation :: (Reflex t, Monad m) => VtyWidget t m (Event t Int)
- askOrientation :: Monad m => Layout t m (Dynamic t Orientation)
Documentation
data Orientation Source #
The main-axis orientation of a Layout widget
Constructors
| Orientation_Column | |
| Orientation_Row |
Instances
| Eq Orientation Source # | |
Defined in Reflex.Vty.Widget.Layout | |
| Ord Orientation Source # | |
Defined in Reflex.Vty.Widget.Layout Methods compare :: Orientation -> Orientation -> Ordering # (<) :: Orientation -> Orientation -> Bool # (<=) :: Orientation -> Orientation -> Bool # (>) :: Orientation -> Orientation -> Bool # (>=) :: Orientation -> Orientation -> Bool # max :: Orientation -> Orientation -> Orientation # min :: Orientation -> Orientation -> Orientation # | |
| Read Orientation Source # | |
Defined in Reflex.Vty.Widget.Layout Methods readsPrec :: Int -> ReadS Orientation # readList :: ReadS [Orientation] # readPrec :: ReadPrec Orientation # readListPrec :: ReadPrec [Orientation] # | |
| Show Orientation Source # | |
Defined in Reflex.Vty.Widget.Layout Methods showsPrec :: Int -> Orientation -> ShowS # show :: Orientation -> String # showList :: [Orientation] -> ShowS # | |
data Constraint Source #
Datatype representing constraints on a widget's size along the main axis (see Orientation)
Constructors
| Constraint_Fixed Int | |
| Constraint_Min Int |
Instances
| Eq Constraint Source # | |
Defined in Reflex.Vty.Widget.Layout | |
| Ord Constraint Source # | |
Defined in Reflex.Vty.Widget.Layout Methods compare :: Constraint -> Constraint -> Ordering # (<) :: Constraint -> Constraint -> Bool # (<=) :: Constraint -> Constraint -> Bool # (>) :: Constraint -> Constraint -> Bool # (>=) :: Constraint -> Constraint -> Bool # max :: Constraint -> Constraint -> Constraint # min :: Constraint -> Constraint -> Constraint # | |
| Read Constraint Source # | |
Defined in Reflex.Vty.Widget.Layout Methods readsPrec :: Int -> ReadS Constraint # readList :: ReadS [Constraint] # readPrec :: ReadPrec Constraint # readListPrec :: ReadPrec [Constraint] # | |
| Show Constraint Source # | |
Defined in Reflex.Vty.Widget.Layout Methods showsPrec :: Int -> Constraint -> ShowS # show :: Constraint -> String # showList :: [Constraint] -> ShowS # | |
The Layout monad transformer keeps track of the configuration (e.g., Orientation) and
Constraints of its child widgets, apportions vty real estate to each, and acts as a
switchboard for focus requests. See tile and runLayout.
Instances
Arguments
| :: (MonadFix m, MonadHold t m, PostBuild t m, Monad m, MonadNodeId m) | |
| => Dynamic t Orientation | The main-axis |
| -> Int | The positional index of the initially focused tile |
| -> Event t Int | An event that shifts focus by a given number of tiles |
| -> Layout t m a | The |
| -> VtyWidget t m a |
Run a Layout action
data TileConfig t Source #
Configuration options for and constraints on tile
Constructors
| TileConfig | |
Fields
| |
Instances
| Reflex t => Default (TileConfig t) Source # | |
Defined in Reflex.Vty.Widget.Layout Methods def :: TileConfig t # | |
Arguments
| :: (Reflex t, Monad m, MonadNodeId m) | |
| => TileConfig t | The tile's configuration |
| -> VtyWidget t m (Event t x, a) | A child widget. The |
| -> Layout t m a |
Tiles are the basic building blocks of Layout widgets. Each tile has a constraint
on its size and ability to grow and on whether it can be focused. It also allows its child
widget to request focus.
fixed :: (Reflex t, Monad m, MonadNodeId m) => Dynamic t Int -> VtyWidget t m a -> Layout t m a Source #
A tile of a fixed size that is focusable and gains focus on click
stretch :: (Reflex t, Monad m, MonadNodeId m) => VtyWidget t m a -> Layout t m a Source #
A tile that can stretch (i.e., has no fixed size) and has a minimum size of 0.
This tile is focusable and gains focus on click.
col :: (MonadFix m, MonadHold t m, PostBuild t m, MonadNodeId m) => Layout t m a -> VtyWidget t m a Source #
A version of runLayout that arranges tiles in a column and uses tabNavigation to
change tile focus.
row :: (MonadFix m, MonadHold t m, PostBuild t m, MonadNodeId m) => Layout t m a -> VtyWidget t m a Source #
A version of runLayout that arranges tiles in a row and uses tabNavigation to
change tile focus.
tabNavigation :: (Reflex t, Monad m) => VtyWidget t m (Event t Int) Source #
Produces an Event that navigates forward one tile when the Tab key is pressed
and backward one tile when Shift+Tab is pressed.
askOrientation :: Monad m => Layout t m (Dynamic t Orientation) Source #
Retrieve the current orientation of a Layout