Turn Touch into a struct and add finger id
This commit is contained in:
parent
e19a07d400
commit
d3572e1b81
13 changed files with 151 additions and 112 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! Create choices using radio buttons.
|
||||
use crate::{
|
||||
input::{mouse, touch, ButtonState},
|
||||
input::{mouse, touch, ButtonState, Touch},
|
||||
layout, row, text, Align, Clipboard, Element, Event, Font, Hasher,
|
||||
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
|
||||
VerticalAlignment, Widget,
|
||||
|
|
@ -122,7 +122,10 @@ where
|
|||
button: mouse::Button::Left,
|
||||
state: ButtonState::Pressed,
|
||||
})
|
||||
| Event::Touch(touch::Touch::Started { .. }) => {
|
||||
| Event::Touch(Touch {
|
||||
phase: touch::Phase::Started,
|
||||
..
|
||||
}) => {
|
||||
if layout.bounds().contains(cursor_position) {
|
||||
messages.push(self.on_click.clone());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue