fix(toggler): add touch input support
This commit is contained in:
parent
141261b9bf
commit
d7fd880ac6
1 changed files with 3 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ use iced_core::{
|
|||
Clipboard, Event, Layout, Length, Pixels, Rectangle, Shell, Size, Widget, alignment, event,
|
||||
layout, mouse,
|
||||
renderer::{self, Renderer},
|
||||
text,
|
||||
text, touch,
|
||||
widget::{self, Tree, tree},
|
||||
window,
|
||||
};
|
||||
|
|
@ -239,7 +239,8 @@ impl<'a, Message> Widget<Message, crate::Theme, crate::Renderer> for Toggler<'a,
|
|||
};
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
match event {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
||||
| Event::Touch(touch::Event::FingerPressed { .. }) => {
|
||||
let mouse_over = cursor_position.is_over(layout.bounds());
|
||||
|
||||
if mouse_over {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue