mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-16 12:24:45 -04:00
71961dae85
* 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>
36 lines
899 B
C++
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
|