diff options
| author | lukeflo | 2025-05-26 17:11:55 +0200 |
|---|---|---|
| committer | lukeflo | 2025-05-26 17:11:55 +0200 |
| commit | 5ab55a263a5ae9cc5cbadf52f6000621e2552f85 (patch) | |
| tree | fa0ed3addcafbf3a1d9479c71d4a3e5cb8a312c9 /src/tui | |
| parent | c0dcbcd18a3fba111885fd0eaf8ef18f71cf693a (diff) | |
| download | bibiman-5ab55a263a5ae9cc5cbadf52f6000621e2552f85.tar.gz bibiman-5ab55a263a5ae9cc5cbadf52f6000621e2552f85.zip | |
first steps in rewriting popups
Diffstat (limited to 'src/tui')
| -rw-r--r-- | src/tui/popup.rs | 6 | ||||
| -rw-r--r-- | src/tui/ui.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tui/popup.rs b/src/tui/popup.rs index a0a61a4..f3f6d58 100644 --- a/src/tui/popup.rs +++ b/src/tui/popup.rs @@ -46,7 +46,7 @@ pub struct PopupArea { pub popup_kind: Option<PopupKind>, pub popup_message: String, pub popup_scroll_pos: u16, - pub popup_list: Vec<String>, + pub popup_list: Vec<(String, String)>, pub popup_state: ListState, pub popup_sel_item: String, // pub add_entry_input: String, @@ -138,8 +138,8 @@ impl PopupArea { /// Opens a popup with a selectable list /// - /// The list items are passed as argument of the kind `Vec<String>`. - pub fn popup_selection(&mut self, items: Vec<String>) { + /// The list items are passed as argument of the kind `Vec<(String, String)>`. + pub fn popup_selection(&mut self, items: Vec<(String, String)>) { self.popup_list = items; // self.popup_kind = Some(PopupKind::SelectRes); self.is_popup = true; diff --git a/src/tui/ui.rs b/src/tui/ui.rs index 883e4df..9cbd075 100644 --- a/src/tui/ui.rs +++ b/src/tui/ui.rs @@ -279,7 +279,7 @@ pub fn render_popup(app: &mut App, cfg: &BibiConfig, frame: &mut Frame) { .popup_area .popup_list .iter() - .map(|item| ListItem::from(item.to_owned())) + .map(|(mes, obj)| ListItem::from(mes.to_owned() + obj)) .collect(); let title = if let Some(PopupKind::OpenRes) = app.bibiman.popup_area.popup_kind { |
