Loading...
Searching...
No Matches
ml::ButtonToggleWith< MANIFEST > Class Template Reference

#include <Malena/Graphics/Controls/ButtonToggle.h>

Inheritance diagram for ml::ButtonToggleWith< MANIFEST >:
[legend]

Public Types

using Flag = ButtonToggleManifest::Flag
enum class  IconAlign { ICON_ONLY , ICON_LEFT , ICON_RIGHT , ICON_ABOVE }
using manifest_type
 The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.
using State = ButtonToggleManifest::State

Public Member Functions

void addItem (const std::string &label, const std::string &key)
ButtonThemeapplyFrom (const Theme &t) override
 Populate all fields from the global Theme token set.
template<typename S>
void applySettings (const S &s)
template<typename St>
void applyStyle (const St &s)
template<typename T>
void applyTheme (const T &t)
 ButtonToggle ()
void clearItems ()
sf::Color getActiveColor () const
sf::Color getActiveTextColor () const
float getAnimSpeed () const
sf::Color getBorderColor () const
float getBorderThickness () const
float getButtonRadius () const
sf::Color getDisabledColor () const
sf::Color getDisabledTextColor () const
sf::Color getErrorColor () const
sf::Color getFillColor () const
sf::Color getFocusColor () const
const sf::FontgetFont () const
unsigned int getFontSize () const
unsigned int getFontSizeSmall () const
sf::FloatRect getGlobalBounds () const override
sf::Color getHoverColor () const
IconAlign getIconAlign () const
const sf::TexturegetIconOff () const
sf::IntRect getIconOffRect () const
const sf::TexturegetIconOn () const
sf::IntRect getIconOnRect () const
float getIconPadding () const
sf::Vector2f getIconSize () const
sf::Color getInactiveColor () const
const std::vector< std::pair< std::string, std::string > > & getItems () const
sf::Color getMutedColor () const
sf::Color getOffColor () const
std::string getOffLabel () const
sf::Color getOffTextColor () const
sf::Color getOnColor () const
std::string getOnLabel () const
sf::Color getOnTextColor () const
sf::Color getOutlineColor () const
float getOutlineThickness () const
float getPadding () const
sf::Vector2f getPosition () const override
float getRadius () const
sf::Vector2f getSize () const
std::enable_if_t<!std::is_void_v< T >, T > getState () const
 Return the current state value.
sf::Color getTextColor () const
bool isEnabled () const
bool isOn () const
bool isSettingsLocked () const
 Return true if applySettings() is currently blocked.
std::enable_if_t<!std::is_void_v< T >, bool > isState (T state) const
 Return true if currently in state.
bool isThemeLocked () const
 Return true if this component ignores theme changes.
void lockSettings ()
 Prevent applySettings() from taking effect.
void lockTheme ()
 Prevent automatic re-styling when the global theme changes.
std::enable_if_t<!std::is_void_v< T > > onStateEnter (std::function< void(T)> callback)
 Register a callback invoked after each state transition.
std::enable_if_t<!std::is_void_v< T > > onStateExit (std::function< void(T)> callback)
 Register a callback invoked before each state transition.
