Struct BottomSheet
pub struct BottomSheet { /* private fields */ }Expand description
A sheet up from a narrow window’s foot. See the module docs.
Implementations§
§impl BottomSheet
impl BottomSheet
pub fn new() -> BottomSheet
pub fn new() -> BottomSheet
A sheet that opens at half the window.
pub fn detent(&self) -> SheetDetent
pub fn detent(&self) -> SheetDetent
The detent it rests at, or is going to.
pub fn set_detent(
&mut self,
detent: SheetDetent,
source: MotionSource,
motion: EffectiveMotion,
)
pub fn set_detent( &mut self, detent: SheetDetent, source: MotionSource, motion: EffectiveMotion, )
Send the sheet to detent on the snap motion, as source asked.
pub fn snap_to(&mut self, detent: SheetDetent)
pub fn snap_to(&mut self, detent: SheetDetent)
Rest at detent at once (a capture, a test).
pub fn step(
&mut self,
up: bool,
source: MotionSource,
motion: EffectiveMotion,
) -> bool
pub fn step( &mut self, up: bool, source: MotionSource, motion: EffectiveMotion, ) -> bool
Step a detent up or down; whether there was one to step to.
pub fn lower(&mut self, motion: EffectiveMotion) -> bool
pub fn lower(&mut self, motion: EffectiveMotion) -> bool
Back’s step on the sheet: from the whole window it comes down to half, the content above it in view again; from half or peeking there is nothing lower to rest at, and the holder puts it away. Returns whether it came down.
pub fn advance(&mut self, now: Instant) -> bool
pub fn advance(&mut self, now: Instant) -> bool
Advance the settle to now. Returns whether it is still moving.
pub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Whether a drag holds the grip.
pub fn geometry(
&self,
frame: SheetFrame,
reveal: f64,
open: bool,
) -> SheetGeometry
pub fn geometry( &self, frame: SheetFrame, reveal: f64, open: bool, ) -> SheetGeometry
Where the sheet stands in frame with its open/close slide at
reveal (0..=1); open is whether it is open or opening.
pub fn place(
&mut self,
frame: SheetFrame,
reveal: f64,
open: bool,
) -> SheetGeometry
pub fn place( &mut self, frame: SheetFrame, reveal: f64, open: bool, ) -> SheetGeometry
Stand in frame this frame (see Self::geometry); events and
painting use where it was placed last.
pub fn placed(&self) -> SheetGeometry
pub fn placed(&self) -> SheetGeometry
Where it was placed last.
pub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Whether the grip holds the keyboard.
pub fn set_focused(&mut self, focused: bool)
pub fn contains(&self, point: Point) -> bool
pub fn contains(&self, point: Point) -> bool
Whether point is on the sheet: what lands there is the sheet’s,
never the content’s under it.
pub fn claims_touch(&self, point: Point) -> bool
pub fn claims_touch(&self, point: Point) -> bool
Whether a finger landing at point takes the grip (it drags the
sheet; it never scrolls).
pub fn cursor_shape(&self, point: Point) -> Option<CursorIcon>
pub fn cursor_shape(&self, point: Point) -> Option<CursorIcon>
The cursor over the grip.
pub fn handle_event(
&mut self,
event: &WindowEvent,
ctx: &EventCtx<'_>,
motion: EffectiveMotion,
) -> SheetInput
pub fn handle_event( &mut self, event: &WindowEvent, ctx: &EventCtx<'_>, motion: EffectiveMotion, ) -> SheetInput
The sheet’s own events: a drag on its grip, a press on it, the arrow keys while it holds the keyboard. Place it first.
pub fn accessibility(&self, name: &str, target: &str) -> AccessNode
pub fn accessibility(&self, name: &str, target: &str) -> AccessNode
The sheet as a region named name, its grip a slider whose value is
the detent, routed back by target
(Self::perform_action).
pub fn perform_action(
&mut self,
action: &Action,
motion: EffectiveMotion,
) -> bool
pub fn perform_action( &mut self, action: &Action, motion: EffectiveMotion, ) -> bool
Carry out action on the grip: focus it, step it, or set it to a
detent by its label. Returns whether it did.
pub fn paint(
&self,
scene: &mut Scene,
transform: Affine,
theme: &Theme,
) -> Theme
pub fn paint( &self, scene: &mut Scene, transform: Affine, theme: &Theme, ) -> Theme
Paint the sheet where it was placed: the floating level with its
two-layer shadow and inner hairline, as every floating surface
stands off what is under it (crate::surface::floating_shadow,
crate::surface::panel), with the panel radius along its top edge,
standing on the window’s foot, and its grip. Returns the theme to
draw what it holds with.
Trait Implementations§
§impl Clone for BottomSheet
impl Clone for BottomSheet
§fn clone(&self) -> BottomSheet
fn clone(&self) -> BottomSheet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for BottomSheet
impl Debug for BottomSheet
§impl Default for BottomSheet
impl Default for BottomSheet
§fn default() -> BottomSheet
fn default() -> BottomSheet
Auto Trait Implementations§
impl Freeze for BottomSheet
impl RefUnwindSafe for BottomSheet
impl Send for BottomSheet
impl Sync for BottomSheet
impl Unpin for BottomSheet
impl UnsafeUnpin for BottomSheet
impl UnwindSafe for BottomSheet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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