pub struct ThemePickerState {
pub active: bool,
pub selected_index: usize,
/* private fields */
}Expand description
State for the theme picker
Fields§
§active: boolWhether the picker is currently visible
selected_index: usizeIndex of the currently selected theme
Implementations§
Source§impl ThemePickerState
impl ThemePickerState
Sourcepub fn activate(&mut self, current_theme_name: &str, current_theme: Theme)
pub fn activate(&mut self, current_theme_name: &str, current_theme: Theme)
Activate the picker and save current theme for potential restore
Sourcepub fn select_previous(&mut self)
pub fn select_previous(&mut self)
Move selection up
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection down
Sourcepub fn selected_theme_name(&self) -> Option<&'static str>
pub fn selected_theme_name(&self) -> Option<&'static str>
Get the currently selected theme name
Source§impl ThemePickerState
impl ThemePickerState
Sourcepub fn process_key(&mut self, key: KeyEvent) -> ThemeKeyAction
pub fn process_key(&mut self, key: KeyEvent) -> ThemeKeyAction
Handle a key event
Trait Implementations§
Source§impl Default for ThemePickerState
impl Default for ThemePickerState
Source§impl Widget for ThemePickerState
impl Widget for ThemePickerState
Source§fn handle_key(
&mut self,
key: KeyEvent,
ctx: &WidgetKeyContext<'_>,
) -> WidgetKeyResult
fn handle_key( &mut self, key: KeyEvent, ctx: &WidgetKeyContext<'_>, ) -> WidgetKeyResult
Handle key event, return result indicating what action to take. Read more
Source§fn required_height(&self, _available: u16) -> u16
fn required_height(&self, _available: u16) -> u16
Calculate required height for this widget Read more
Source§fn blocks_input(&self) -> bool
fn blocks_input(&self) -> bool
Whether this widget blocks input to the text input when active
Source§fn is_overlay(&self) -> bool
fn is_overlay(&self) -> bool
Whether this widget is a full-screen overlay Read more
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Cast to Any for mutable downcasting
Auto Trait Implementations§
impl Freeze for ThemePickerState
impl RefUnwindSafe for ThemePickerState
impl Send for ThemePickerState
impl Sync for ThemePickerState
impl Unpin for ThemePickerState
impl UnwindSafe for ThemePickerState
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