mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 17:27:05 +09:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user