diff options
| author | lukeflo | 2025-05-26 14:55:21 +0200 |
|---|---|---|
| committer | lukeflo | 2025-05-26 14:55:21 +0200 |
| commit | c0dcbcd18a3fba111885fd0eaf8ef18f71cf693a (patch) | |
| tree | 169a78c55c904ef31d84594fe76d85656fd14523 /src/tui | |
| parent | eac547bce389169b867ccdeedc47ba2b8b90511d (diff) | |
| download | bibiman-c0dcbcd18a3fba111885fd0eaf8ef18f71cf693a.tar.gz bibiman-c0dcbcd18a3fba111885fd0eaf8ef18f71cf693a.zip | |
some more doc strings
Diffstat (limited to 'src/tui')
| -rw-r--r-- | src/tui/popup.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tui/popup.rs b/src/tui/popup.rs index 2a6f18a..a0a61a4 100644 --- a/src/tui/popup.rs +++ b/src/tui/popup.rs @@ -26,11 +26,17 @@ use crate::config::BibiConfig; #[derive(Debug)] pub enum PopupKind { Help, + /// use for a confirmation message MessageConfirm, + /// use for a warning message MessageError, + /// open a resource connected to the entry OpenRes, + /// select file to append entry to AppendToFile, + /// append entry to a bibfile (selected in `AppendToFile` popup) AddEntry, + /// select an item of the current entry to yank to clipboard YankItem, } @@ -108,6 +114,14 @@ impl PopupArea { Text::from(helptext) } + /// Creates a popup message. The needed arguments are: + /// + /// - `message` as `str`: The message displayed in the popup. + /// - `object` as `str`: A possible object added to the message. E.g. the content + /// which gets copied to the clipboard. + /// - `msg_confirm` as `bool`: if `true` its a confirmation message displayed in + /// in the set `confirm_color` (default: green), if `false` its a warning + /// message displayed in the set `warn_color` (default: red). pub fn popup_message(&mut self, message: &str, object: &str, msg_confirm: bool) { if object.is_empty() { self.popup_message = message.to_owned(); @@ -122,6 +136,9 @@ impl PopupArea { self.is_popup = true; } + /// 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>) { self.popup_list = items; // self.popup_kind = Some(PopupKind::SelectRes); |
