custom_bar_theme/
custom_bar_theme.rs1use crossterm::style::{Attribute, Color, ContentStyle, Stylize};
2use pager_rs::{CommandList, State, StatusBar};
3fn main() -> std::io::Result<()> {
4 let content = r#"fn main() {
5 println!("Hello World!");
6}"#
7 .to_string();
8
9 let theme = ContentStyle::new()
10 .with(Color::White)
11 .on(Color::Red)
12 .attribute(Attribute::Italic);
13 let status_bar = StatusBar::with_theme(
14 "Hello World program in rust with colored status bar".to_string(),
15 theme,
16 );
17
18 let mut state = State::new(content, status_bar, CommandList::default())?;
19
20 pager_rs::init()?;
21
22 pager_rs::run(&mut state)?;
23
24 pager_rs::finish()?;
25
26 Ok(())
27}