aboutsummaryrefslogtreecommitdiff
path: root/include/gui/CheckBox.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-11 19:19:10 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-11 19:19:10 +0200
commitcb04c11b2c29d973cdda9b0336024946bb3ca93d (patch)
tree791c067179a64d08531ada23fb2085695e68b14d /include/gui/CheckBox.hpp
parent234cc3391eba6be67964e5c98beeecd318b8e779 (diff)
Make checkbox nicer
Diffstat (limited to 'include/gui/CheckBox.hpp')
-rw-r--r--include/gui/CheckBox.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/gui/CheckBox.hpp b/include/gui/CheckBox.hpp
index 19ffaf6..8703794 100644
--- a/include/gui/CheckBox.hpp
+++ b/include/gui/CheckBox.hpp
@@ -4,6 +4,7 @@
#include <mglpp/graphics/Color.hpp>
#include <mglpp/graphics/Text.hpp>
+#include <mglpp/graphics/Sprite.hpp>
namespace gsr {
class CheckBox : public Widget {
@@ -17,12 +18,16 @@ namespace gsr {
mgl::vec2f get_size() override;
- void set_checked(bool checked);
+ void set_checked(bool checked, bool animated = false);
bool is_checked() const;
private:
+ void apply_animation();
mgl::vec2f get_checkbox_size();
private:
mgl::Text text;
+ mgl::Sprite background_sprite;
+ mgl::Sprite circle_sprite;
bool checked = false;
+ float toggle_animation_value = 0.0f;
};
} \ No newline at end of file