diff options
| author | lukeflo | 2025-07-07 15:17:19 +0200 |
|---|---|---|
| committer | lukeflo | 2025-07-07 15:17:19 +0200 |
| commit | d55cfd8617410545335aeaf895120044c46dde45 (patch) | |
| tree | bb4a41d32a3715610b8429047a12ec9a6540ee08 /src/tui/popup.rs | |
| parent | 2e4ae7a05a73cb1df63343e14fbb8a5fd3c7bf41 (diff) | |
| parent | c0970da999e222cadbcc2242fb67686ed5b00ca4 (diff) | |
| download | bibiman-d55cfd8617410545335aeaf895120044c46dde45.tar.gz bibiman-d55cfd8617410545335aeaf895120044c46dde45.zip | |
Merge pull request 'bibnotes' (#49) from bibnotes into main
- connect bibentries with notes through citekey<>basename matching
- use multiple file extensions for note files (plain-text heavily recommended)
- create notes for bibentries inside notes dir
- use custom symbols as marker for files/links/notes attached to a bibentry
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; |
