pub struct Ghost { /* private fields */ }Expand description
A light surface that fills its area with the accent mixed into whatever lies under it: no lines, no text, nothing to click. It shows where something will be, for a window dragged as a ghost over a slow connection (the window stays put, only this moves, and it lands in one frame when the button comes up) and for the area a window would snap to.
Place it with View::place in the same stack as the windows,
after them, so it lies over what it covers. It takes no pointer: a press goes through to the
window beneath, and a drag that is already under way keeps the window it belongs to.
mix says how strong the tone is, around a quarter for a dragged ghost and a
fifth for a snap preview. In 256 and 16 colours the cells beneath cannot be blended, so the
ghost paints the accent mixed into the theme’s canvas and keeps the text on it readable.
Style keys: ghost (bg, the colour mixed into the ground; the accent when the theme is
silent).
Implementations§
Trait Implementations§
impl Copy for Ghost
impl StructuralPartialEq for Ghost
Source§impl<Msg: 'static> Widget<Msg> for Ghost
impl<Msg: 'static> Widget<Msg> for Ghost
Source§fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
available.Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
PaintCx::request_overlay. anchor is the area the widget was painted in.Source§fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Auto Trait Implementations§
impl Freeze for Ghost
impl RefUnwindSafe for Ghost
impl Send for Ghost
impl Sync for Ghost
impl Unpin for Ghost
impl UnsafeUnpin for Ghost
impl UnwindSafe for Ghost
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,
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