pub struct SettingsForm { /* private fields */ }Expand description
A vertical form of numeric fields with arrow-key navigation.
Arrow up/down navigates between fields. All other keys delegate to the currently selected field. When a field is in edit mode, up/down are blocked until the user confirms (Enter) or cancels (Escape) the edit.
Implementations§
Source§impl SettingsForm
impl SettingsForm
pub fn new(fields: Vec<NumericField>) -> Self
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Whether the currently selected field is in edit (text entry) mode.
Sourcepub fn handle_key(&mut self, key: &KeyPress) -> WidgetResult<()>
pub fn handle_key(&mut self, key: &KeyPress) -> WidgetResult<()>
Handle a key press.
Returns Confirmed(()) when Enter is pressed in browse mode (all fields committed).
Returns Cancelled when Escape is pressed in browse mode.
Returns Pending for all navigation and edit operations.
Auto Trait Implementations§
impl Freeze for SettingsForm
impl RefUnwindSafe for SettingsForm
impl Send for SettingsForm
impl Sync for SettingsForm
impl Unpin for SettingsForm
impl UnsafeUnpin for SettingsForm
impl UnwindSafe for SettingsForm
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