diff options
Diffstat (limited to 'src/tui/popup.rs')
| -rw-r--r-- | src/tui/popup.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/tui/popup.rs b/src/tui/popup.rs index 93b01c3..46e4792 100644 --- a/src/tui/popup.rs +++ b/src/tui/popup.rs @@ -38,6 +38,19 @@ pub enum PopupKind { AddEntry, /// select an item of the current entry to yank to clipboard YankItem, + /// Create a new note, select extension + CreateNote, +} + +#[derive(Debug)] +pub enum PopupItem { + Bibfile, + Entryfile, + Notefile, + Citekey, + Link, + Default, + None, } #[derive(Debug, Default)] @@ -46,7 +59,7 @@ pub struct PopupArea { pub popup_kind: Option<PopupKind>, pub popup_message: String, pub popup_scroll_pos: u16, - pub popup_list: Vec<(String, String)>, + pub popup_list: Vec<(String, String, PopupItem)>, pub popup_state: ListState, pub popup_sel_item: String, // pub add_entry_input: String, @@ -116,8 +129,8 @@ impl PopupArea { /// Opens a popup with a selectable list /// - /// The list items are passed as argument of the kind `Vec<(String, String)>`. - pub fn popup_selection(&mut self, items: Vec<(String, String)>) { + /// The list items are passed as argument of the kind `Vec<(String, String, PopupItem)>`. + pub fn popup_selection(&mut self, items: Vec<(String, String, PopupItem)>) { self.popup_list = items; // self.popup_kind = Some(PopupKind::SelectRes); self.is_popup = true; |
