mirror of
https://github.com/kristoferssolo/traxor.git
synced 2025-10-21 20:10:35 +00:00
feat(popup): close popup on any key
This commit is contained in:
parent
f347768aac
commit
b9f4aa1343
@ -53,6 +53,7 @@ impl<'a> App<'a> {
|
|||||||
}
|
}
|
||||||
None => 0,
|
None => 0,
|
||||||
};
|
};
|
||||||
|
self.close_popup();
|
||||||
self.state.select(Some(i));
|
self.state.select(Some(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,16 +68,19 @@ impl<'a> App<'a> {
|
|||||||
}
|
}
|
||||||
None => 0,
|
None => 0,
|
||||||
};
|
};
|
||||||
|
self.close_popup();
|
||||||
self.state.select(Some(i));
|
self.state.select(Some(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Switches to the next tab.
|
/// Switches to the next tab.
|
||||||
pub fn next_tab(&mut self) {
|
pub fn next_tab(&mut self) {
|
||||||
|
self.close_popup();
|
||||||
self.index = (self.index + 1) % self.tabs.len();
|
self.index = (self.index + 1) % self.tabs.len();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Switches to the previous tab.
|
/// Switches to the previous tab.
|
||||||
pub fn prev_tab(&mut self) {
|
pub fn prev_tab(&mut self) {
|
||||||
|
self.close_popup();
|
||||||
if self.index > 0 {
|
if self.index > 0 {
|
||||||
self.index -= 1;
|
self.index -= 1;
|
||||||
} else {
|
} else {
|
||||||
@ -86,6 +90,7 @@ impl<'a> App<'a> {
|
|||||||
|
|
||||||
/// Switches to the tab whose index is `idx`.
|
/// Switches to the tab whose index is `idx`.
|
||||||
pub fn switch_tab(&mut self, idx: usize) {
|
pub fn switch_tab(&mut self, idx: usize) {
|
||||||
|
self.close_popup();
|
||||||
self.index = idx
|
self.index = idx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user