Files
dusklight/src/dusk/ui/bool_button.hpp
T
Ash 71961dae85 feat: Make gamepad status lighting optional (#1705)
* feat: Status Lighting option

* wip: rename to "Enable Controller LED"

* wip: setting for all four ports individually

* wip: fix detection + code cleanup

* wip: increase led speed for dusk preset

* wip: use aurora API

* bump aurora to 2b07d55

* wip: remove isSupported + fix namespace comment

* wip: add value override to BoolButton

* Style nit & remove unused

* Undo change

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-05-28 00:04:23 -06:00

36 lines
899 B
C++

#pragma once
#include "select_button.hpp"
namespace dusk::ui {
class BoolButton : public BaseControlledSelectButton {
public:
struct Props {
Rml::String key;
Rml::String icon;
std::function<bool()> getValue;
std::function<void(bool)> setValue;
std::function<bool()> isDisabled;
std::function<bool()> isModified;
std::function<Rml::String()> valueOverride;
};
BoolButton(Rml::Element* parent, Props props);
bool modified() const override;
bool disabled() const override;
protected:
Rml::String format_value() override;
bool handle_nav_command(NavCommand cmd) override;
private:
std::function<int()> mGetValue;
std::function<void(int)> mSetValue;
std::function<bool()> mIsDisabled;
std::function<bool()> mIsModified;
std::function<Rml::String()> mValueOverride;
};
} // namespace dusk::ui