Compare commits

..

No commits in common. "e891f34b3224b25fc4bdf286b3f9dba26c8abe5b" and "c34af044311c986e5f8458cf61bab2508aca48fa" have entirely different histories.

3 changed files with 5 additions and 71 deletions

View file

@ -9,8 +9,6 @@ pub use iced_renderer::graphics;
pub use core::widget::Id;
pub(crate) const DRAG_DEADBAND_DISTANCE: f32 = 10.0;
mod action;
mod mouse_area;
mod pin;

View file

@ -92,8 +92,7 @@ use crate::core::{
};
use log::trace;
use crate::DRAG_DEADBAND_DISTANCE;
const DRAG_DEADBAND_DISTANCE: f32 = 10.0;
const THICKNESS_RATIO: f32 = 25.0;
/// A collection of panes distributed using either vertical or horizontal splits

View file

@ -960,16 +960,6 @@ where
y: y + translation.y as f64,
},
)),
Event::Touch(touch::Event::FingerLifted {
id,
position,
}) if matches!(
state.interaction,
Interaction::TouchScrolling(_)
) =>
{
Event::Touch(touch::Event::FingerLost { id, position })
}
e => e,
};
self.content.as_widget_mut().update(
@ -997,14 +987,6 @@ where
}
};
if matches!(
event,
Event::Mouse(mouse::Event::CursorMoved { .. })
| Event::Touch(touch::Event::FingerPressed { .. })
) {
state.suppress_touch_hover = false;
}
if matches!(
event,
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left))
@ -1013,18 +995,10 @@ where
| touch::Event::FingerLost { .. }
)
) {
if matches!(state.interaction, Interaction::TouchScrolling(_)) {
state.suppress_touch_hover = true;
}
state.interaction = Interaction::None;
state.touch_press_start = None;
return;
}
if let Event::Touch(touch::Event::FingerPressed { .. }) = event {
state.touch_press_start = cursor_over_scrollable;
}
if shell.is_event_captured() {
return;
}
@ -1118,31 +1092,14 @@ where
Interaction::TouchScrolling(position);
}
touch::Event::FingerMoved { .. } => {
let Some(cursor_position) = cursor.position()
let Interaction::TouchScrolling(
scroll_box_touched_at,
) = state.interaction
else {
return;
};
if !matches!(
state.interaction,
Interaction::TouchScrolling(_)
) {
let Some(start) = state.touch_press_start
else {
return;
};
if start.distance(cursor_position)
< crate::DRAG_DEADBAND_DISTANCE
{
return;
}
state.interaction =
Interaction::TouchScrolling(start);
}
let Interaction::TouchScrolling(
scroll_box_touched_at,
) = state.interaction
let Some(cursor_position) = cursor.position()
else {
return;
};
@ -1364,14 +1321,6 @@ where
state.translation(self.direction, bounds, content_bounds);
let cursor = match cursor_over_scrollable {
_ if state.suppress_touch_hover
|| matches!(
state.interaction,
Interaction::TouchScrolling(_)
) =>
{
mouse::Cursor::Unavailable
}
Some(cursor_position)
if !(mouse_over_x_scrollbar || mouse_over_y_scrollbar) =>
{
@ -1547,14 +1496,6 @@ where
state.translation(self.direction, bounds, content_bounds);
let cursor = match cursor_over_scrollable {
_ if state.suppress_touch_hover
|| matches!(
state.interaction,
Interaction::TouchScrolling(_)
) =>
{
cursor.levitate() + translation
}
Some(cursor_position)
if !(mouse_over_x_scrollbar || mouse_over_y_scrollbar) =>
{
@ -2080,8 +2021,6 @@ struct State {
last_notified: Option<Viewport>,
last_scrolled: Option<Instant>,
is_scrollbar_visible: bool,
touch_press_start: Option<Point>,
suppress_touch_hover: bool,
}
#[derive(Debug, Clone, Copy)]
@ -2107,8 +2046,6 @@ impl Default for State {
last_notified: None,
last_scrolled: None,
is_scrollbar_visible: true,
touch_press_start: None,
suppress_touch_hover: false,
}
}
}