pub struct SessionLock { /* private fields */ }Expand description
A lock screen: while locked is true, the compositor shows only its
surfaces, one covering each output, and nothing else gets input. Lock
with cx.session_lock from the crabshell crate. Every property
takes a value or a closure.
use crabshell_ui::{Color, SessionLock, Style, Text};
let lock = SessionLock::new()
.locked(true)
.style(Style::new().background(Color::rgb(0, 0, 0)))
.surface(|_cx, output| Text::new(format!("locked on {}", output.name())));Implementations§
Source§impl SessionLock
impl SessionLock
Sourcepub fn new() -> SessionLock
pub fn new() -> SessionLock
A lock that never locks, with nothing on its surfaces.
Sourcepub fn locked(self, locked: impl IntoProp<bool>) -> SessionLock
pub fn locked(self, locked: impl IntoProp<bool>) -> SessionLock
Sets whether the session is locked. Turning it false unlocks, as after the user’s password was checked.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SessionLock
impl !Send for SessionLock
impl !Sync for SessionLock
impl !UnwindSafe for SessionLock
impl Forget for SessionLock
impl Freeze for SessionLock
impl Move for SessionLock
impl Unpin for SessionLock
impl UnsafeUnpin for SessionLock
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
Mutably borrows from an owned value. Read more