From 2594cf34dcf2f04f398dab7b6ecae364eb4c7d17 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Fri, 4 Jul 2025 13:56:55 +0200 Subject: impl `PopupItem` enum, adapt ui: include colors --- src/tui/popup.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/tui/popup.rs') diff --git a/src/tui/popup.rs b/src/tui/popup.rs index 93b01c3..da44744 100644 --- a/src/tui/popup.rs +++ b/src/tui/popup.rs @@ -40,13 +40,23 @@ pub enum PopupKind { YankItem, } +#[derive(Debug)] +pub enum PopupItem { + Bibfile, + Entryfile, + Notefile, + Link, + Default, + None, +} + #[derive(Debug, Default)] pub struct PopupArea { pub is_popup: bool, pub popup_kind: Option, 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 +126,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; -- cgit v1.2.3