From 9f1fddc47ce10fbc65cdeaa70461063b9921434e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 6 Aug 2024 05:57:21 +0200 Subject: Copy Config from gpu-screen-recorder-gtk, make it more modern and efficient with string_view and variant, use string_view in gsr info parsing --- src/gui/Button.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index e8137c9..9662c34 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -18,10 +18,8 @@ namespace gsr { bool Button::on_event(mgl::Event &event, mgl::Window&, mgl::vec2f offset) { const mgl::vec2f item_size = get_size().floor(); - if(event.type == mgl::Event::MouseMoved) { - mouse_inside = mgl::FloatRect(position + offset, item_size).contains({ (float)event.mouse_move.x, (float)event.mouse_move.y }); - } else if(event.type == mgl::Event::MouseButtonPressed && event.mouse_button.button == mgl::Mouse::Left) { - const bool clicked_inside = mgl::FloatRect(position + offset, item_size).contains({ (float)event.mouse_button.x, (float)event.mouse_button.y });; + if(event.type == mgl::Event::MouseButtonPressed && event.mouse_button.button == mgl::Mouse::Left) { + const bool clicked_inside = mgl::FloatRect(position + offset, item_size).contains({ (float)event.mouse_button.x, (float)event.mouse_button.y }); if(clicked_inside && on_click) on_click(); } -- cgit v1.2.3