pub struct SplitsWidget {
pub row_focus: usize,
pub col_focus: usize,
/* private fields */
}Expand description
Multi-row split editor.
row_focus is always < rows.len() (minimum 1 row).
col_focus is always < COL_COUNT.
Fields§
§row_focus: usize§col_focus: usizeImplementations§
Source§impl SplitsWidget
impl SplitsWidget
Sourcepub fn focused_subwidget_kind(&self) -> WidgetKind
pub fn focused_subwidget_kind(&self) -> WidgetKind
WidgetKind of the focused column.
Sourcepub fn focused_subwidget_mut(&mut self) -> Option<FocusedSubWidget<'_>>
pub fn focused_subwidget_mut(&mut self) -> Option<FocusedSubWidget<'_>>
Mutable reference to the focused sub-widget for intent routing.
Sourcepub fn advance_cell(&mut self)
pub fn advance_cell(&mut self)
Advance one cell: next column, or the next row’s first column at a row
boundary. A no-op at the last cell of the last row (the caller yields to
the outer form there — see at_last_cell).
Sourcepub fn retreat_cell(&mut self)
pub fn retreat_cell(&mut self)
Retreat one cell: previous column, or the previous row’s last column at a row boundary. A no-op at the first cell (the caller yields there).
Sourcepub fn at_first_cell(&self) -> bool
pub fn at_first_cell(&self) -> bool
true when focus is on the very first cell (row 0, column 0); BackTab
here should yield to the outer form rather than move within the editor.
Sourcepub fn at_last_cell(&self) -> bool
pub fn at_last_cell(&self) -> bool
true when focus is on the very last cell (last row, last column); Tab
here should yield to the outer form rather than move within the editor.
Sourcepub fn add_row(&mut self)
pub fn add_row(&mut self)
Append a new row after row_focus, pre-seeded from the cached option
lists, and focus it.
Sourcepub fn remove_row(&mut self)
pub fn remove_row(&mut self)
Remove the focused row; keeps at least one row.
Sourcepub fn set_account_options(&mut self, options: Vec<SelectOption>)
pub fn set_account_options(&mut self, options: Vec<SelectOption>)
Cache the account options and apply them to every row’s from/to selects, preserving any pre-selected uuid so edit-form seeds survive the options fetch.
Sourcepub fn set_commodity_options(&mut self, options: Vec<SelectOption>)
pub fn set_commodity_options(&mut self, options: Vec<SelectOption>)
Cache the commodity options and apply them to every row’s commodity selects, preserving any pre-selected uuid so edit-form seeds survive the options fetch.
Sourcepub fn apply_prefill(&mut self, rows: &[SplitRowPrefill<'_>])
pub fn apply_prefill(&mut self, rows: &[SplitRowPrefill<'_>])
Replace all rows with pre-seeded data from an existing transaction.
Each select is initialised with a single-option list holding the stored
uuid so value() returns it immediately; the later set_account_options
/ set_commodity_options call will replace the list while preserving the
selection via set_options_preserving_id.
Guarantees at least one row even when rows is empty.
Sourcepub fn display(&self) -> String
pub fn display(&self) -> String
Display summary for the generic Widget::display contract.
Sourcepub fn render_lines(&self) -> Vec<String>
pub fn render_lines(&self) -> Vec<String>
One detailed line per row for the modal, with the focused row marked by
a leading ▸ and the focused cell wrapped in [...]. The cross-commodity
conversion (→ to_amount) is shown only when the commodities differ.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SplitsWidget
impl RefUnwindSafe for SplitsWidget
impl Send for SplitsWidget
impl Sync for SplitsWidget
impl Unpin for SplitsWidget
impl UnsafeUnpin for SplitsWidget
impl UnwindSafe for SplitsWidget
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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