pub struct ViewsModal {
pub rows: Vec<ViewRow>,
pub selected: usize,
pub prompt: Option<ViewsPrompt>,
pub feedback: Option<ViewFeedback>,
pub note: Option<String>,
}Expand description
The saved-views modal’s own state: rows, cursor, prompt, feedback.
Fields§
§rows: Vec<ViewRow>One row per stored view, in declaration order (registry order).
selected: usizeThe cursor over rows.
prompt: Option<ViewsPrompt>The active inline prompt, or None while browsing the list.
feedback: Option<ViewFeedback>Feedback for the row under the cursor, refreshed by the app (T026).
note: Option<String>One line about the last operation: a refusal, or what was written.
Implementations§
Source§impl ViewsModal
impl ViewsModal
Sourcepub fn new(rows: Vec<ViewRow>) -> Self
pub fn new(rows: Vec<ViewRow>) -> Self
A modal over rows, with the cursor on the active view when one is
marked and on the first row otherwise — so opening the view list shows
the view the board is currently associated with.
Sourcepub fn selected_row(&self) -> Option<&ViewRow>
pub fn selected_row(&self) -> Option<&ViewRow>
The row under the cursor, when the list is not empty.
Sourcepub fn move_selected(&mut self, delta: isize)
pub fn move_selected(&mut self, delta: isize)
Move the cursor by delta, clamped to the list (no wrap: the views modal
is a menu, and a menu that wraps hides how many entries there are).
Sourcepub fn move_selected_to(&mut self, row: usize)
pub fn move_selected_to(&mut self, row: usize)
Jump the cursor straight to row (a row click, D6), clamped to the same
range the arrow keys navigate.
Sourcepub const fn is_prompting(&self) -> bool
pub const fn is_prompting(&self) -> bool
Whether an inline prompt is open.
Sourcepub fn clear_prompt(&mut self)
pub fn clear_prompt(&mut self)
Drop the prompt (a cancel, or after a completed operation).
Sourcepub fn row_hit_regions(&self, area: Rect) -> Vec<(Rect, usize)>
pub fn row_hit_regions(&self, area: Rect) -> Vec<(Rect, usize)>
The clickable rect of every visible row, paired with that row’s index
in Self::rows (D6).
The widget owns its own layout, so the app asks it where the rows are rather than re-deriving the windowing and drifting from it — a click that selected the wrong view would be a silent wrong action, which is exactly what the region indirection exists to prevent.
Sourcepub fn render(&self, f: &mut Frame<'_>, area: Rect)
pub fn render(&self, f: &mut Frame<'_>, area: Rect)
Render the modal with the built-in keybindings (tests, and any caller that
has no EffectiveBindings at hand).
pub fn render_with_bindings( &self, f: &mut Frame<'_>, area: Rect, bindings: &EffectiveBindings, context: InputContext, )
Trait Implementations§
Source§impl Clone for ViewsModal
impl Clone for ViewsModal
Source§impl Debug for ViewsModal
impl Debug for ViewsModal
Source§impl Default for ViewsModal
impl Default for ViewsModal
impl Eq for ViewsModal
Source§impl PartialEq for ViewsModal
impl PartialEq for ViewsModal
impl StructuralPartialEq for ViewsModal
Auto Trait Implementations§
impl Freeze for ViewsModal
impl RefUnwindSafe for ViewsModal
impl Send for ViewsModal
impl Sync for ViewsModal
impl Unpin for ViewsModal
impl UnsafeUnpin for ViewsModal
impl UnwindSafe for ViewsModal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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