/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/// A window. #[derive(Debug, Default)] pubstruct Window { pub title: String, /// The window content is the first element. pub content: Option<Box<Element>>, /// Logical child windows. pub children: Vec<TypedElement<Self>>, pub modal: bool, pub close: Option<Event<()>>,
}
impl ElementBuilder<Window> { /// Set the window title. pubfn title(&mutself, s: impl Into<String>) { self.element_type.title = s.into();
}
/// Set whether the window is modal (blocking interaction with other windows when displayed). pubfn modal(&mutself, value: bool) { self.element_type.modal = value;
}
/// Register an event to close the window. pubfn close_when(&mutself, event: &Event<()>) { self.element_type.close = Some(event.clone());
}
/// Add a window as a logical child of this one. /// /// Logical children are always displayed above their parents. pubfn child_window(&mutself, window: TypedElement<Window>) { self.element_type.children.push(window);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.