Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::StyleValues Class Reference

#include <aurore/core/style.hpp>

Public Member Functions

 StyleValues (std::initializer_list< std::pair< std::string, float > > list)
 The base metrics, of kind OTHER.
 
 StyleValues (std::initializer_list< StyleMetric > list)
 The base metrics, each with its kind.
 
void addMetric (const std::string &, float value)
 
void addLength (const std::string &name, float value)
 A length of the base (kind LENGTH): it follows the density.
 
float getMetric (const std::string &name)
 
float getRawMetric (const std::string &name)
 The metric as written, before the density.
 
MetricKind getKind (const std::string &name) const
 The kind of a metric (OTHER when unknown).
 
bool hasMetric (const std::string &name) const
 Whether the metric exists.
 
void setOverlay (const std::unordered_map< std::string, float > &overlay)
 The theme file's metrics, over the base (empty: the base alone).
 

Detailed Description

The metrics (sizes, margins, durations) by name, "aurore/sidebar/width"…: the ones the code adds, and over them a theme file's [metrics].

Constructor & Destructor Documentation

◆ StyleValues() [1/2]

aurore::StyleValues::StyleValues ( std::initializer_list< std::pair< std::string, float > >  list)

The base metrics, of kind OTHER.

◆ StyleValues() [2/2]

aurore::StyleValues::StyleValues ( std::initializer_list< StyleMetric >  list)

The base metrics, each with its kind.

Member Function Documentation

◆ addLength()

void aurore::StyleValues::addLength ( const std::string &  name,
float  value 
)

A length of the base (kind LENGTH): it follows the density.

◆ addMetric()

void aurore::StyleValues::addMetric ( const std::string &  ,
float  value 
)

A metric of the base: what it is without a theme file. A name already known keeps its kind; a new one is of kind OTHER.

◆ getKind()

MetricKind aurore::StyleValues::getKind ( const std::string &  name) const

The kind of a metric (OTHER when unknown).

◆ getMetric()

float aurore::StyleValues::getMetric ( const std::string &  name)

A metric, a length at the density in use; an unknown name is logged as an error and gives 0.

◆ getRawMetric()

float aurore::StyleValues::getRawMetric ( const std::string &  name)

The metric as written, before the density.

◆ hasMetric()

bool aurore::StyleValues::hasMetric ( const std::string &  name) const

Whether the metric exists.

◆ setOverlay()

void aurore::StyleValues::setOverlay ( const std::unordered_map< std::string, float > &  overlay)

The theme file's metrics, over the base (empty: the base alone).


The documentation for this class was generated from the following file: