monomer-1.5.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 HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Containers.ThemeSwitch

Description

Switches to the provided theme for its child nodes.

theme = case activeTheme of
  DarkTheme -> darkTheme
  LightTheme -> lightTheme

widgetTree = themeSwitch theme $ vstack [
    hstack [
      label "Select theme:",
      spacer,
      textDropdownS activeTheme [DarkTheme, LightTheme]
    ]
  ]

Note: this widget ignores style settings applied to itself. If you need to display borders or any other kind of style configuration, set it on the child node or wrap the themeSwitch widget in a Monomer.Widgets.Containers.Box.

Synopsis

Configuration

data ThemeSwitchCfg Source #

Configuration options for themeSwitch:

  • themeClearBg: indicates the clear color of the theme should be applied before rendering children. Defaults to False.

themeClearBg :: ThemeSwitchCfg Source #

Indicates the clear color should be applied before rendering children.

themeClearBg_ :: Bool -> ThemeSwitchCfg Source #

Sets whether the clear color should be applied before rendering children.

Constructors

themeSwitch Source #

Arguments

:: Theme

The new theme.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created themeSwitch container.

Switches to a new theme starting from its child node.

themeSwitch_ Source #

Arguments

:: Theme

The new theme.

-> [ThemeSwitchCfg]

The config options.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created themeSwitch container.

Switches to a new theme starting from its child node. Accepts config.