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.
Accepts the following messages:
ScrollTo
: Causes the scroll to update its handles to ensure rect is visible.ScrollReset
: Sets both handle positions to zero.
vscroll (vstack longItemsList)
Synopsis
- data ScrollCfg s e
- data ScrollStatus = ScrollStatus {}
- 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:
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.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.thumbMinSize
: the minimum size of the thumb.thumbRadius
: the radius of the corners of the thumb.onChange
: event to raise when the viewport changes.onChangeReq
:WidgetRequest
to generate when the viewport changes.
Instances
data ScrollStatus Source #
Information provided in the onChange
event.
The currently visible viewport is affected by the position of the scroll bars, their size and any other parent widget that restricts the visible viewport (e.g., another scroll).
ScrollStatus | |
|
Instances
Eq ScrollStatus Source # | |
Defined in Monomer.Widgets.Containers.Scroll (==) :: ScrollStatus -> ScrollStatus -> Bool # (/=) :: ScrollStatus -> ScrollStatus -> Bool # | |
Show ScrollStatus Source # | |
Defined in Monomer.Widgets.Containers.Scroll showsPrec :: Int -> ScrollStatus -> ShowS # show :: ScrollStatus -> String # showList :: [ScrollStatus] -> ShowS # | |
Default ScrollStatus Source # | |
Defined in Monomer.Widgets.Containers.Scroll def :: ScrollStatus # | |
WidgetEvent e => CmbOnChange (ScrollCfg s e) ScrollStatus e Source # | |
Defined in Monomer.Widgets.Containers.Scroll onChange :: (ScrollStatus -> e) -> ScrollCfg s e Source # | |
CmbOnChangeReq (ScrollCfg s e) s e ScrollStatus Source # | |
Defined in Monomer.Widgets.Containers.Scroll onChangeReq :: (ScrollStatus -> WidgetRequest s e) -> ScrollCfg s e 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.