pub enum Backdrop {
Opaque,
Transparent,
Blur,
Tinted,
}Expand description
What shows through a window where its frame paints nothing, or paints with alpha (backlog F126): named for the effect, not for where an app uses it. The app decides which regions show it — a sidebar, a toolbar — by painting them with alpha and the rest opaque; kui knows nothing of sidebars.
Asked for by the app (kui_native::Launcher::backdrop) and reported
back, as what the driver actually got, in WindowEnv::backdrop — a
platform that cannot give the effect reads what it gave instead, down
to Opaque, and a view that paints translucent regions paints them
opaque there.
use kui_core::Backdrop;
assert_eq!(Backdrop::default(), Backdrop::Opaque);
assert_eq!(Backdrop::from_name("blur"), Some(Backdrop::Blur));
assert!(Backdrop::Tinted.is_translucent() && !Backdrop::Opaque.is_translucent());Variants§
Opaque
The window is opaque: what every window is unless an app asks.
Transparent
See-through where the frame is: the desktop and the windows under
this one show as they are, unblurred. A compositor that blurs
translucent windows itself (Hyprland, SwayFX, picom when configured)
makes this look like Blur.
Blur
A live blur of whatever is behind the window, other windows
included: macOS’s behind-window vibrancy (an NSVisualEffectView),
Windows 11’s Acrylic, and on Linux the compositor’s blur where it
offers one (KWin’s org_kde_kwin_blur or
_KDE_NET_WM_BLUR_BEHIND_REGION, ext-background-effect-v1).
Tinted
The desktop’s colour, cheap and steady rather than live: Windows 11’s Mica, macOS’s window-background material (the wallpaper tinting AppKit gives a window), and elsewhere the wallpaper itself, read, scaled down and blurred once, drawn as the window’s ground.
Implementations§
Source§impl Backdrop
impl Backdrop
Sourcepub const ALL: [Backdrop; 4]
pub const ALL: [Backdrop; 4]
Every backdrop, in wire order: the index C’s KUI_BACKDROP_*
spells. Append-only.
Sourcepub fn from_name(name: &str) -> Option<Backdrop>
pub fn from_name(name: &str) -> Option<Backdrop>
The backdrop a wire name spells: the inverse of Self::name.
Sourcepub fn is_translucent(self) -> bool
pub fn is_translucent(self) -> bool
Whether anything shows through: everything but Opaque.
Trait Implementations§
impl Copy for Backdrop
impl Eq for Backdrop
impl StructuralPartialEq for Backdrop
Auto Trait Implementations§
impl Freeze for Backdrop
impl RefUnwindSafe for Backdrop
impl Send for Backdrop
impl Sync for Backdrop
impl Unpin for Backdrop
impl UnsafeUnpin for Backdrop
impl UnwindSafe for Backdrop
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.