diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-08 17:07:22 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-08 17:07:22 +0200 |
commit | b145d957e3809fd6c2d814c34c58234ade983bb0 (patch) | |
tree | 3e8842c72afe0045645ad32a0b3a9ab708c575ee /src/gui/Button.cpp | |
parent | 3d5e8baa5f66547f1250950b10bd4108e30af423 (diff) |
More
Diffstat (limited to 'src/gui/Button.cpp')
-rw-r--r-- | src/gui/Button.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index 0cf5bee..bccf7b0 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -48,8 +48,10 @@ namespace gsr { window.draw(text); const bool mouse_inside = mgl::FloatRect(draw_pos, item_size).contains(window.get_mouse_position().to_vec2f()) && !has_parent_with_selected_child_widget(); - if(mouse_inside) - draw_rectangle_outline(window, draw_pos, item_size, get_theme().tint_color, std::max(1.0f, border_scale * get_theme().window_height)); + if(mouse_inside) { + const mgl::Color outline_color = (bg_color == get_theme().tint_color) ? mgl::Color(255, 255, 255) : get_theme().tint_color; + draw_rectangle_outline(window, draw_pos, item_size, outline_color, std::max(1.0f, border_scale * get_theme().window_height)); + } } mgl::vec2f Button::get_size() { |