diff options
author | Stephan Dilly <dilly.stephan@gmail.com> | 2022-02-06 22:13:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 22:13:05 +0100 |
commit | 284c57fb72abd1add2aac6f95583c0053da13775 (patch) | |
tree | de7710872509e39fdba8c8259b3dc60fb740560f /src/popup_stack.rs | |
parent | e9d8de1be415c0647a8ec817f216ee613c2ebf5e (diff) |
generic popup stacking solution (#1124)
* generic popup stacking solution
* allow going back to file-revision popup
* do not select diff in coming back to files-revlog
* handle filetree popup via stacking
* allow going back to inspect commit
* allow coming back to compare/inspect commit
Diffstat (limited to 'src/popup_stack.rs')
-rw-r--r-- | src/popup_stack.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/popup_stack.rs b/src/popup_stack.rs new file mode 100644 index 00000000..dfef56cf --- /dev/null +++ b/src/popup_stack.rs @@ -0,0 +1,16 @@ +use crate::queue::StackablePopupOpen; + +#[derive(Default)] +pub struct PopupStack { + stack: Vec<StackablePopupOpen>, +} + +impl PopupStack { + pub fn push(&mut self, popup: StackablePopupOpen) { + self.stack.push(popup); + } + + pub fn pop(&mut self) -> Option<StackablePopupOpen> { + self.stack.pop() + } +} |