void onToggled (std::function< void(bool)> callback)
void setActiveColor (const sf::Color &c)
void setActiveTextColor (const sf::Color &c)
void setAnimSpeed (float s)
void setBorderColor (const sf::Color &c)
void setBorderThickness (float t)
void setButtonRadius (float r)
void setDisabledColor (const sf::Color &c)
void setDisabledTextColor (const sf::Color &c)
void setEnabled (bool enabled)
void setErrorColor (const sf::Color &c)
void setFillColor (const sf::Color &c)
void setFocusColor (const sf::Color &c)
void setFont (const sf::Font &&)=delete
void setFont (const sf::Font &f)
void setFontSize (unsigned int s)
void setFontSizeSmall (unsigned int s)
void setHoverColor (const sf::Color &c)
void setIconAlign (IconAlign a)
void setIconOff (const sf::Texture *t)
void setIconOffRect (const sf::IntRect &r)
void setIconOn (const sf::Texture *t)
void setIconOnRect (const sf::IntRect &r)
void setIconPadding (float p)
void setIcons (const sf::Texture *on, const sf::Texture *off=nullptr)
void setIconSize (const sf::Vector2f &s)
void setInactiveColor (const sf::Color &c)
void setItems (std::vector< std::pair< std::string, std::string > > i)
void setLabels (const std::string &on, const std::string &off)
void setMutedColor (const sf::Color &c)
void setOffColor (const sf::Color &c)
void setOffLabel (const std::string &s)
void setOffTextColor (const sf::Color &c)
void setOn (bool on)
void setOnColor (const sf::Color &c)
void setOnLabel (const std::string &s)
void setOnTextColor (const sf::Color &c)
void setOutlineColor (const sf::Color &c)
void setOutlineThickness (float t)
void setPadding (float p)
void setPosition (const sf::Vector2f &position) override
void setRadius (float r)
void setSize (const sf::Vector2f &s)
std::enable_if_t<!std::is_void_v< T > > setState (T newState)
 Transition to a new state.
void setTextColor (const sf::Color &c)
void toggle ()
void unlockSettings ()
 Allow applySettings() to take effect again.
void unlockTheme ()
 Resume reacting to global theme changes.

Public Attributes

sf::Color activeColor = sf::Color(100, 60, 200)
sf::Color activeTextColor = sf::Color::White
float animSpeed = 10.f
sf::Color borderColor = sf::Color(100, 100, 100)
float borderThickness = 1.5f
float buttonRadius = 8.f
sf::Color disabledColor = sf::Color(60, 60, 60)
sf::Color disabledTextColor = sf::Color(120, 120, 120)
sf::Color errorColor = sf::Color(220, 70, 70)
sf::Color fillColor = sf::Color(40, 40, 40)
sf::Color focusColor = sf::Color(100, 60, 200)
const sf::Fontfont = &FontManager<>::getDefault()
unsigned int fontSize = 14
unsigned int fontSizeSmall = 11
sf::Color hoverColor = sf::Color(70, 130, 230)
IconAlign iconAlign = IconAlign::ICON_ONLY
const sf::TextureiconOff = nullptr
sf::IntRect iconOffRect
const sf::TextureiconOn = nullptr
sf::IntRect iconOnRect
float iconPadding = 6.f
sf::Vector2f iconSize = {0.f, 0.f}
 {0,0} = native size
sf::Color inactiveColor = sf::Color(40, 40, 40)
std::vector< std::pair< std::string, std::string > > items
sf::Color mutedColor = sf::Color(120, 120, 120)
sf::Color offColor = sf::Color(40, 40, 40)
std::string offLabel = "OFF"
sf::Color offTextColor = sf::Color(180, 180, 180)
sf::Color onColor = sf::Color(100, 60, 200)
std::string onLabel = "ON"
sf::Color onTextColor = sf::Color::White
sf::Color outlineColor = sf::Color(100, 100, 100)
float outlineThickness = 1.5f
float padding = 8.f
float radius = 8.f
sf::Vector2f size = {100.f, 36.f}
sf::Color textColor = sf::Color::White

Protected Member Functions

void draw (sf::RenderTarget &target, sf::RenderStates states) const override
void onThemeApplied (const Theme &theme) override
 Called by ThemeManager when the active theme changes.

Detailed Description

template<typename MANIFEST>
class ml::ButtonToggleWith< MANIFEST >

Definition at line 114 of file ButtonToggle.h.

Member Typedef Documentation

◆ Flag

Definition at line 55 of file ButtonToggle.h.

◆ manifest_type

using ml::Customizable< MANIFEST >::manifest_type
inherited

The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.

Definition at line 65 of file Customizable.h.

◆ State

Definition at line 56 of file ButtonToggle.h.

Member Enumeration Documentation

◆ IconAlign

enum class ml::ButtonSettings::IconAlign
stronginherited
Enumerator
ICON_ONLY 
ICON_LEFT 
ICON_RIGHT 
ICON_ABOVE 

