aboutsummaryrefslogtreecommitdiff
path: root/src/tui/popup.rs
diff options
context:
space:
mode:
authorlukeflo2025-02-24 15:29:47 +0000
committerlukeflo2025-02-24 15:29:47 +0000
commit5da77a2f812a0bb6e0057f7b2e2c642142fca125 (patch)
tree6be886693445a54e4cbd7b98151555eec220e863 /src/tui/popup.rs
parentdd8dd9611771491e723a49b41cf27b1e9090664d (diff)
parentaff7c398da005029a293178e487cf5323e507fb4 (diff)
downloadbibiman-5da77a2f812a0bb6e0057f7b2e2c642142fca125.tar.gz
bibiman-5da77a2f812a0bb6e0057f7b2e2c642142fca125.zip
Merge pull request 'Implement config file' (#15) from implement-config into main
Reviewed-on: https://codeberg.org/lukeflo/bibiman/pulls/15
Diffstat (limited to 'src/tui/popup.rs')
-rw-r--r--src/tui/popup.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/tui/popup.rs b/src/tui/popup.rs
index 4ef9fc3..f226429 100644
--- a/src/tui/popup.rs
+++ b/src/tui/popup.rs
@@ -16,12 +16,12 @@
/////
use ratatui::{
- style::{Color, Stylize},
+ style::Stylize,
text::{Line, Span, Text},
widgets::ListState,
};
-use crate::cliargs::CLIArgs;
+use crate::config::BibiConfig;
#[derive(Debug)]
pub enum PopupKind {
@@ -47,7 +47,7 @@ pub struct PopupArea {
}
impl PopupArea {
- pub fn popup_help<'a>(args: &CLIArgs) -> Text<'a> {
+ pub fn popup_help<'a>(cfg: &BibiConfig) -> Text<'a> {
let help = [
("General", "first"),
("TAB: ", "Toggle areas (Entries, Keywords)"),
@@ -89,22 +89,16 @@ impl PopupArea {
for (keys, help) in help {
if help == "first" {
helptext.push(Line::from(
- Span::raw(keys)
- .bold()
- .fg(Color::Indexed(args.colors.main_text_color)),
+ Span::raw(keys).bold().fg(cfg.colors.main_text_color),
))
} else if help == "sub" {
helptext.push(Line::from(""));
helptext.push(Line::from(
- Span::raw(keys)
- .bold()
- .fg(Color::Indexed(args.colors.main_text_color)),
+ Span::raw(keys).bold().fg(cfg.colors.main_text_color),
))
} else {
helptext.push(Line::from(vec![
- Span::raw(keys)
- .bold()
- .fg(Color::Indexed(args.colors.keyword_color)),
+ Span::raw(keys).bold().fg(cfg.colors.main_text_color),
Span::raw(help),
]))
}