| 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 |
Monomer.Widgets.Singles.ToggleButton
Contents
Description
Toggle button widget, used for boolean values.
toggleButton "Toggle" booleanLens
Its behavior is equivalent to Monomer.Widgets.Singles.Checkbox and Monomer.Widgets.Singles.LabeledCheckbox, with a different visual representation.
See Monomer.Widgets.Singles.OptionButton for detailed notes.
Synopsis
- type ToggleButtonCfg = OptionButtonCfg
- toggleButtonOffStyle :: Style -> ToggleButtonCfg s e a
- toggleButton :: Text -> ALens' s Bool -> WidgetNode s e
- toggleButton_ :: Text -> ALens' s Bool -> [ToggleButtonCfg s e Bool] -> WidgetNode s e
- toggleButtonV :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> WidgetNode s e
- toggleButtonV_ :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> [ToggleButtonCfg s e Bool] -> WidgetNode s e
- toggleButtonD_ :: Text -> WidgetData s Bool -> [ToggleButtonCfg s e Bool] -> WidgetNode s e
Configuration
type ToggleButtonCfg = OptionButtonCfg Source #
Configuration options for toggleButton:
ignoreTheme: whether to load default style from theme or start empty.toggleButtonOffStyle: style to use when the option is not active.trimSpaces: whether to remove leading/trailing spaces in the caption.ellipsis: if ellipsis should be used for overflown text.multiline: if text may be split in multiple lines.maxLines: maximum number of text lines to show.resizeFactor: flexibility to have more or less spaced assigned.resizeFactorW: flexibility to have more or less horizontal spaced assigned.resizeFactorH: flexibility to have more or less vertical spaced assigned.onFocus: event to raise when focus is received.onFocusReq:WidgetRequestto generate when focus is received.onBlur: event to raise when focus is lost.onBlurReq:WidgetRequestto generate when focus is lost.onClick: event to raise when the value is clicked.onClickReq:WidgetRequestto generate when the value is clicked.onChange: event to raise when the value changes.onChangeReq:WidgetRequestto generate when the value changes.
toggleButtonOffStyle :: Style -> ToggleButtonCfg s e a Source #
Sets the style for the Off state of the toggle button.
Constructors
toggleButton :: Text -> ALens' s Bool -> WidgetNode s e Source #
Creates a toggleButton using the given lens.
toggleButton_ :: Text -> ALens' s Bool -> [ToggleButtonCfg s e Bool] -> WidgetNode s e Source #
Creates a toggleButton using the given lens. Accepts config.
toggleButtonV :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> WidgetNode s e Source #
Creates a toggleButton using the given value and onChange event handler.
toggleButtonV_ :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> [ToggleButtonCfg s e Bool] -> WidgetNode s e Source #
Creates a toggleButton using the given value and onChange event handler.
Accepts config.
toggleButtonD_ :: Text -> WidgetData s Bool -> [ToggleButtonCfg s e Bool] -> WidgetNode s e Source #
Creates a toggleButton providing a WidgetData instance and config.