Definition at line 43 of file ButtonSettings.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.

◆ applyFrom()

ButtonTheme & ml::ButtonTheme::applyFrom ( const Theme & t)
inlineoverridevirtualinherited

Populate all fields from the global Theme token set.

Subclasses call GraphicTheme::applyFrom(t) first, then apply their own token mappings.

Reimplemented from ml::GraphicTheme.

Definition at line 39 of file ButtonTheme.h.

◆ applySettings()

template<typename S>
void ml::ButtonToggle::applySettings ( const S & s)
inlineinherited

Definition at line 72 of file ButtonToggle.h.

◆ applyStyle()

template<typename St>
void ml::ButtonToggle::applyStyle ( const St & s)
inlineinherited

Definition at line 90 of file ButtonToggle.h.

◆ applyTheme()

template<typename T>
void ml::ButtonToggle::applyTheme ( const T & t)
inlineinherited

Definition at line 81 of file ButtonToggle.h.

◆ ButtonToggle()

template<typename MANIFEST>
ml::ButtonToggle::ButtonToggle ( )
explicit

◆ clearItems()

void ml::ToggleSettings::clearItems ( )
inlineinherited

Definition at line 60 of file ToggleSettings.h.

◆ draw()

void ml::ButtonToggle::draw ( sf::RenderTarget & target,
sf::RenderStates states ) const
overrideprotectedinherited

◆ getActiveColor()

sf::Color ml::ToggleTheme::getActiveColor ( ) const
inlinenodiscardinherited

Definition at line 63 of file ToggleTheme.h.

◆ getActiveTextColor()

sf::Color ml::ToggleTheme::getActiveTextColor ( ) const
inlinenodiscardinherited

Definition at line 65 of file ToggleTheme.h.

◆ getAnimSpeed()

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

Definition at line 48 of file ToggleSettings.h.

◆ getBorderColor()

sf::Color ml::ButtonTheme::getBorderColor ( ) const
inlinenodiscardinherited

Definition at line 78 of file ButtonTheme.h.

◆ getBorderThickness()

float ml::ButtonTheme::getBorderThickness ( ) const
inlinenodiscardinherited

Definition at line 79 of file ButtonTheme.h.

◆ getButtonRadius()

float ml::ButtonTheme::getButtonRadius ( ) const
inlinenodiscardinherited

Definition at line 80 of file ButtonTheme.h.

◆ getDisabledColor()

sf::Color ml::ControlTheme::getDisabledColor ( ) const
inlinenodiscardinherited

Definition at line 75 of file ControlTheme.h.

◆ getDisabledTextColor()

sf::Color ml::ControlTheme::getDisabledTextColor ( ) const
inlinenodiscardinherited

Definition at line 76 of file ControlTheme.h.

◆ getErrorColor()

sf::Color ml::ControlTheme::getErrorColor ( ) const
inlinenodiscardinherited

Definition at line 74 of file ControlTheme.h.

◆ getFillColor()

sf::Color ml::GraphicTheme::getFillColor ( ) const
inlinenodiscardinherited

Definition at line 67 of file GraphicTheme.h.

◆ getFocusColor()

sf::Color ml::ControlTheme::getFocusColor ( ) const
inlinenodiscardinherited

Definition at line 73 of file ControlTheme.h.

◆ getFont()

const sf::Font * ml::ControlTheme::getFont ( ) const
inlinenodiscardinherited

Definition at line 80 of file ControlTheme.h.

◆ getFontSize()

unsigned int ml::ControlTheme::getFontSize ( ) const
inlinenodiscardinherited

Definition at line 81 of file ControlTheme.h.

◆ getFontSizeSmall()

unsigned int ml::ControlTheme::getFontSizeSmall ( ) const
inlinenodiscardinherited

Definition at line 82 of file ControlTheme.h.

◆ getGlobalBounds()

sf::FloatRect ml::ButtonToggle::getGlobalBounds ( ) const
overrideinherited

◆ getHoverColor()

sf::Color ml::ControlTheme::getHoverColor ( ) const
inlinenodiscardinherited

