2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include "Element.hpp"
|
|
|
|
|
|
|
|
|
|
namespace GUIStuff {
|
|
|
|
|
|
|
|
|
|
class CheckBox : public Element {
|
|
|
|
|
public:
|
2026-03-27 09:51:53 +03:00
|
|
|
CheckBox(GUIManager& gui);
|
|
|
|
|
|
2026-03-20 20:53:59 +03:00
|
|
|
virtual void clay_draw(SkCanvas* canvas, UpdateInputData& io, Clay_RenderCommand* command, bool skiaAA) override;
|
2026-03-27 09:51:53 +03:00
|
|
|
virtual bool input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) override;
|
|
|
|
|
virtual bool input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool mouseHovering) override;
|
|
|
|
|
|
2026-03-31 17:33:09 +03:00
|
|
|
void layout(const Clay_ElementId& id, const std::function<bool()>& isTicked, const std::function<void()>& onClick);
|
2025-07-06 20:43:53 +03:00
|
|
|
private:
|
|
|
|
|
static constexpr float CHECKBOX_ANIMATION_TIME = 0.3;
|
2026-03-27 09:51:53 +03:00
|
|
|
bool isHovering = false;
|
2025-07-06 20:43:53 +03:00
|
|
|
float hoverAnimation2 = 0.0;
|
2026-03-27 09:51:53 +03:00
|
|
|
std::function<bool()> isTicked;
|
|
|
|
|
std::function<void()> onClick;
|
2025-07-06 20:43:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|