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.
Sourcepub fn edges(self, edges: impl IntoProp<Anchors>) -> PopupWindow
pub fn edges(self, edges: impl IntoProp<Anchors>) -> PopupWindow
Sets the edge or corner of the widget the popup hangs from, such as
Edge::Bottom | Edge::Left; opposite edges cancel. Read when it
opens, as the compositor places a popup once.
Sourcepub fn gravity(self, gravity: impl IntoProp<Anchors>) -> PopupWindow
pub fn gravity(self, gravity: impl IntoProp<Anchors>) -> PopupWindow
Sets which way the popup extends from its edges, such as
Edge::Bottom | Edge::Right. Read when it opens.
Sourcepub fn adjustment(self, adjustment: impl IntoProp<Adjust>) -> PopupWindow
pub fn adjustment(self, adjustment: impl IntoProp<Adjust>) -> PopupWindow
Sets how the popup may move to stay on its output. Read when it opens.
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