monomer-1.2.0.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.

Messages:

  • ScrollTo: Causes the scroll to update its handles to ensure rect is visible.
  • ScrollReset: Sets both handle positions to zero.
Synopsis

Configuration

data ScrollCfg s e Source #

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

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 #

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

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.