pub struct CompareView<K> { /* private fields */ }Expand description
The comparison view.
Implementations§
Source§impl<K: Key> CompareView<K>
impl<K: Key> CompareView<K>
pub fn new(id: impl Into<String>) -> Self
Sourcepub fn active(self, key: Option<K>) -> Self
pub fn active(self, key: Option<K>) -> Self
The active image, outlined; the arrow keys move from it, Delete
takes it out (CompareView::removable).
Sourcepub fn max_panes(self, n: usize) -> Self
pub fn max_panes(self, n: usize) -> Self
How many panes it shows at most (MAX_PANES by default, at
most PANE_LIMIT); a drop that would go past it is refused.
Sourcepub fn removable(self, on: bool) -> Self
pub fn removable(self, on: bool) -> Self
Panes the user can take out (off by default): a close button on
each, Delete and Backspace on the active one, each an
Intent::Remove.
Sourcepub fn carry<T: Any + Send + Sync>(
self,
kind: &'static str,
pack: fn(Vec<K>) -> T,
unpack: fn(&T) -> Option<Vec<K>>,
) -> Self
pub fn carry<T: Any + Send + Sync>( self, kind: &'static str, pack: fn(Vec<K>) -> T, unpack: fn(&T) -> Option<Vec<K>>, ) -> Self
Images carried in and out by the application’s drag session
(egui_pop_api::bus::drag), across its windows too: a drag of a
T let go on the surface adds the images unpack finds in it
(Intent::Add, none: refused), a pane’s caption drags its image
out as pack makes it, under kind (photos), and a pane let go
over nothing goes out (Intent::Remove), let go on the surface
moves (Intent::Move).
pub fn show( self, ui: &mut Ui, state: &mut CompareState, panes: &[Pane<K>], source: &dyn ThumbSource<K>, ) -> CompareOutput<K>
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for CompareView<K>where
K: Freeze,
impl<K> !RefUnwindSafe for CompareView<K>
impl<K> !Send for CompareView<K>
impl<K> !Sync for CompareView<K>
impl<K> Unpin for CompareView<K>where
K: Unpin,
impl<K> UnsafeUnpin for CompareView<K>where
K: UnsafeUnpin,
impl<K> !UnwindSafe for CompareView<K>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more