Split Input mouse event by ButtonState

This commit is contained in:
Héctor Ramón Jiménez 2020-04-30 04:53:15 +02:00
parent e139aae143
commit e55cd9652e
11 changed files with 180 additions and 203 deletions

View file

@ -2,8 +2,7 @@
use std::hash::Hash;
use crate::{
input::{mouse, ButtonState},
layout, row, text, Align, Clipboard, Element, Event, Hasher,
input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget,
};
@ -152,10 +151,7 @@ where
_clipboard: Option<&dyn Clipboard>,
) {
match event {
Event::Mouse(mouse::Event::Input {
button: mouse::Button::Left,
state: ButtonState::Pressed,
}) => {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
let mouse_over = layout.bounds().contains(cursor_position);
if mouse_over {