Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data ThemeSwitchCfg
- themeClearBg :: ThemeSwitchCfg
- themeClearBg_ :: Bool -> ThemeSwitchCfg
- themeSwitch :: Theme -> WidgetNode s e -> WidgetNode s e
- themeSwitch_ :: Theme -> [ThemeSwitchCfg] -> WidgetNode s e -> WidgetNode s e
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.
Instances
Monoid ThemeSwitchCfg Source # | |
Defined in Monomer.Widgets.Containers.ThemeSwitch mappend :: ThemeSwitchCfg -> ThemeSwitchCfg -> ThemeSwitchCfg # mconcat :: [ThemeSwitchCfg] -> ThemeSwitchCfg # | |
Semigroup ThemeSwitchCfg Source # | |
Defined in Monomer.Widgets.Containers.ThemeSwitch (<>) :: ThemeSwitchCfg -> ThemeSwitchCfg -> ThemeSwitchCfg # sconcat :: NonEmpty ThemeSwitchCfg -> ThemeSwitchCfg # stimes :: Integral b => b -> ThemeSwitchCfg -> ThemeSwitchCfg # | |
Show ThemeSwitchCfg Source # | |
Defined in Monomer.Widgets.Containers.ThemeSwitch showsPrec :: Int -> ThemeSwitchCfg -> ShowS # show :: ThemeSwitchCfg -> String # showList :: [ThemeSwitchCfg] -> ShowS # | |
Default ThemeSwitchCfg Source # | |
Defined in Monomer.Widgets.Containers.ThemeSwitch def :: ThemeSwitchCfg # | |
Eq ThemeSwitchCfg Source # | |
Defined in Monomer.Widgets.Containers.ThemeSwitch (==) :: ThemeSwitchCfg -> ThemeSwitchCfg -> Bool # (/=) :: ThemeSwitchCfg -> ThemeSwitchCfg -> Bool # |
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 :: Theme -> WidgetNode s e -> WidgetNode s e Source #
Switches to a new theme starting from its child node.
themeSwitch_ :: Theme -> [ThemeSwitchCfg] -> WidgetNode s e -> WidgetNode s e Source #
Switches to a new theme starting from its child node. Accepts config.