pub struct ScreenOptionsDialog { /* private fields */ }Expand description
Screen-options dialog.
Holds a snapshot of the initial ModalStyle and a mutable
pending copy that tracks the user’s radio selection. Emits
DialogAction::ApplyModalStyleLive on F2 / Enter on
[Apply live], DialogAction::ApplyModalStyleAndSave on F10
/ Enter on [Apply + Save], and DialogOutcome::Close on
Esc / Enter on [Cancel]. Pressing Enter on a radio row
sets pending to that option without moving the cursor.
Implementations§
Source§impl ScreenOptionsDialog
impl ScreenOptionsDialog
Sourcepub const fn new(initial: ModalStyle) -> Self
pub const fn new(initial: ModalStyle) -> Self
Construct a dialog seeded with the given initial ModalStyle.
The cursor starts on the first radio option.
Sourcepub const fn cursor(&self) -> usize
pub const fn cursor(&self) -> usize
Current cursor position. Valid range is 0..6: 0..=2 select
a radio option, 3..=5 select an action button.
Sourcepub const fn pending(&self) -> ModalStyle
pub const fn pending(&self) -> ModalStyle
The currently pending ModalStyle — what will be emitted by
the next Apply live / Apply + Save action.
Trait Implementations§
Source§impl Dialog for ScreenOptionsDialog
impl Dialog for ScreenOptionsDialog
Source§fn preferred_size(&self, outer: Rect) -> Rect
fn preferred_size(&self, outer: Rect) -> Rect
Preferred size of the dialog when rendered inside
outer. Read moreSource§fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
Handle a key event and report back how the stack should react.
Auto Trait Implementations§
impl Freeze for ScreenOptionsDialog
impl RefUnwindSafe for ScreenOptionsDialog
impl Send for ScreenOptionsDialog
impl Sync for ScreenOptionsDialog
impl Unpin for ScreenOptionsDialog
impl UnsafeUnpin for ScreenOptionsDialog
impl UnwindSafe for ScreenOptionsDialog
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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