diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-09-25 17:29:17 +0200 |
commit | 497217a3e09b577f650aaf503356588515067ca8 (patch) | |
tree | 2fd43b747957510c55d66caf81df30732c39c398 /src/gui/Button.cpp | |
parent | 663a36df4aaea583e7cd56ad35b26d05f6151746 (diff) |
widgets
Diffstat (limited to 'src/gui/Button.cpp')
-rw-r--r-- | src/gui/Button.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index 1436f86..5a71a16 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -9,7 +9,7 @@ namespace gsr { } - void Button::on_event(mgl::Event &event, mgl::Window&) { + bool Button::on_event(mgl::Event &event, mgl::Window&) { if(event.type == mgl::Event::MouseMoved) { const bool inside = mgl::FloatRect(position, size).contains({ (float)event.mouse_move.x, (float)event.mouse_move.y }); if(mouse_inside && !inside) { @@ -25,6 +25,7 @@ namespace gsr { if(clicked_inside && on_click) on_click(); } + return true; } void Button::draw(mgl::Window &window) { @@ -33,7 +34,7 @@ namespace gsr { { mgl::Rectangle rect(size); rect.set_position(position); - rect.set_color(mgl::Color(20, 20, 20, 255)); + rect.set_color(mgl::Color(0, 0, 0, 255)); window.draw(rect); } @@ -75,7 +76,7 @@ namespace gsr { // Background mgl::Rectangle rect(size); rect.set_position(position); - rect.set_color(mgl::Color(20, 20, 20, 225)); + rect.set_color(mgl::Color(0, 0, 0, 250)); window.draw(rect); } } |