pub struct ReorderableListState { /* private fields */ }Expand description
The state for a list that allows the user to interactively reorder the list items.
An app that needs to start a new item drag or cancel an existing one can refer to the
ReorderableList’s state with a global key, and call
list_key.current_state::<ReorderableListState>(app).unwrap().cancel_reorder(app).
Implementations§
Source§impl ReorderableListState
impl ReorderableListState
Sourcepub fn start_item_drag_reorder(
self: Handle<Self>,
app: &mut App,
index: i32,
event: PointerDownEvent,
recognizer: MultiDragRecognizerRef,
)
pub fn start_item_drag_reorder( self: Handle<Self>, app: &mut App, index: i32, event: PointerDownEvent, recognizer: MultiDragRecognizerRef, )
Initiate the dragging of the item at index that was started with the pointer down
event.
The given recognizer will be used to recognize and start the drag item tracking and
lead to either an item reorder, or a canceled drag. The list will take ownership of the
returned recognizer and will dispose it when it is no longer needed.
Most applications will not use this directly, but will wrap the item (or part of the
item, like a drag handle) in either a ReorderableDragStartListener or
ReorderableDelayedDragStartListener which call this for the application.
Sourcepub fn cancel_reorder(self: Handle<Self>, app: &mut App)
pub fn cancel_reorder(self: Handle<Self>, app: &mut App)
Cancel any item drag in progress.
This should be called before any major changes to the item list occur so that any item drags will not get confused by changes to the underlying list.
If no drag is active, this will do nothing.
Trait Implementations§
Source§impl State for ReorderableListState
impl State for ReorderableListState
Source§type Widget = ReorderableList
type Widget = ReorderableList
State<T> type argument.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn build(self: Handle<Self>, app: &mut App, _context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, _context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &Self::Widget,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &Self::Widget, )
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.