Skip to main content

RowMoves

Struct RowMoves 

Source
pub struct RowMoves {
    pub onto_rows: bool,
    pub between_rows: bool,
}
Expand description

Where rows dragged within a list can be dropped (List::on_move): onto a row (into a group, say), between rows (to reorder them), or both. A drop on the list’s empty part is at its end, either way.

Fields§

§onto_rows: bool§between_rows: bool

Implementations§

Source§

impl RowMoves

Source

pub fn onto_rows() -> RowMoves

Source

pub fn between_rows() -> RowMoves

Source

pub fn and_between_rows(self) -> RowMoves

Source

pub fn and_onto_rows(self) -> RowMoves

Source

pub fn target( &self, dragged: &[RowKey], proposed: RowDrop<RowKey>, ) -> Option<RowDrop<RowKey>>

Where a drop the platform proposes lands, by what the list takes: onto a row where only between rows is taken is before it, and between rows where only onto them is taken is onto the row there. Rows aren’t dropped onto one of themselves: None. Every backend asks this while a drag is over its list, and shows what it answers.

Source

pub fn tree_target( &self, dragged: &[RowKey], over: Option<RowKey>, proposed: RowDrop<RowKey>, row: impl Fn(RowKey) -> Option<TreeRow>, ) -> Option<RowDrop<RowKey>>

target in a Tree, whose rows nest (row gives a row’s place, as TreeRows says): onto a row is into it, so only a row that opens takes rows onto it, and before one is at its place among its parent’s rows. Nothing lands while the pointer is over a dragged row (over, the row under it), or anywhere inside one: the rows would stay where they are, or a folder would go inside itself.

Source

pub fn tree_proposal( key: RowKey, x: Option<f32>, y: f32, height: f32, indent: TreeIndent, next: Option<RowKey>, row: impl Fn(RowKey) -> Option<TreeRow>, ) -> RowDrop<RowKey>

What the pointer, x across the tree (from its rows’ left edge, if known) and y of height down the row key, proposes in a Tree (row gives a row’s place, as TreeRows says). Over a row that opens, its top quarter is before it, its bottom quarter after it, and the middle onto it; over a row that doesn’t, its top half is before it and its bottom half after it.

After an open folder is before its first row. After another row, the levels from the row’s own down to the next row’s (next) are all places: at the next row’s level, before it; at a deeper one, the end of the folder at that level (onto it, where a folder’s last rows put rows). x picks the level, as outlines pick it: the level whose content starts nearest it, by indent; without it, the row’s own. Past the last top row, at the top level, the end. Backends that propose by the pointer ask this, so every tree proposes alike, and show an end-of-folder drop as a line under the row, at the level.

Trait Implementations§

Source§

impl Clone for RowMoves

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RowMoves

Source§

impl Debug for RowMoves

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RowMoves

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RowMoves

Source§

impl PartialEq for RowMoves

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RowMoves

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.