monomer-1.4.1.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Containers.Scroll

Description

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

Configuration

data ScrollCfg s e Source #

Configuration options for scroll:

Instances

Instances details
Semigroup (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

(<>) :: ScrollCfg s e -> ScrollCfg s e -> ScrollCfg s e #

sconcat :: NonEmpty (ScrollCfg s e) -> ScrollCfg s e #

stimes :: Integral b => b -> ScrollCfg s e -> ScrollCfg s e #

Monoid (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

mempty :: ScrollCfg s e #

mappend :: ScrollCfg s e -> ScrollCfg s e -> ScrollCfg s e #

mconcat :: [ScrollCfg s e] -> ScrollCfg s e #

Default (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

def :: ScrollCfg s e #

CmbThumbMinSize (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

CmbThumbWidth (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

CmbThumbRadius (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

CmbThumbHoverColor (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

CmbThumbColor (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

thumbColor :: Color -> ScrollCfg s e Source #

CmbBarWidth (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

barWidth :: Double -> ScrollCfg s e Source #

CmbBarHoverColor (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

CmbBarColor (ScrollCfg s e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

barColor :: Color -> ScrollCfg s e Source #

CmbWheelRate (ScrollCfg s e) Rational Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

WidgetEvent e => CmbOnChange (ScrollCfg s e) ScrollStatus e Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

Methods

onChange :: (ScrollStatus -> e) -> ScrollCfg s e Source #

CmbOnChangeReq (ScrollCfg s e) s e ScrollStatus Source # 
Instance details

Defined in Monomer.Widgets.Containers.Scroll

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).

Constructors

ScrollStatus 

Fields

data ScrollMessage Source #

Messages the scroll component supports.

Constructors

ScrollTo Rect

Causes the scroll to update its bars to ensure rect is visible.

ScrollReset

Sets both bars to zero.

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.