mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2025-10-30 08:03:03 +00:00
25 lines
No EOL
600 B
C++
25 lines
No EOL
600 B
C++
#pragma once
|
|
|
|
#include "ui_element.h"
|
|
|
|
namespace recompui {
|
|
|
|
enum class ButtonStyle {
|
|
Primary,
|
|
Secondary
|
|
};
|
|
|
|
class Button : public Element {
|
|
protected:
|
|
ButtonStyle style = ButtonStyle::Primary;
|
|
Style hover_style;
|
|
std::list<std::function<void()>> pressed_callbacks;
|
|
|
|
// Element overrides.
|
|
virtual void process_event(const Event &e) override;
|
|
public:
|
|
Button(const std::string &text, ButtonStyle style, Element *parent);
|
|
void add_pressed_callback(std::function<void()> callback);
|
|
};
|
|
|
|
} // namespace recompui
|