Definition at line 72 of file ControlTheme.h.

◆ getIconAlign()

IconAlign ml::ButtonSettings::getIconAlign ( ) const
inlinenodiscardinherited

Definition at line 77 of file ButtonSettings.h.

◆ getIconOff()

const sf::Texture * ml::ButtonSettings::getIconOff ( ) const
inlinenodiscardinherited

Definition at line 73 of file ButtonSettings.h.

◆ getIconOffRect()

sf::IntRect ml::ButtonSettings::getIconOffRect ( ) const
inlinenodiscardinherited

Definition at line 76 of file ButtonSettings.h.

◆ getIconOn()

const sf::Texture * ml::ButtonSettings::getIconOn ( ) const
inlinenodiscardinherited

Definition at line 72 of file ButtonSettings.h.

◆ getIconOnRect()

sf::IntRect ml::ButtonSettings::getIconOnRect ( ) const
inlinenodiscardinherited

Definition at line 75 of file ButtonSettings.h.

◆ getIconPadding()

float ml::ButtonSettings::getIconPadding ( ) const
inlinenodiscardinherited

Definition at line 78 of file ButtonSettings.h.

◆ getIconSize()

sf::Vector2f ml::ButtonSettings::getIconSize ( ) const
inlinenodiscardinherited

Definition at line 74 of file ButtonSettings.h.

◆ getInactiveColor()

sf::Color ml::ToggleTheme::getInactiveColor ( ) const
inlinenodiscardinherited

Definition at line 64 of file ToggleTheme.h.

◆ getItems()

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

Definition at line 52 of file ToggleSettings.h.

◆ getMutedColor()

sf::Color ml::ControlTheme::getMutedColor ( ) const
inlinenodiscardinherited

Definition at line 78 of file ControlTheme.h.

◆ getOffColor()

sf::Color ml::ButtonTheme::getOffColor ( ) const
inlinenodiscardinherited

Definition at line 75 of file ButtonTheme.h.

◆ getOffLabel()

std::string ml::ButtonSettings::getOffLabel ( ) const
inlinenodiscardinherited

Definition at line 71 of file ButtonSettings.h.

◆ getOffTextColor()

sf::Color ml::ButtonTheme::getOffTextColor ( ) const
inlinenodiscardinherited

Definition at line 77 of file ButtonTheme.h.

◆ getOnColor()

sf::Color ml::ButtonTheme::getOnColor ( ) const
inlinenodiscardinherited

Definition at line 74 of file ButtonTheme.h.

◆ getOnLabel()

std::string ml::ButtonSettings::getOnLabel ( ) const
inlinenodiscardinherited

Definition at line 70 of file ButtonSettings.h.

◆ getOnTextColor()

sf::Color ml::ButtonTheme::getOnTextColor ( ) const
inlinenodiscardinherited

Definition at line 76 of file ButtonTheme.h.

◆ getOutlineColor()

sf::Color ml::GraphicTheme::getOutlineColor ( ) const
inlinenodiscardinherited

Definition at line 68 of file GraphicTheme.h.

◆ getOutlineThickness()

float ml::GraphicTheme::getOutlineThickness ( ) const
inlinenodiscardinherited

Definition at line 69 of file GraphicTheme.h.

◆ getPadding()

float ml::ControlTheme::getPadding ( ) const
inlinenodiscardinherited

Definition at line 79 of file ControlTheme.h.

◆ getPosition()

sf::Vector2f ml::ButtonToggle::getPosition ( ) const
overrideinherited

◆ getRadius()

float ml::GraphicTheme::getRadius ( ) const
inlinenodiscardinherited

Definition at line 70 of file GraphicTheme.h.

◆ getSize()

sf::Vector2f ml::ButtonSettings::getSize ( ) const
inlinenodiscardinherited

Definition at line 69 of file ButtonSettings.h.

◆ getState()

std::enable_if_t<!std::is_void_v< T >, T > ml::StateManager< extract_State< MANIFEST >::type >::getState ( ) const
inherited

