Loading...
Searching...
No Matches
ml::PillSettings Struct Reference

Layout and behaviour settings for PillToggle. More...

#include <Malena/Traits/Settings/PillSettings.h>

Inheritance diagram for ml::PillSettings:
[legend]

Public Member Functions

void addItem (const std::string &label, const std::string &key)
void clearItems ()
float getAnimSpeed () const
const std::vector< std::pair< std::string, std::string > > & getItems () const
float getLabelOffset () const
std::string getLeftLabel () const
std::string getPillOffLabel () const
std::string getPillOnLabel () const
std::string getRightLabel () const
float getThumbMargin () const
sf::Vector2f getTrackSize () const
PillSettingsoperator= (const ControlSettings &c)
PillSettingsoperator= (const GraphicSettings &g)
PillSettingsoperator= (const ToggleSettings &t)
void setAnimSpeed (float s)
void setItems (std::vector< std::pair< std::string, std::string > > i)
void setLabelOffset (float o)
void setLeftLabel (const std::string &s)
void setPillLabels (const std::string &off, const std::string &on)
void setPillOffLabel (const std::string &s)
void setPillOnLabel (const std::string &s)
void setRightLabel (const std::string &s)
void setThumbMargin (float m)
void setTrackSize (const sf::Vector2f &s)

Public Attributes

float animSpeed = 10.f
std::vector< std::pair< std::string, std::string > > items
float labelOffset = 8.f
std::string leftLabel
std::string pillOffLabel
std::string pillOnLabel
std::string rightLabel
float thumbMargin = 2.f
sf::Vector2f trackSize = {44.f, 24.f}

Detailed Description

Layout and behaviour settings for PillToggle.

Colors live in PillTheme. PillSettings holds geometry and content — track size, thumb margin, labels, and animation speed (inherited from ToggleSettings).

See also
ToggleSettings, PillTheme, PillStyle, PillToggle

Definition at line 27 of file PillSettings.h.

Member Function Documentation

◆ addItem()

void ml::ToggleSettings::addItem ( const std::string & label,
const std::string & key )
inlineinherited

Definition at line 57 of file ToggleSettings.h.

◆ clearItems()

void ml::ToggleSettings::clearItems ( )
inlineinherited

Definition at line 60 of file ToggleSettings.h.

◆ getAnimSpeed()

float ml::ToggleSettings::getAnimSpeed ( ) const
inlinenodiscardinherited

Definition at line 48 of file ToggleSettings.h.

◆ getItems()

const std::vector< std::pair< std::string, std::string > > & ml::ToggleSettings::getItems ( ) const
inlinenodiscardinherited

Definition at line 52 of file ToggleSettings.h.

◆ getLabelOffset()

float ml::PillSettings::getLabelOffset ( ) const
inlinenodiscard

Definition at line 64 of file PillSettings.h.

◆ getLeftLabel()

std::string ml::PillSettings::getLeftLabel ( ) const
inlinenodiscard

Definition at line 67 of file PillSettings.h.

◆ getPillOffLabel()

std::string ml::PillSettings::getPillOffLabel ( ) const
inlinenodiscard

Definition at line 65 of file PillSettings.h.

◆ getPillOnLabel()

std::string ml::PillSettings::getPillOnLabel ( ) const
inlinenodiscard

Definition at line 66 of file PillSettings.h.

◆ getRightLabel()

std::string ml::PillSettings::getRightLabel ( ) const
inlinenodiscard

Definition at line 68 of file PillSettings.h.

◆ getThumbMargin()

float ml::PillSettings::getThumbMargin ( ) const
inlinenodiscard

Definition at line 63 of file PillSettings.h.

◆ getTrackSize()

sf::Vector2f ml::PillSettings::getTrackSize ( ) const
inlinenodiscard

Definition at line 62 of file PillSettings.h.

◆ operator=() [1/3]

PillSettings & ml::PillSettings::operator= ( const ControlSettings & c)
inline

Definition at line 48 of file PillSettings.h.

◆ operator=() [2/3]

PillSettings & ml::PillSettings::operator= ( const GraphicSettings & g)
inline

Definition at line 54 of file PillSettings.h.

◆ operator=() [3/3]

PillSettings & ml::PillSettings::operator= ( const ToggleSettings & t)
inline

Definition at line 42 of file PillSettings.h.

◆ setAnimSpeed()

void ml::ToggleSettings::setAnimSpeed ( float s)
inlineinherited

Definition at line 49 of file ToggleSettings.h.

◆ setItems()

void ml::ToggleSettings::setItems ( std::vector< std::pair< std::string, std::string > > i)
inlineinherited

Definition at line 54 of file ToggleSettings.h.

◆ setLabelOffset()

void ml::PillSettings::setLabelOffset ( float o)
inline

Definition at line 72 of file PillSettings.h.

◆ setLeftLabel()

void ml::PillSettings::setLeftLabel ( const std::string & s)
inline

Definition at line 77 of file PillSettings.h.

◆ setPillLabels()

void ml::PillSettings::setPillLabels ( const std::string & off,
const std::string & on )
inline

Definition at line 75 of file PillSettings.h.

◆ setPillOffLabel()

void ml::PillSettings::setPillOffLabel ( const std::string & s)
inline

Definition at line 73 of file PillSettings.h.

◆ setPillOnLabel()

void ml::PillSettings::setPillOnLabel ( const std::string & s)
inline

Definition at line 74 of file PillSettings.h.

◆ setRightLabel()

void ml::PillSettings::setRightLabel ( const std::string & s)
inline

Definition at line 78 of file PillSettings.h.

◆ setThumbMargin()

void ml::PillSettings::setThumbMargin ( float m)
inline

Definition at line 71 of file PillSettings.h.

◆ setTrackSize()

void ml::PillSettings::setTrackSize ( const sf::Vector2f & s)
inline

Definition at line 70 of file PillSettings.h.

Member Data Documentation

◆ animSpeed

float ml::ToggleSettings::animSpeed = 10.f
inherited

Definition at line 29 of file ToggleSettings.h.

◆ items

std::vector<std::pair<std::string, std::string> > ml::ToggleSettings::items
inherited

Definition at line 30 of file ToggleSettings.h.

◆ labelOffset

float ml::PillSettings::labelOffset = 8.f

Definition at line 32 of file PillSettings.h.

◆ leftLabel

std::string ml::PillSettings::leftLabel

Definition at line 37 of file PillSettings.h.

◆ pillOffLabel

std::string ml::PillSettings::pillOffLabel

Definition at line 35 of file PillSettings.h.

◆ pillOnLabel

std::string ml::PillSettings::pillOnLabel

Definition at line 36 of file PillSettings.h.

◆ rightLabel

std::string ml::PillSettings::rightLabel

Definition at line 38 of file PillSettings.h.

◆ thumbMargin

float ml::PillSettings::thumbMargin = 2.f

Definition at line 31 of file PillSettings.h.

◆ trackSize

sf::Vector2f ml::PillSettings::trackSize = {44.f, 24.f}

Definition at line 30 of file PillSettings.h.


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