pub struct PopupDialog<'a, T, F>{ /* private fields */ }Expand description
Generic popup dialog container.
Manages rendering, focus, and event handling for a popup dialog.
Implementations§
Source§impl<'a, T, F> PopupDialog<'a, T, F>
impl<'a, T, F> PopupDialog<'a, T, F>
Sourcepub fn new(
config: &'a DialogConfig,
state: &'a mut DialogState<T>,
content_renderer: F,
) -> Self
pub fn new( config: &'a DialogConfig, state: &'a mut DialogState<T>, content_renderer: F, ) -> Self
Create a new popup dialog.
§Arguments
config- Dialog configurationstate- Dialog statecontent_renderer- Closure to render dialog content
Sourcepub fn calculate_area(&self, screen: Rect) -> Rect
pub fn calculate_area(&self, screen: Rect) -> Rect
Calculate dialog area centered on screen.
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> EventResult
pub fn handle_key(&mut self, key: KeyEvent) -> EventResult
Handle keyboard event.
Sourcepub fn handle_mouse(&mut self, mouse: MouseEvent) -> EventResult
pub fn handle_mouse(&mut self, mouse: MouseEvent) -> EventResult
Handle mouse event.
Sourcepub fn handle_mouse_with_screen(
&mut self,
mouse: MouseEvent,
screen: Rect,
) -> EventResult
pub fn handle_mouse_with_screen( &mut self, mouse: MouseEvent, screen: Rect, ) -> EventResult
Handle mouse event with screen dimensions.
Auto Trait Implementations§
impl<'a, T, F> Freeze for PopupDialog<'a, T, F>where
F: Freeze,
impl<'a, T, F> RefUnwindSafe for PopupDialog<'a, T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, F> Send for PopupDialog<'a, T, F>
impl<'a, T, F> Sync for PopupDialog<'a, T, F>
impl<'a, T, F> Unpin for PopupDialog<'a, T, F>where
F: Unpin,
impl<'a, T, F> !UnwindSafe for PopupDialog<'a, T, F>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more