pub struct Popover {
pub anchor: Rect,
pub placement: Placement,
pub width: Option<u16>,
pub max_height: Option<u16>,
pub bordered: bool,
pub gap: u16,
pub auto_flip: bool,
}Expand description
Configuration for a popover widget.
Fields§
§anchor: RectThe anchor rectangle to position relative to.
placement: PlacementPreferred placement direction.
width: Option<u16>Desired width of the popover content area. If None, uses anchor width.
max_height: Option<u16>Maximum height of the popover. If None, fills available space.
bordered: boolWhether to draw a border around the popover.
gap: u16Gap between anchor and popover (in cells).
auto_flip: boolWhether to auto-flip when there isn’t enough space.
Implementations§
Source§impl Popover
impl Popover
Sourcepub fn new(anchor: Rect, placement: Placement) -> Self
pub fn new(anchor: Rect, placement: Placement) -> Self
Create a popover anchored to the given rectangle.
Sourcepub fn max_height(self, h: u16) -> Self
pub fn max_height(self, h: u16) -> Self
Set the maximum height.
Sourcepub fn with_border(self, bordered: bool) -> Self
pub fn with_border(self, bordered: bool) -> Self
Enable or disable the border.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Popover
impl RefUnwindSafe for Popover
impl Send for Popover
impl Sync for Popover
impl Unpin for Popover
impl UnsafeUnpin for Popover
impl UnwindSafe for Popover
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