pub struct FloatingWindow {
pub id: u64,
pub title: String,
pub content: Rc<dyn Fn() -> View>,
pub on_close: Option<Rc<dyn Fn()>>,
pub position: DpOffset,
pub size: DpSize,
pub min_size: DpSize,
pub max_size: Option<DpSize>,
pub resizable: bool,
pub closable: bool,
pub draggable: bool,
pub actions: Vec<WindowAction>,
}Fields§
§id: u64§title: String§content: Rc<dyn Fn() -> View>§on_close: Option<Rc<dyn Fn()>>§position: DpOffsetPosition in Dp from the host’s top-left corner.
size: DpSizeSize in Dp.
min_size: DpSizeMinimum size in Dp.
max_size: Option<DpSize>Maximum size in Dp (optional).
resizable: bool§closable: bool§draggable: bool§actions: Vec<WindowAction>Implementations§
Source§impl FloatingWindow
impl FloatingWindow
pub fn new( id: u64, title: impl Into<String>, content: Rc<dyn Fn() -> View>, ) -> Self
pub fn position(self, x: Dp, y: Dp) -> Self
pub fn size(self, width: Dp, height: Dp) -> Self
pub fn min_size(self, width: Dp, height: Dp) -> Self
pub fn max_size(self, width: Dp, height: Dp) -> Self
pub fn resizable(self, resizable: bool) -> Self
pub fn closable(self, closable: bool) -> Self
pub fn draggable(self, draggable: bool) -> Self
pub fn actions(self, actions: Vec<WindowAction>) -> Self
pub fn on_close(self, on_close: Rc<dyn Fn()>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FloatingWindow
impl !Send for FloatingWindow
impl !Sync for FloatingWindow
impl !UnwindSafe for FloatingWindow
impl Freeze for FloatingWindow
impl Unpin for FloatingWindow
impl UnsafeUnpin for FloatingWindow
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