Turn Touch into a touch::Event enum

This commit is contained in:
Héctor Ramón Jiménez 2020-12-15 06:38:46 +01:00
parent 09110a93b0
commit 3bdf931925
9 changed files with 89 additions and 118 deletions

View file

@ -6,7 +6,7 @@ use crate::layout;
use crate::mouse;
use crate::row;
use crate::text;
use crate::touch::{self, Touch};
use crate::touch;
use crate::{
Align, Clipboard, Element, Hasher, HorizontalAlignment, Layout, Length,
Point, Rectangle, Row, Text, VerticalAlignment, Widget,
@ -156,10 +156,7 @@ where
) -> event::Status {
match event {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(Touch {
phase: touch::Phase::Started,
..
}) => {
| Event::Touch(touch::Event::FingerPressed { .. }) => {
let mouse_over = layout.bounds().contains(cursor_position);
if mouse_over {