pub struct FloatingWindow {
pub id: u64,
pub title: String,
pub content: Rc<dyn Fn() -> View>,
pub on_close: Option<Rc<dyn Fn()>>,
pub position: Vec2,
pub size: Size,
pub min_size: Size,
pub max_size: Option<Size>,
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: Vec2Position in dp from the host’s top-left corner.
size: SizeSize in dp.
min_size: SizeMinimum size in dp.
max_size: Option<Size>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: f32, y: f32) -> Self
pub fn size(self, width: f32, height: f32) -> Self
pub fn min_size(self, width: f32, height: f32) -> Self
pub fn max_size(self, width: f32, height: f32) -> 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§
Source§impl Clone for FloatingWindow
impl Clone for FloatingWindow
Source§fn clone(&self) -> FloatingWindow
fn clone(&self) -> FloatingWindow
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FloatingWindow
impl !RefUnwindSafe for FloatingWindow
impl !Send for FloatingWindow
impl !Sync for FloatingWindow
impl Unpin for FloatingWindow
impl !UnwindSafe 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