pub trait ViewMode: Send {
// Required methods
fn describe(&self) -> ModeInfo;
fn show(&mut self, ui: &mut Ui, cx: ModeContext<'_>) -> ModeOutput;
fn step(&self, from: usize, count: usize, key: ModeKey) -> usize;
// Provided methods
fn travel(&self, _key: ModeKey) -> Option<Travel> { ... }
fn toolbar(&mut self, _ui: &mut Ui, _settings: &mut ModeSettings) -> bool { ... }
fn own_key(
&mut self,
_key: Key,
_modifiers: Modifiers,
_focus: Option<usize>,
_settings: &mut ModeSettings,
) -> bool { ... }
}Expand description
A way to show a browser’s entries. It draws and reports; selection rules, what Enter does and what a click on a folder does are the browser’s.
Required Methods§
fn describe(&self) -> ModeInfo
fn show(&mut self, ui: &mut Ui, cx: ModeContext<'_>) -> ModeOutput
Provided Methods§
Sourcefn travel(&self, _key: ModeKey) -> Option<Travel>
fn travel(&self, _key: ModeKey) -> Option<Travel>
Whether a key leaves the place rather than moving within it (Left and
Right in Finder’s columns). None, the default, leaves the key to
ViewMode::step.
Sourcefn toolbar(&mut self, _ui: &mut Ui, _settings: &mut ModeSettings) -> bool
fn toolbar(&mut self, _ui: &mut Ui, _settings: &mut ModeSettings) -> bool
Draws the mode’s own controls in the browser’s toolbar, after the
switcher (the agenda’s level). true when a setting changed.
Sourcefn own_key(
&mut self,
_key: Key,
_modifiers: Modifiers,
_focus: Option<usize>,
_settings: &mut ModeSettings,
) -> bool
fn own_key( &mut self, _key: Key, _modifiers: Modifiers, _focus: Option<usize>, _settings: &mut ModeSettings, ) -> bool
A key of the mode’s own, beyond the arrows (Ctrl+Up in the agenda),
pressed while the entry focus has the focus. true when taken: the
browser then brings the focus into view and does nothing else with it.