pub struct PopupWindow { /* private fields */ }Expand description
A popup: a window next to the widget that opened it, sized to fit its
one child. Open one with Cx::open_popup.
use crabshell_ui::{Button, PopupWindow, Text};
let button = Button::new(Text::new("open")).on_click(|cx| {
cx.open_popup(|_cx| PopupWindow::new().child(Text::new("hello")))
});Implementations§
Source§impl PopupWindow
impl PopupWindow
Sourcepub fn new() -> PopupWindow
pub fn new() -> PopupWindow
An empty popup.
Sourcepub fn style(self, style: impl IntoProp<Style>) -> PopupWindow
pub fn style(self, style: impl IntoProp<Style>) -> PopupWindow
Sets the popup’s style. Its color and font are inherited by every
Text in it that doesn’t set its own.
Sourcepub fn child(self, child: impl Widget) -> PopupWindow
pub fn child(self, child: impl Widget) -> PopupWindow
Sets the popup’s one child. The popup is as large as the child wants to be, plus the style’s padding.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PopupWindow
impl !Send for PopupWindow
impl !Sync for PopupWindow
impl !UnwindSafe for PopupWindow
impl Forget for PopupWindow
impl Freeze for PopupWindow
impl Move for PopupWindow
impl Unpin for PopupWindow
impl UnsafeUnpin for PopupWindow
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