aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-06 05:57:21 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-06 05:57:21 +0200
commit9f1fddc47ce10fbc65cdeaa70461063b9921434e (patch)
treee9a8f19fa2ea5445e62ac2f4f8a488c591805347 /src/gui
parentb778fd7cc654f28a2bfe0ff74537f120241b289c (diff)
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/Button.cpp6
1 files changed, 2 insertions, 4 deletions
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();
}