MCPcopy Create free account
hub / github.com/FlagBrew/PKSM / ToggleButton

Method ToggleButton

common/source/gui/ToggleButton.cpp:29–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "ToggleButton.hpp"
28
29ToggleButton::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
48bool ToggleButton::update(touchPosition* touch)
49{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected