m3e/swipe_gesture
SwipeGesture is a non-visual element used to detect a swipe gesture for an associated element.
This file was generated by m3e/generator
DO NOT EDIT
Types
Config is a public record for configuring this component.
pub type Config {
Config(
for: option.Option(String),
buttons: List(gesture_input_button.GestureInputButton),
pointer_types: List(pointer_type.PointerType),
disabled: Disabled,
priority: Float,
max_displacement: Float,
min_velocity: Float,
direction_threshold: Float,
directions: List(
swipe_gesture_direction.SwipeGestureDirection,
),
)
}
Constructors
-
Config( for: option.Option(String), buttons: List(gesture_input_button.GestureInputButton), pointer_types: List(pointer_type.PointerType), disabled: Disabled, priority: Float, max_displacement: Float, min_velocity: Float, direction_threshold: Float, directions: List(swipe_gesture_direction.SwipeGestureDirection), )
Disabled is whether gesture recognition is disabled.
pub type Disabled {
IsDisabled
IsNotDisabled
}
Constructors
-
IsDisabled -
IsNotDisabled
SwipeGesture is a View Model for this component
Fields:
- for: The identifier of the interactive control to which this element is attached.
- buttons: Which buttons can be pressed.
- pointer_types: Which types of pointers can be used to recognize gestures.
- disabled: Whether gesture recognition is disabled.
- priority: The priority in which to recognize gestures.
- max_displacement: * Maximum distance (px) a pointer can move before the gesture fails.
- min_velocity: Minimum velocity (px/ms) required before the gesture fails.
- direction_threshold: Minimum displacement (px) required before direction is considered valid.
- directions: The allowed directions of the swipe.
pub opaque type SwipeGesture
Values
pub fn buttons(
record: SwipeGesture,
buttons: List(gesture_input_button.GestureInputButton),
) -> SwipeGesture
buttons sets the value of buttons for this SwipeGesture.
pub const default_buttons: List(
gesture_input_button.GestureInputButton,
)
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_direction_threshold: Float
pub const default_directions: List(
swipe_gesture_direction.SwipeGestureDirection,
)
pub const default_disabled: Disabled
pub const default_for: option.Option(String)
pub const default_max_displacement: Float
pub const default_min_velocity: Float
pub const default_pointer_types: List(pointer_type.PointerType)
pub const default_priority: Float
pub fn direction_threshold(
record: SwipeGesture,
direction_threshold: Float,
) -> SwipeGesture
direction_threshold sets the value of direction_threshold for this SwipeGesture.
pub fn directions(
record: SwipeGesture,
directions: List(swipe_gesture_direction.SwipeGestureDirection),
) -> SwipeGesture
directions sets the value of directions for this SwipeGesture.
pub fn disabled(
record: SwipeGesture,
disabled: Disabled,
) -> SwipeGesture
disabled sets the value of disabled for this SwipeGesture.
pub fn for(
record: SwipeGesture,
for: option.Option(String),
) -> SwipeGesture
for sets the value of for for this SwipeGesture.
pub fn from_config(config: Config) -> SwipeGesture
from_config creates a new SwipeGesture from the given configuration.
pub fn max_displacement(
record: SwipeGesture,
max_displacement: Float,
) -> SwipeGesture
max_displacement sets the value of max_displacement for this SwipeGesture.
pub fn min_velocity(
record: SwipeGesture,
min_velocity: Float,
) -> SwipeGesture
min_velocity sets the value of min_velocity for this SwipeGesture.
pub fn pointer_types(
record: SwipeGesture,
pointer_types: List(pointer_type.PointerType),
) -> SwipeGesture
pointer_types sets the value of pointer_types for this SwipeGesture.
pub fn priority(
record: SwipeGesture,
priority: Float,
) -> SwipeGesture
priority sets the value of priority for this SwipeGesture.
pub fn render(
model: SwipeGesture,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a SwipeGesture
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a SwipeGesture Config