#include <Malena/Graphics/Controls/PillToggle.h>
Public Types | |
| using | Flag = PillToggleManifest::Flag |
| using | manifest_type |
The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations. | |
| using | State = PillToggleManifest::State |
Public Member Functions | |
| void | addItem (const std::string &label, const std::string &key) |
| PillTheme & | applyFrom (const Theme &t) override |
Populate all fields from the global Theme token set. | |
| template<typename S> | |
| void | applySettings (const S &s) |
| Apply layout/behaviour settings. Theme layer is unaffected. | |
| template<typename St> | |
| void | applyStyle (const St &s) |
| Apply settings and theme in one call. | |
| template<typename T> | |
| void | applyTheme (const T &t) |
| Apply color/font theme. Settings layer is unaffected. | |
| void | clearItems () |
| sf::Color | getActiveColor () const |
| sf::Color | getActiveTextColor () const |
| float | getAnimSpeed () const |
| unsigned int | getCharacterSize () const |
Alias for getFontSize() — matches SFML naming convention. | |
| sf::Color | getDisabledColor () const |
| sf::Color | getDisabledTextColor () const |
| sf::Color | getErrorColor () const |
| sf::Color | getFillColor () const |
| sf::Color | getFocusColor () const |
| const sf::Font * | getFont () const |
| unsigned int | getFontSize () const |
| unsigned int | getFontSizeSmall () const |
| sf::FloatRect | getGlobalBounds () const override |
| sf::Color | getHoverColor () const |
| sf::Color | getInactiveColor () const |
| const std::vector< std::pair< std::string, std::string > > & | getItems () const |
| float | getLabelOffset () const |
| std::string | getLeftLabel () const |
| sf::Color | getMutedColor () const |
| sf::Color | getOutlineColor () const |
| float | getOutlineThickness () const |
| float | getPadding () const |
| sf::Color | getPillLabelActiveColor () const |
| sf::Color | getPillLabelInactiveColor () const |
| std::string | getPillOffLabel () const |
| std::string | getPillOnLabel () const |
| sf::Vector2f | getPosition () const override |
| float | getRadius () const |
| std::string | getRightLabel () const |
| std::enable_if_t<!std::is_void_v< T >, T > | getState () const |
| Return the current state value. | |
| sf::Color | getTextColor () const |
| sf::Color | getThumbColor () const |
| sf::Color | getThumbDisabledColor () const |
| float | getThumbMargin () const |
| sf::Color | getTrackOffColor () const |
| sf::Color | getTrackOnColor () const |
| sf::Vector2f | getTrackSize () 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) |
| PillToggle () | |
| void | setActiveColor (const sf::Color &c) |
| void | setActiveTextColor (const sf::Color &c) |
| void | setAnimSpeed (float s) |
| void | setCharacterSize (unsigned int size) |
Alias for setFontSize() — matches SFML naming convention. | |
| 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 | setInactiveColor (const sf::Color &c) |
| void | setItems (std::vector< std::pair< std::string, std::string > > i) |
| void | setLabelOffset (float o) |
| void | setLeftLabel (const std::string &s) |
| void | setMutedColor (const sf::Color &c) |
| void | setOn (bool on) |
| void | setOutlineColor (const sf::Color &c) |
| void | setOutlineThickness (float t) |
| void | setPadding (float p) |
| void | setPillLabelActiveColor (const sf::Color &c) |
| void | setPillLabelInactiveColor (const sf::Color &c) |
| void | setPillLabels (const std::string &off, const std::string &on) |
| void | setPillOffLabel (const std::string &s) |
| void | setPillOnLabel (const std::string &s) |
| void | setPosition (const sf::Vector2f &position) override |
| void | setRadius (float r) |
| void | setRightLabel (const std::string &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 | setThumbColor (const sf::Color &c) |
| void | setThumbDisabledColor (const sf::Color &c) |
| void | setThumbMargin (float m) |
| void | setTrackOffColor (const sf::Color &c) |
| void | setTrackOnColor (const sf::Color &c) |
| void | setTrackSize (const sf::Vector2f &s) |
| void | toggle () |
| void | unlockSettings () |
Allow applySettings() to take effect again. | |
| void | unlockTheme () |
| Resume reacting to global theme changes. | |
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. | |
Definition at line 158 of file PillToggle.h.
|
inherited |
Definition at line 72 of file PillToggle.h.
|
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.
|
inherited |
Definition at line 73 of file PillToggle.h.
|
inlineinherited |
Definition at line 57 of file ToggleSettings.h.
Populate all fields from the global Theme token set.
Subclasses call GraphicTheme::applyFrom(t) first, then apply their own token mappings.
Reimplemented from ml::ControlTheme.
Definition at line 58 of file PillTheme.h.
|
inlineinherited |
Apply layout/behaviour settings. Theme layer is unaffected.
Definition at line 100 of file PillToggle.h.
|
inlineinherited |
Apply settings and theme in one call.
Definition at line 120 of file PillToggle.h.
|
inlineinherited |
Apply color/font theme. Settings layer is unaffected.
Definition at line 110 of file PillToggle.h.
|
inlineinherited |
Definition at line 60 of file ToggleSettings.h.
|
overrideprotectedinherited |
|
inlinenodiscardinherited |
Definition at line 63 of file ToggleTheme.h.
|
inlinenodiscardinherited |
Definition at line 65 of file ToggleTheme.h.
|
inlinenodiscardinherited |
Definition at line 48 of file ToggleSettings.h.
|
inlinenodiscardinherited |
Alias for getFontSize() — matches SFML naming convention.
Definition at line 144 of file PillToggle.h.
|
inlinenodiscardinherited |
Definition at line 75 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 76 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 74 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 67 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 73 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 80 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 81 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 82 of file ControlTheme.h.
|
overrideinherited |
|
inlinenodiscardinherited |
Definition at line 72 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 64 of file ToggleTheme.h.
|
inlinenodiscardinherited |
Definition at line 52 of file ToggleSettings.h.
|
inlinenodiscardinherited |
Definition at line 64 of file PillSettings.h.
|
inlinenodiscardinherited |
Definition at line 67 of file PillSettings.h.
|
inlinenodiscardinherited |
Definition at line 78 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 68 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 69 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 79 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 97 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 98 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 65 of file PillSettings.h.
|
inlinenodiscardinherited |
Definition at line 66 of file PillSettings.h.
|
overrideinherited |
|
inlinenodiscardinherited |
Definition at line 70 of file GraphicTheme.h.
|
inlinenodiscardinherited |
Definition at line 68 of file PillSettings.h.
|
inherited |
Return the current state value.
StateEnum value.
|
inlinenodiscardinherited |
Definition at line 77 of file ControlTheme.h.
|
inlinenodiscardinherited |
Definition at line 95 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 96 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 63 of file PillSettings.h.
|
inlinenodiscardinherited |
Definition at line 94 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 93 of file PillTheme.h.
|
inlinenodiscardinherited |
Definition at line 62 of file PillSettings.h.
|
nodiscardinherited |
|
nodiscardinherited |
|
inlinenodiscardinherited |
Return true if applySettings() is currently blocked.
Definition at line 115 of file Themeable.h.
|
inherited |
Return true if currently in state.
| state | The state value to compare against. |
true if the current state equals state.
|
inlinenodiscardinherited |
Return true if this component ignores theme changes.
Definition at line 97 of file Themeable.h.
|
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.
|
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.
|
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.
| callback | Function called with the new state after each transition. |
|
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.
| callback | Function called with the old state before each transition. |
|
overrideprotectedvirtualinherited |
Called by ThemeManager when the active theme changes.
Override in your component to re-style from the new theme. Always check isThemeLocked() first:
| theme | The newly active theme. |
Implements ml::Themeable.
|
inherited |
|
explicit |
|
inlineinherited |
Definition at line 67 of file ToggleTheme.h.
|
inlineinherited |
Definition at line 69 of file ToggleTheme.h.
|
inlineinherited |
Definition at line 49 of file ToggleSettings.h.
|
inlineinherited |
Alias for setFontSize() — matches SFML naming convention.
Definition at line 141 of file PillToggle.h.
|
inlineinherited |
Definition at line 87 of file ControlTheme.h.
|
inlineinherited |
Definition at line 88 of file ControlTheme.h.
|
inherited |
|
inlineinherited |
Definition at line 86 of file ControlTheme.h.
|
inlineinherited |
Definition at line 72 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 85 of file ControlTheme.h.
|
deleteinherited |
|
inlineinherited |
Definition at line 92 of file ControlTheme.h.
|
inlineinherited |
Definition at line 94 of file ControlTheme.h.
|
inlineinherited |
Definition at line 95 of file ControlTheme.h.
|
inlineinherited |
Definition at line 84 of file ControlTheme.h.
|
inlineinherited |
Definition at line 68 of file ToggleTheme.h.
|
inlineinherited |
Definition at line 54 of file ToggleSettings.h.
|
inlineinherited |
Definition at line 72 of file PillSettings.h.
|
inlineinherited |
Definition at line 77 of file PillSettings.h.
|
inlineinherited |
Definition at line 90 of file ControlTheme.h.
|
inherited |
|
inlineinherited |
Definition at line 73 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 74 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 91 of file ControlTheme.h.
|
inlineinherited |
Definition at line 104 of file PillTheme.h.
|
inlineinherited |
Definition at line 105 of file PillTheme.h.
|
inlineinherited |
Definition at line 75 of file PillSettings.h.
|
inlineinherited |
Definition at line 73 of file PillSettings.h.
|
inlineinherited |
Definition at line 74 of file PillSettings.h.
|
overrideinherited |
|
inlineinherited |
Definition at line 75 of file GraphicTheme.h.
|
inlineinherited |
Definition at line 78 of file PillSettings.h.
|
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.
| newState | The state to transition into. |
|
inlineinherited |
Definition at line 89 of file ControlTheme.h.
|
inlineinherited |
Definition at line 102 of file PillTheme.h.
|
inlineinherited |
Definition at line 103 of file PillTheme.h.
|
inlineinherited |
Definition at line 71 of file PillSettings.h.
|
inlineinherited |
Definition at line 101 of file PillTheme.h.
|
inlineinherited |
Definition at line 100 of file PillTheme.h.
|
inlineinherited |
Definition at line 70 of file PillSettings.h.
|
inherited |
|
inlineinherited |
Allow applySettings() to take effect again.
Definition at line 112 of file Themeable.h.
|
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.
Definition at line 32 of file ToggleTheme.h.
|
inherited |
Definition at line 34 of file ToggleTheme.h.
|
inherited |
Definition at line 29 of file ToggleSettings.h.
Definition at line 33 of file ControlTheme.h.
Definition at line 34 of file ControlTheme.h.
Definition at line 32 of file ControlTheme.h.
Definition at line 43 of file GraphicTheme.h.
Definition at line 31 of file ControlTheme.h.
|
inherited |
Definition at line 39 of file ControlTheme.h.
|
inherited |
Definition at line 40 of file ControlTheme.h.
|
inherited |
Definition at line 41 of file ControlTheme.h.
Definition at line 30 of file ControlTheme.h.
Definition at line 33 of file ToggleTheme.h.
|
inherited |
Definition at line 30 of file ToggleSettings.h.
|
inherited |
Definition at line 32 of file PillSettings.h.
|
inherited |
Definition at line 37 of file PillSettings.h.
Definition at line 36 of file ControlTheme.h.
Definition at line 44 of file GraphicTheme.h.
|
inherited |
Definition at line 45 of file GraphicTheme.h.
|
inherited |
Definition at line 37 of file ControlTheme.h.
|
inherited |
Definition at line 53 of file PillTheme.h.
Definition at line 54 of file PillTheme.h.
|
inherited |
Definition at line 35 of file PillSettings.h.
|
inherited |
Definition at line 36 of file PillSettings.h.
|
inherited |
Definition at line 46 of file GraphicTheme.h.
|
inherited |
Definition at line 38 of file PillSettings.h.
|
inherited |
Definition at line 35 of file ControlTheme.h.
|
inherited |
Definition at line 51 of file PillTheme.h.
Definition at line 52 of file PillTheme.h.
|
inherited |
Definition at line 31 of file PillSettings.h.
Definition at line 50 of file PillTheme.h.
Definition at line 49 of file PillTheme.h.
|
inherited |
Definition at line 30 of file PillSettings.h.