aboutsummaryrefslogtreecommitdiff
path: root/include/gui/Button.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-09 16:29:36 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-09 16:29:36 +0100
commitf38661593795e51e45e2dc2ead8a7bf897d226f6 (patch)
treeb0fa0fbf02ec8fc0c624f1de4197350571677100 /include/gui/Button.hpp
parentf3565fdd77fb480575feec5de252466b093daf86 (diff)
Start on global settings, add tint color setting
Diffstat (limited to 'include/gui/Button.hpp')
-rw-r--r--include/gui/Button.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gui/Button.hpp b/include/gui/Button.hpp
index bc1dd94..eb68e99 100644
--- a/include/gui/Button.hpp
+++ b/include/gui/Button.hpp
@@ -5,6 +5,7 @@
#include <mglpp/graphics/Color.hpp>
#include <mglpp/graphics/Text.hpp>
+#include <mglpp/graphics/Sprite.hpp>
namespace gsr {
class Button : public Widget {
@@ -20,15 +21,21 @@ namespace gsr {
mgl::vec2f get_size() override;
void set_border_scale(float scale);
+ void set_bg_hover_color(mgl::Color color);
+ void set_icon(mgl::Texture *texture);
const std::string& get_text() const;
void set_text(std::string str);
std::function<void()> on_click;
private:
+ void scale_sprite_to_button_size();
+ private:
mgl::vec2f size;
mgl::Color bg_color;
+ mgl::Color bg_hover_color;
mgl::Text text;
+ mgl::Sprite sprite;
float border_scale = 0.0015f;
};
} \ No newline at end of file