Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Scroll container of a single node. Assigns all the space the inner node requests but limits itself to what its parent assigns. It allows navigating the content of the inner node with the scroll bars. It also supports automatic focus following.
Messages:
ScrollTo
: Causes the scroll to update its handles to ensure rect is visible.ScrollReset
: Sets both handle positions to zero.
Synopsis
- data ScrollCfg s e
- data ScrollMessage
- scrollOverlay :: ScrollCfg s e
- scrollOverlay_ :: Bool -> ScrollCfg s e
- scrollFwdStyle :: (WidgetEnv s e -> Style -> (Style, Style)) -> ScrollCfg s e
- scrollFwdDefault :: WidgetEnv s e -> Style -> (Style, Style)
- scrollInvisible :: ScrollCfg s e
- scrollInvisible_ :: Bool -> ScrollCfg s e
- scrollFollowFocus :: ScrollCfg s e
- scrollFollowFocus_ :: Bool -> ScrollCfg s e
- scrollStyle :: ALens' ThemeState StyleState -> ScrollCfg s e
- scroll :: WidgetNode s e -> WidgetNode s e
- scroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e
- hscroll :: WidgetNode s e -> WidgetNode s e
- hscroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e
- vscroll :: WidgetNode s e -> WidgetNode s e
- vscroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e
Configuration
Configuration options for scroll:
wheelRate
: rate at which wheel movement causes scrolling.barColor
: the color of the bar (container of the thumb).barHoverColor
: the color of the bar when mouse is on top.barWidth
: the width of the bar.thumbColor
: the color of the thumb.thumbHoverColor
: the color of the thumb when mouse is on top.thumbWidth
: the width of the thumb.thumbRadius
: the radius of the corners of the thumb.scrollOverlay
: whether scroll bar should be on top of content or by the side.scrollInvisible
: shortcut for setting invisible style. Useful with scroll overlay, since it allows scrolling without taking up space or hiding content.scrollFollowFocus
: whether to auto scroll when focusing a non visible item.scrollStyle
: the base style of the scroll bar.
Instances
Semigroup (ScrollCfg s e) Source # | |
Monoid (ScrollCfg s e) Source # | |
Default (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll | |
CmbThumbWidth (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll thumbWidth :: Double -> ScrollCfg s e Source # | |
CmbThumbRadius (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll thumbRadius :: Double -> ScrollCfg s e Source # | |
CmbThumbHoverColor (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll thumbHoverColor :: Color -> ScrollCfg s e Source # | |
CmbThumbColor (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll thumbColor :: Color -> ScrollCfg s e Source # | |
CmbBarWidth (ScrollCfg s e) Source # | |
CmbBarHoverColor (ScrollCfg s e) Source # | |
Defined in Monomer.Widgets.Containers.Scroll barHoverColor :: Color -> ScrollCfg s e Source # | |
CmbBarColor (ScrollCfg s e) Source # | |
CmbWheelRate (ScrollCfg s e) Rational Source # | |
data ScrollMessage Source #
Messages the scroll component supports.
ScrollTo Rect | Causes the scroll to update its bars to ensure rect is visible. |
ScrollReset | Sets both bars to zero. |
Instances
Eq ScrollMessage Source # | |
Defined in Monomer.Widgets.Containers.Scroll (==) :: ScrollMessage -> ScrollMessage -> Bool # (/=) :: ScrollMessage -> ScrollMessage -> Bool # | |
Show ScrollMessage Source # | |
Defined in Monomer.Widgets.Containers.Scroll showsPrec :: Int -> ScrollMessage -> ShowS # show :: ScrollMessage -> String # showList :: [ScrollMessage] -> ShowS # |
scrollOverlay :: ScrollCfg s e Source #
Scroll bars will be displayed on top of the content.
scrollOverlay_ :: Bool -> ScrollCfg s e Source #
Sets whether scroll bars will be displayed on top of the content or next to it.
scrollFwdStyle :: (WidgetEnv s e -> Style -> (Style, Style)) -> ScrollCfg s e Source #
Sets a function that will split the node's style into one for the scroll and one for the child node. Useful for widgets which wrap themselves in a scroll, such as textArea, to be able to receive customizations made by the user.
scrollFwdDefault :: WidgetEnv s e -> Style -> (Style, Style) Source #
Default style forward function, keeping standard fields for scroll.
scrollInvisible :: ScrollCfg s e Source #
Sets the style of the scroll bars to transparent.
scrollInvisible_ :: Bool -> ScrollCfg s e Source #
Whether to set the style of the scroll bars to transparent.
scrollFollowFocus :: ScrollCfg s e Source #
Makes the scroll automatically follow focused items to make them visible.
scrollFollowFocus_ :: Bool -> ScrollCfg s e Source #
Whether to automatically follow focused items to make them visible.
scrollStyle :: ALens' ThemeState StyleState -> ScrollCfg s e Source #
Sets the base style of the scroll bar. Useful when creating widgets which use scroll and may need to customize it.
Constructors
scroll :: WidgetNode s e -> WidgetNode s e Source #
Creates a scroll node that may show both bars.
scroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e Source #
Creates a scroll node that may show both bars. Accepts config.
hscroll :: WidgetNode s e -> WidgetNode s e Source #
Creates a horizontal scroll node. Vertical space is equal to what the parent node assigns.
hscroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e Source #
Creates a horizontal scroll node. Vertical space is equal to what the parent node assigns. Accepts config.
vscroll :: WidgetNode s e -> WidgetNode s e Source #
Creates a vertical scroll node. Vertical space is equal to what the parent node assigns.
vscroll_ :: [ScrollCfg s e] -> WidgetNode s e -> WidgetNode s e Source #
Creates a vertical scroll node. Vertical space is equal to what the parent node assigns. Accepts config.