mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
tui is not maintained anymore and it seems that ratatui is the successor: https://github.com/fdehau/tui-rs/issues/654
39 lines
844 B
Rust
39 lines
844 B
Rust
use crate::{strings, ui::style::SharedTheme};
|
|
use ratatui::text::Span;
|
|
use std::borrow::Cow;
|
|
|
|
pub enum Detail {
|
|
Author,
|
|
Date,
|
|
Commiter,
|
|
Sha,
|
|
Message,
|
|
}
|
|
|
|
pub fn style_detail<'a>(
|
|
theme: &'a SharedTheme,
|
|
field: &Detail,
|
|
) -> Span<'a> {
|
|
match field {
|
|
Detail::Author => Span::styled(
|
|
Cow::from(strings::commit::details_author()),
|
|
theme.text(false, false),
|
|
),
|
|
Detail::Date => Span::styled(
|
|
Cow::from(strings::commit::details_date()),
|
|
theme.text(false, false),
|
|
),
|
|
Detail::Commiter => Span::styled(
|
|
Cow::from(strings::commit::details_committer()),
|
|
theme.text(false, false),
|
|
),
|
|
Detail::Sha => Span::styled(
|
|
Cow::from(strings::commit::details_tags()),
|
|
theme.text(false, false),
|
|
),
|
|
Detail::Message => Span::styled(
|
|
Cow::from(strings::commit::details_message()),
|
|
theme.text(false, false),
|
|
),
|
|
}
|
|
}
|