mousetrap v0.2.0
Loading...
Searching...
No Matches
mousetrap::StyleManager Struct Reference

style class manager singleton, keeps the global list of style classes updated More...

#include <style_manager.hpp>

Inheritance diagram for mousetrap::StyleManager:
mousetrap::Application

Static Public Member Functions

static void add_style_class (const StyleClass &)
 update / add a style class
 
static void remove_style_class (const StyleClass &)
 remove style class
 
static StyleClass get_style_class (const std::string &)
 retrieve style class
 
static void add_css (const std::string &)
 run arbitrary css code
 
static std::string define_color (const std::string &name, RGBA color)
 define a color, can be used by prefixing the given name with @
 
static std::string define_color (const std::string &name, HSVA color)
 define a color, can be used by prefixing the given name with @
 
static std::string color_to_css (RGBA)
 convert mousetrap color to css
 
static std::string color_to_css (HSVA)
 convert mousetrap color to css
 

Detailed Description

style class manager singleton, keeps the global list of style classes updated

Member Function Documentation

◆ add_css()

void mousetrap::StyleManager::add_css ( const std::string &  css)
static

run arbitrary css code

Parameters
css

Referenced by define_color().

◆ add_style_class()

void mousetrap::StyleManager::add_style_class ( const StyleClass style)
static

update / add a style class

Parameters
styleclass

References mousetrap::StyleClass::get_name(), remove_style_class(), and mousetrap::StyleClass::serialize().

Referenced by mousetrap::Widget::apply_style_class().

◆ color_to_css() [1/2]

std::string mousetrap::StyleManager::color_to_css ( HSVA  color)
static

convert mousetrap color to css

Parameters
colorHSVA
Returns
css string

References color_to_css().

◆ color_to_css() [2/2]

std::string mousetrap::StyleManager::color_to_css ( RGBA  color)
static

convert mousetrap color to css

Parameters
colorRGBA
Returns
css string

References mousetrap::RGBA::a, mousetrap::RGBA::b, mousetrap::RGBA::g, and mousetrap::RGBA::r.

Referenced by color_to_css(), and define_color().

◆ define_color() [1/2]

std::string mousetrap::StyleManager::define_color ( const std::string &  name,
HSVA  color 
)
static

define a color, can be used by prefixing the given name with @

Parameters
name
value

References define_color().

◆ define_color() [2/2]

std::string mousetrap::StyleManager::define_color ( const std::string &  name,
RGBA  color 
)
static

define a color, can be used by prefixing the given name with @

Parameters
name
value

References add_css(), and color_to_css().

Referenced by define_color().

◆ get_style_class()

StyleClass mousetrap::StyleManager::get_style_class ( const std::string &  name)
static

retrieve style class

Parameters
name
Returns
style class

References mousetrap::log::critical().

◆ remove_style_class()

void mousetrap::StyleManager::remove_style_class ( const StyleClass style)
static

remove style class

Parameters
styleclass

Referenced by add_style_class().


The documentation for this struct was generated from the following files: