pub struct ZenMode { /* private fields */ }Expand description
Zen Mode wrapper for distraction-free content display
Wraps any View and provides a toggle between normal and fullscreen modes. In zen mode, the content fills the entire screen with configurable padding.
§Example
ⓘ
use revue::widget::{zen, text, Text};
let content = Text::new("Focus on this content...");
let mut zen_view = zen(content)
.padding(4)
.bg(Color::rgb(20, 20, 30));
// Toggle zen mode
zen_view.toggle();
// Check state
if zen_view.is_enabled() {
// Renders fullscreen
}Implementations§
Source§impl ZenMode
impl ZenMode
Sourcepub fn dim(self, opacity: f32) -> Self
pub fn dim(self, opacity: f32) -> Self
Set dim opacity for transition effect (0.0 = no dim, 1.0 = full dim)
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if zen mode is enabled
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Set enabled state
Sourcepub fn content_mut(&mut self) -> &mut dyn View
pub fn content_mut(&mut self) -> &mut dyn View
Get mutable reference to inner content
Trait Implementations§
Source§impl StyledView for ZenMode
impl StyledView for ZenMode
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Auto Trait Implementations§
impl Freeze for ZenMode
impl !RefUnwindSafe for ZenMode
impl !Send for ZenMode
impl !Sync for ZenMode
impl Unpin for ZenMode
impl !UnwindSafe for ZenMode
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