Return the current state value.

Returns
The active StateEnum value.

◆ getTextColor()

sf::Color ml::ControlTheme::getTextColor ( ) const
inlinenodiscardinherited

Definition at line 77 of file ControlTheme.h.

◆ isEnabled()

bool ml::ButtonToggle::isEnabled ( ) const
nodiscardinherited

◆ isOn()

bool ml::ButtonToggle::isOn ( ) const
nodiscardinherited

◆ isSettingsLocked()

bool ml::Themeable::isSettingsLocked ( ) const
inlinenodiscardinherited

Return true if applySettings() is currently blocked.

Definition at line 115 of file Themeable.h.

◆ isState()

std::enable_if_t<!std::is_void_v< T >, bool > ml::StateManager< extract_State< MANIFEST >::type >::isState ( T state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isThemeLocked()

bool ml::Themeable::isThemeLocked ( ) const
inlinenodiscardinherited

Return true if this component ignores theme changes.

Definition at line 97 of file Themeable.h.

◆ lockSettings()

void ml::Themeable::lockSettings ( )
inlineinherited

Prevent applySettings() from taking effect.

Explicit individual setter calls still work normally. Only blocks the batch applySettings() path.

Definition at line 107 of file Themeable.h.

◆ lockTheme()

void ml::Themeable::lockTheme ( )
inlineinherited

Prevent automatic re-styling when the global theme changes.

The component keeps its current visual state. Explicit individual setter calls still work normally.

Definition at line 85 of file Themeable.h.

◆ onStateEnter()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::onStateEnter ( std::function< void(T)> callback)
inherited

Register a callback invoked after each state transition.

The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateExit()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::onStateExit ( std::function< void(T)> callback)
inherited

Register a callback invoked before each state transition.

The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the old state before each transition.

◆ onThemeApplied()

void ml::ButtonToggle::onThemeApplied ( const Theme & theme)
overrideprotectedvirtualinherited

Called by ThemeManager when the active theme changes.

Override in your component to re-style from the new theme. Always check isThemeLocked() first:

void onThemeApplied(const Theme& theme) override
{
if (isThemeLocked()) return;
MySettings::applyTheme(theme);
syncFromSettings();
}
void onThemeApplied(const Theme &theme) override
Called by ThemeManager when the active theme changes.
bool isThemeLocked() const
Return true if this component ignores theme changes.
Definition Themeable.h:97
Universal design token set applied across all Themeable components.
Definition Theme.h:70
Parameters
themeThe newly active theme.

Implements ml::Themeable.

◆ onToggled()

void ml::ButtonToggle::onToggled ( std::function< void(bool)> callback)
inherited

◆ setActiveColor()

void ml::ToggleTheme::setActiveColor ( const sf::Color & c)
inlineinherited

Definition at line 67 of file ToggleTheme.h.

◆ setActiveTextColor()

void ml::ToggleTheme::setActiveTextColor ( const sf::Color & c)
inlineinherited

Definition at line 69 of file ToggleTheme.h.

◆ setAnimSpeed()

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

Definition at line 49 of file ToggleSettings.h.

◆ setBorderColor()

void ml::ButtonTheme::setBorderColor ( const sf::Color & c)
inlineinherited

Definition at line 86 of file ButtonTheme.h.

◆ setBorderThickness()

void ml::ButtonTheme::setBorderThickness ( float t)
inlineinherited

Definition at line 87 of file ButtonTheme.h.

◆ setButtonRadius()

void ml::ButtonTheme::setButtonRadius ( float r)
inlineinherited

Definition at line 88 of file ButtonTheme.h.

◆ setDisabledColor()

void ml::ControlTheme::setDisabledColor ( const sf::Color & c)
inlineinherited

Definition at line 87 of file ControlTheme.h.

◆ setDisabledTextColor()

void ml::ControlTheme::setDisabledTextColor ( const sf::Color & c)
inlineinherited

Definition at line 88 of file ControlTheme.h.

◆ setEnabled()

void ml::ButtonToggle::setEnabled ( bool enabled)
inherited

◆ setErrorColor()

void ml::ControlTheme::setErrorColor ( const sf::Color & c)
inlineinherited

Definition at line 86 of file ControlTheme.h.

◆ setFillColor()

void ml::GraphicTheme::setFillColor ( const sf::Color & c)
inlineinherited

Definition at line 72 of file GraphicTheme.h.

◆ setFocusColor()

void ml::ControlTheme::setFocusColor ( const sf::Color & c)
inlineinherited

Definition at line 85 of file ControlTheme.h.

◆ setFont() [1/2]

void ml::ControlTheme::setFont ( const sf::Font && )
deleteinherited

◆ setFont() [2/2]

void ml::ControlTheme::setFont ( const sf::Font & f)
inlineinherited

Definition at line 92 of file ControlTheme.h.

◆ setFontSize()

void ml::ControlTheme::setFontSize ( unsigned int s)
inlineinherited

Definition at line 94 of file ControlTheme.h.

◆ setFontSizeSmall()

void ml::ControlTheme::setFontSizeSmall ( unsigned int s)
inlineinherited

Definition at line 95 of file ControlTheme.h.

◆ setHoverColor()

void ml::ControlTheme::setHoverColor ( const sf::Color & c)
inlineinherited

Definition at line 84 of file ControlTheme.h.

◆ setIconAlign()

void ml::ButtonSettings::setIconAlign ( IconAlign a)
inlineinherited

Definition at line 93 of file ButtonSettings.h.

◆ setIconOff()

void ml::ButtonSettings::setIconOff ( const sf::Texture * t)
inlineinherited

Definition at line 89 of file ButtonSettings.h.

◆ setIconOffRect()

void ml::ButtonSettings::setIconOffRect ( const sf::IntRect & r)
inlineinherited

Definition at line 92 of file ButtonSettings.h.

◆ setIconOn()

void ml::ButtonSettings::setIconOn ( const sf::Texture * t)
inlineinherited

Definition at line 88 of file ButtonSettings.h.

◆ setIconOnRect()

void ml::ButtonSettings::setIconOnRect ( const sf::IntRect & r)
inlineinherited

Definition at line 91 of file ButtonSettings.h.

◆ setIconPadding()

void ml::ButtonSettings::setIconPadding ( float p)
inlineinherited

Definition at line 94 of file ButtonSettings.h.

◆ setIcons()

void ml::ButtonSettings::setIcons ( const sf::Texture * on,
const sf::Texture * off = nullptr )
inlineinherited

Definition at line 85 of file ButtonSettings.h.

◆ setIconSize()

void ml::ButtonSettings::setIconSize ( const sf::Vector2f & s)
inlineinherited

Definition at line 90 of file ButtonSettings.h.

◆ setInactiveColor()

void ml::ToggleTheme::setInactiveColor ( const sf::Color & c)
inlineinherited

Definition at line 68 of file ToggleTheme.h.

◆ setItems()

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

Definition at line 54 of file ToggleSettings.h.

◆ setLabels()

void ml::ButtonSettings::setLabels ( const std::string & on,
const std::string & off )
inlineinherited

Definition at line 83 of file ButtonSettings.h.

◆ setMutedColor()

void ml::ControlTheme::setMutedColor ( const sf::Color & c)
inlineinherited

Definition at line 90 of file ControlTheme.h.

◆ setOffColor()

void ml::ButtonTheme::setOffColor ( const sf::Color & c)
inlineinherited

Definition at line 83 of file ButtonTheme.h.

◆ setOffLabel()

void ml::ButtonSettings::setOffLabel ( const std::string & s)
inlineinherited

Definition at line 82 of file ButtonSettings.h.

◆ setOffTextColor()

void ml::ButtonTheme::setOffTextColor ( const sf::Color & c)
inlineinherited

Definition at line 85 of file ButtonTheme.h.

◆ setOn()

void ml::ButtonToggle::setOn ( bool on)
inherited

◆ setOnColor()

void ml::ButtonTheme::setOnColor ( const sf::Color & c)
inlineinherited

Definition at line 82 of file ButtonTheme.h.

◆ setOnLabel()

void ml::ButtonSettings::setOnLabel ( const std::string & s)
inlineinherited

Definition at line 81 of file ButtonSettings.h.

◆ setOnTextColor()

void ml::ButtonTheme::setOnTextColor ( const sf::Color & c)
inlineinherited

Definition at line 84 of file ButtonTheme.h.

◆ setOutlineColor()

void ml::GraphicTheme::setOutlineColor ( const sf::Color & c)
inlineinherited

Definition at line 73 of file GraphicTheme.h.

◆ setOutlineThickness()

void ml::GraphicTheme::setOutlineThickness ( float t)
inlineinherited

Definition at line 74 of file GraphicTheme.h.

◆ setPadding()

void ml::ControlTheme::setPadding ( float p)
inlineinherited

Definition at line 91 of file ControlTheme.h.

◆ setPosition()

void ml::ButtonToggle::setPosition ( const sf::Vector2f & position)
overrideinherited

◆ setRadius()

void ml::GraphicTheme::setRadius ( float r)
inlineinherited

Definition at line 75 of file GraphicTheme.h.

◆ setSize()

void ml::ButtonSettings::setSize ( const sf::Vector2f & s)
inlineinherited

Definition at line 80 of file ButtonSettings.h.

◆ setState()

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< MANIFEST >::type >::setState ( T newState)
inherited

Transition to a new state.

Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.

Parameters
newStateThe state to transition into.

◆ setTextColor()

void ml::ControlTheme::setTextColor ( const sf::Color & c)
inlineinherited

Definition at line 89 of file ControlTheme.h.

◆ toggle()

void ml::ButtonToggle::toggle ( )
inherited

◆ unlockSettings()

void ml::Themeable::unlockSettings ( )
inlineinherited

Allow applySettings() to take effect again.

Definition at line 112 of file Themeable.h.

◆ unlockTheme()

void ml::Themeable::unlockTheme ( )
inlineinherited

Resume reacting to global theme changes.

Does NOT immediately re-apply the current theme — call ThemeManager::get() and pass it to onThemeApplied() manually if you want to re-sync immediately after unlocking.

Definition at line 94 of file Themeable.h.

Member Data Documentation

◆ activeColor

sf::Color ml::ToggleTheme::activeColor = sf::Color(100, 60, 200)
inherited

Definition at line 32 of file ToggleTheme.h.

◆ activeTextColor

sf::Color ml::ToggleTheme::activeTextColor = sf::Color::White
inherited

Definition at line 34 of file ToggleTheme.h.

◆ animSpeed

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

Definition at line 29 of file ToggleSettings.h.

◆ borderColor

sf::Color ml::ButtonTheme::borderColor = sf::Color(100, 100, 100)
inherited

Definition at line 33 of file ButtonTheme.h.

◆ borderThickness

float ml::ButtonTheme::borderThickness = 1.5f
inherited

Definition at line 34 of file ButtonTheme.h.

◆ buttonRadius

float ml::ButtonTheme::buttonRadius = 8.f
inherited

Definition at line 35 of file ButtonTheme.h.

◆ disabledColor

sf::Color ml::ControlTheme::disabledColor = sf::Color(60, 60, 60)
inherited

Definition at line 33 of file ControlTheme.h.

◆ disabledTextColor

sf::Color ml::ControlTheme::disabledTextColor = sf::Color(120, 120, 120)
inherited

Definition at line 34 of file ControlTheme.h.

◆ errorColor

sf::Color ml::ControlTheme::errorColor = sf::Color(220, 70, 70)
inherited

Definition at line 32 of file ControlTheme.h.

◆ fillColor

sf::Color ml::GraphicTheme::fillColor = sf::Color(40, 40, 40)
inherited

Definition at line 43 of file GraphicTheme.h.

◆ focusColor

sf::Color ml::ControlTheme::focusColor = sf::Color(100, 60, 200)
inherited

Definition at line 31 of file ControlTheme.h.

◆ font

const sf::Font* ml::ControlTheme::font = &FontManager<>::getDefault()
inherited

Definition at line 39 of file ControlTheme.h.

◆ fontSize

unsigned int ml::ControlTheme::fontSize = 14
inherited

Definition at line 40 of file ControlTheme.h.

◆ fontSizeSmall

unsigned int ml::ControlTheme::fontSizeSmall = 11
inherited

Definition at line 41 of file ControlTheme.h.

◆ hoverColor

sf::Color ml::ControlTheme::hoverColor = sf::Color(70, 130, 230)
inherited

Definition at line 30 of file ControlTheme.h.

◆ iconAlign

IconAlign ml::ButtonSettings::iconAlign = IconAlign::ICON_ONLY
inherited

Definition at line 44 of file ButtonSettings.h.

◆ iconOff

const sf::Texture* ml::ButtonSettings::iconOff = nullptr
inherited

Definition at line 38 of file ButtonSettings.h.

◆ iconOffRect

sf::IntRect ml::ButtonSettings::iconOffRect
inherited

Definition at line 41 of file ButtonSettings.h.

◆ iconOn

const sf::Texture* ml::ButtonSettings::iconOn = nullptr
inherited

Definition at line 37 of file ButtonSettings.h.

◆ iconOnRect

sf::IntRect ml::ButtonSettings::iconOnRect
inherited

Definition at line 40 of file ButtonSettings.h.

◆ iconPadding

float ml::ButtonSettings::iconPadding = 6.f
inherited

Definition at line 45 of file ButtonSettings.h.

◆ iconSize

sf::Vector2f ml::ButtonSettings::iconSize = {0.f, 0.f}
inherited

{0,0} = native size

Definition at line 39 of file ButtonSettings.h.

◆ inactiveColor

sf::Color ml::ToggleTheme::inactiveColor = sf::Color(40, 40, 40)
inherited

Definition at line 33 of file ToggleTheme.h.

◆ items

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

Definition at line 30 of file ToggleSettings.h.

◆ mutedColor

sf::Color ml::ControlTheme::mutedColor = sf::Color(120, 120, 120)
inherited

Definition at line 36 of file ControlTheme.h.

◆ offColor

sf::Color ml::ButtonTheme::offColor = sf::Color(40, 40, 40)
inherited

Definition at line 30 of file ButtonTheme.h.

◆ offLabel

std::string ml::ButtonSettings::offLabel = "OFF"
inherited

Definition at line 34 of file ButtonSettings.h.

◆ offTextColor

sf::Color ml::ButtonTheme::offTextColor = sf::Color(180, 180, 180)
inherited

Definition at line 32 of file ButtonTheme.h.

◆ onColor

sf::Color ml::ButtonTheme::onColor = sf::Color(100, 60, 200)
inherited

Definition at line 29 of file ButtonTheme.h.

◆ onLabel

std::string ml::ButtonSettings::onLabel = "ON"
inherited

Definition at line 33 of file ButtonSettings.h.

◆ onTextColor

sf::Color ml::ButtonTheme::onTextColor = sf::Color::White
inherited

Definition at line 31 of file ButtonTheme.h.

◆ outlineColor

sf::Color ml::GraphicTheme::outlineColor = sf::Color(100, 100, 100)
inherited

Definition at line 44 of file GraphicTheme.h.

◆ outlineThickness

float ml::GraphicTheme::outlineThickness = 1.5f
inherited

Definition at line 45 of file GraphicTheme.h.

◆ padding

float ml::ControlTheme::padding = 8.f
inherited

Definition at line 37 of file ControlTheme.h.

◆ radius

float ml::GraphicTheme::radius = 8.f
inherited

Definition at line 46 of file GraphicTheme.h.

◆ size

sf::Vector2f ml::ButtonSettings::size = {100.f, 36.f}
inherited

Definition at line 30 of file ButtonSettings.h.

◆ textColor

sf::Color ml::ControlTheme::textColor = sf::Color::White
inherited

Definition at line 35 of file ControlTheme.h.


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