| 27 | #include "ToggleButton.hpp" |
| 28 | |
| 29 | ToggleButton::ToggleButton(int x, int y, u16 w, u16 h, const std::function<bool()>& callback, |
| 30 | int onImage, const std::string& onText, FontSize onFontSize, PKSM_Color onTextColor, |
| 31 | const std::optional<int>& offImage, const std::optional<std::string>& offText, |
| 32 | const std::optional<FontSize>& offFontSize, const std::optional<PKSM_Color>& offTextColor, |
| 33 | std::vector<std::unique_ptr<ToggleButton>>* radioCategory, bool disablable) |
| 34 | : ClickButton(x, y, w, h, callback, onImage, onText, onFontSize, onTextColor), |
| 35 | radioCategory(radioCategory), |
| 36 | onText(onText), |
| 37 | offText(offText.value_or(onText)), |
| 38 | onColor(onTextColor), |
| 39 | offColor(offTextColor.value_or(onTextColor)), |
| 40 | onFontSize(onFontSize), |
| 41 | offFontSize(offFontSize.value_or(onFontSize)), |
| 42 | onImage(onImage), |
| 43 | offImage(offImage.value_or(onImage)), |
| 44 | disablable(disablable) |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | bool ToggleButton::update(touchPosition* touch) |
| 49 | { |
nothing calls this directly
no outgoing calls
no test coverage detected