ltk/input/pointer/
helpers.rsuse crate::app::App;
use crate::event_loop::{ AppData, SurfaceFocus };
use crate::tree::find_handlers;
use crate::platform::Platform;
use super::super::gesture::SwipeConfig;
impl<A: App, P: Platform> AppData<A, P>
{
pub( crate ) fn swipe_config( &self, focus: SurfaceFocus ) -> SwipeConfig
{
let ss = self.surface( focus );
SwipeConfig
{
up_thresh: self.app.swipe_threshold(),
down_thresh: self.app.swipe_down_threshold(),
down_edge: self.app.swipe_down_edge(),
horizontal_thresh: self.app.swipe_horizontal_threshold(),
overscroll_thresh: self.app.overscroll_dismiss_threshold(),
surface_width: ss.physical_width(),
surface_height: ss.physical_height(),
scale: ss.scale_factor,
}
}
}
pub( crate ) fn hover_affects_paint<Msg: Clone>(
widget_rects: &[crate::widget::LaidOutWidget<Msg>],
idx: Option<usize>,
) -> bool
{
idx.and_then( |i| find_handlers( widget_rects, i ) )
.map( |h| !h.is_drag_target() )
.unwrap_or( false )
}