mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
make search strings persist between modes and menus
This commit is contained in:
parent
819b84954a
commit
475fadb255
2 changed files with 8 additions and 25 deletions
|
|
@ -73,6 +73,8 @@ pub(crate) struct VaultUx {
|
|||
filtered_list: Vec::<ListItem>,
|
||||
/// the index into the item_list that is selected
|
||||
selection_index: usize,
|
||||
/// last filter query, so we can re-use it when mode is changed
|
||||
last_query: String,
|
||||
|
||||
/// pddb handle
|
||||
pddb: RefCell::<Pddb>,
|
||||
|
|
@ -176,6 +178,7 @@ impl VaultUx {
|
|||
usb_dev: usb_device_xous::UsbHid::new(),
|
||||
last_epoch: current_time / 30,
|
||||
current_time,
|
||||
last_query: String::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +186,8 @@ impl VaultUx {
|
|||
self.title_dirty = true;
|
||||
self.filtered_list.clear();
|
||||
self.selection_index = 0;
|
||||
self.filter("");
|
||||
let query = self.last_query.to_string();
|
||||
self.filter(&query);
|
||||
self.swap_submenu();
|
||||
}
|
||||
|
||||
|
|
@ -195,6 +199,8 @@ impl VaultUx {
|
|||
- edit pw totp fido
|
||||
- delete pw totp fido
|
||||
- change font pw totp fido
|
||||
- unlock basis pw totp fido
|
||||
- list/lock basis pw totp fido
|
||||
- close pw totp fido
|
||||
*/
|
||||
pub fn swap_submenu(&mut self) {
|
||||
|
|
@ -346,6 +352,7 @@ impl VaultUx {
|
|||
pub(crate) fn input(&mut self, line: &str) -> Result<(), xous::Error> {
|
||||
self.title_dirty = true;
|
||||
self.filter(line);
|
||||
self.last_query = line.to_string();
|
||||
Ok(())
|
||||
}
|
||||
fn get_page(&self) -> i16 {
|
||||
|
|
|
|||
|
|
@ -326,12 +326,6 @@ impl InputTracker {
|
|||
self.insert_prediction(0);
|
||||
do_redraw = true;
|
||||
} else {
|
||||
self.pred_phrase.clear();
|
||||
self.line.clear();
|
||||
self.can_unpick = false;
|
||||
self.last_trigger_char = Some(0);
|
||||
self.characters = 0;
|
||||
self.insertion = 0;
|
||||
retstring = Some(xous_ipc::String::<4000>::from_str("\u{0011}"));
|
||||
do_redraw = true;
|
||||
}
|
||||
|
|
@ -341,12 +335,6 @@ impl InputTracker {
|
|||
self.insert_prediction(1);
|
||||
do_redraw = true;
|
||||
} else {
|
||||
self.pred_phrase.clear();
|
||||
self.line.clear();
|
||||
self.can_unpick = false;
|
||||
self.last_trigger_char = Some(0);
|
||||
self.characters = 0;
|
||||
self.insertion = 0;
|
||||
retstring = Some(xous_ipc::String::<4000>::from_str("\u{0012}"));
|
||||
do_redraw = true;
|
||||
}
|
||||
|
|
@ -356,12 +344,6 @@ impl InputTracker {
|
|||
self.insert_prediction(2);
|
||||
do_redraw = true;
|
||||
} else {
|
||||
self.pred_phrase.clear();
|
||||
self.line.clear();
|
||||
self.can_unpick = false;
|
||||
self.last_trigger_char = Some(0);
|
||||
self.characters = 0;
|
||||
self.insertion = 0;
|
||||
retstring = Some(xous_ipc::String::<4000>::from_str("\u{0013}"));
|
||||
do_redraw = true;
|
||||
}
|
||||
|
|
@ -371,12 +353,6 @@ impl InputTracker {
|
|||
self.insert_prediction(3);
|
||||
do_redraw = true;
|
||||
} else {
|
||||
self.pred_phrase.clear();
|
||||
self.line.clear();
|
||||
self.can_unpick = false;
|
||||
self.last_trigger_char = Some(0);
|
||||
self.characters = 0;
|
||||
self.insertion = 0;
|
||||
retstring = Some(xous_ipc::String::<4000>::from_str("\u{0014}"));
|
||||
do_redraw = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue