Merge branch 'ios-support-wip' into feature/touch-support
This commit is contained in:
commit
09110a93b0
11 changed files with 186 additions and 41 deletions
|
|
@ -16,6 +16,7 @@ use crate::keyboard;
|
|||
use crate::layout;
|
||||
use crate::mouse::{self, click};
|
||||
use crate::text;
|
||||
use crate::touch::{self, Touch};
|
||||
use crate::{
|
||||
Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Size, Widget,
|
||||
};
|
||||
|
|
@ -247,7 +248,11 @@ where
|
|||
clipboard: Option<&dyn Clipboard>,
|
||||
) -> event::Status {
|
||||
match event {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
||||
| Event::Touch(Touch {
|
||||
phase: touch::Phase::Started,
|
||||
..
|
||||
}) => {
|
||||
let is_clicked = layout.bounds().contains(cursor_position);
|
||||
|
||||
self.state.is_focused = is_clicked;
|
||||
|
|
@ -321,10 +326,10 @@ where
|
|||
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) => {
|
||||
self.state.is_dragging = false;
|
||||
}
|
||||
Event::Mouse(mouse::Event::CursorMoved { x, .. }) => {
|
||||
Event::Mouse(mouse::Event::CursorMoved { position }) => {
|
||||
if self.state.is_dragging {
|
||||
let text_layout = layout.children().next().unwrap();
|
||||
let target = x - text_layout.bounds().x;
|
||||
let target = position.x - text_layout.bounds().x;
|
||||
|
||||
if target > 0.0 {
|
||||
let value = if self.is_secure {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue