3
4
5
6
7
8
9
10
11
12
15#include <pu/ui/elm/elm_Element.hpp>
17namespace pu::ui::
elm {
39 sdl2::Texture cnt_tex;
45 inline Color MakeBackgroundColor(
const u8 alpha) {
46 return this->bg_clr.WithAlpha(alpha);
50 Toggle(
const i32 x,
const i32 y,
const std::string &content,
const u64 toggle_key,
const Color clr);
58 inline void SetX(
const i32 x) {
66 inline void SetY(
const i32 y) {
78 void SetFont(
const std::string &font_name);
89 void OnInput(
const u64 keys_down,
const u64 keys_up,
const u64 keys_held,
const TouchPoint touch_pos)
override;
Definition elm_Element.hpp:37
Definition elm_Toggle.hpp:19
Toggle(const i32 x, const i32 y, const std::string &content, const u64 toggle_key, const Color clr)
void SetFont(const std::string &font_name)
void SetX(const i32 x)
Definition elm_Toggle.hpp:58
static constexpr Color DefaultBackgroundColor
Definition elm_Toggle.hpp:28
std::string GetContent()
Definition elm_Toggle.hpp:73
void OnRender(render::Renderer::Ref &drawer, const i32 x, const i32 y) override
i32 GetY() override
Definition elm_Toggle.hpp:62
static constexpr u32 DefaultContentVerticalMargin
Definition elm_Toggle.hpp:22
void OnInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
void SetColor(const Color clr)
void SetContent(const std::string &content)
static constexpr u8 DefaultToggleAlphaIncrement
Definition elm_Toggle.hpp:26
i32 GetX() override
Definition elm_Toggle.hpp:54
static constexpr u32 DefaultContentHorizontalMargin
Definition elm_Toggle.hpp:21
static constexpr DefaultFontSize DefaultContentFontSize
Definition elm_Toggle.hpp:24
void SetY(const i32 y)
Definition elm_Toggle.hpp:66
Definition render_Renderer.hpp:127
Definition sdl2_Types.hpp:10
Definition render_Renderer.hpp:20
Definition elm_Button.hpp:18
DefaultFontSize
Definition ui_Types.hpp:21
#define PU_SMART_CTOR(type)
Definition pu_Include.hpp:20
#define PU_CLASS_POD_GETSET(fn_name, var_name, type)
Definition pu_Include.hpp:37
#define PU_CLASS_POD_GET(fn_name, var_name, type)
Definition pu_Include.hpp:27
Definition ui_Types.hpp:44
Definition ui_Types.hpp:67