From f38661593795e51e45e2dc2ead8a7bf897d226f6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 9 Dec 2024 16:29:36 +0100 Subject: Start on global settings, add tint color setting --- include/gui/Button.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/gui/Button.hpp') 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 #include +#include 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 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 -- cgit v1.2.3