pub struct AdjustmentDialogState {
pub adjustment_amount: Money,
pub category_input: String,
pub selected_category: Option<CategoryId>,
pub categories: Vec<(CategoryId, String)>,
pub selected_index: usize,
pub selecting_category: bool,
}Expand description
State for the adjustment dialog
Fields§
§adjustment_amount: MoneyThe adjustment amount needed
category_input: StringCategory input for the adjustment
selected_category: Option<CategoryId>Selected category ID
categories: Vec<(CategoryId, String)>List of categories for selection
selected_index: usizeSelected category index
selecting_category: boolWhether in category selection mode
Implementations§
Source§impl AdjustmentDialogState
impl AdjustmentDialogState
pub fn new(adjustment_amount: Money) -> Self
Sourcepub fn load_categories(&mut self, categories: Vec<(CategoryId, String)>)
pub fn load_categories(&mut self, categories: Vec<(CategoryId, String)>)
Load categories from storage
Sourcepub fn filtered_categories(&self) -> Vec<&(CategoryId, String)>
pub fn filtered_categories(&self) -> Vec<&(CategoryId, String)>
Get filtered categories based on input
Sourcepub fn select_current(&mut self)
pub fn select_current(&mut self)
Select the current category
Trait Implementations§
Source§impl Clone for AdjustmentDialogState
impl Clone for AdjustmentDialogState
Source§fn clone(&self) -> AdjustmentDialogState
fn clone(&self) -> AdjustmentDialogState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdjustmentDialogState
impl Debug for AdjustmentDialogState
Source§impl Default for AdjustmentDialogState
impl Default for AdjustmentDialogState
Source§fn default() -> AdjustmentDialogState
fn default() -> AdjustmentDialogState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AdjustmentDialogState
impl RefUnwindSafe for AdjustmentDialogState
impl Send for AdjustmentDialogState
impl Sync for AdjustmentDialogState
impl Unpin for AdjustmentDialogState
impl UnwindSafe for AdjustmentDialogState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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