generated from PlexSheep/baserepo
Compare commits
No commits in common. "0179c53e82f570f863299e11f3201494d05a7450" and "8070f0b100fca951da5e1f3650c69de4d37b4da6" have entirely different histories.
0179c53e82
...
8070f0b100
1 changed files with 4 additions and 7 deletions
|
@ -42,7 +42,7 @@ pub fn blockprint(content: impl ToString, color: Color) {
|
||||||
pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
||||||
blockfmt_advanced(
|
blockfmt_advanced(
|
||||||
content,
|
content,
|
||||||
Some(color),
|
color,
|
||||||
presets::UTF8_BORDERS_ONLY,
|
presets::UTF8_BORDERS_ONLY,
|
||||||
ContentArrangement::DynamicFullWidth,
|
ContentArrangement::DynamicFullWidth,
|
||||||
CellAlignment::Center,
|
CellAlignment::Center,
|
||||||
|
@ -67,7 +67,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
||||||
/// "{}",
|
/// "{}",
|
||||||
/// blockfmt_advanced(
|
/// blockfmt_advanced(
|
||||||
/// "Hello world!".to_string(),
|
/// "Hello world!".to_string(),
|
||||||
/// Some(Color::Blue),
|
/// Color::Blue,
|
||||||
/// presets::UTF8_FULL,
|
/// presets::UTF8_FULL,
|
||||||
/// ContentArrangement::DynamicFullWidth,
|
/// ContentArrangement::DynamicFullWidth,
|
||||||
/// CellAlignment::Center
|
/// CellAlignment::Center
|
||||||
|
@ -86,7 +86,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
||||||
///
|
///
|
||||||
pub fn blockfmt_advanced(
|
pub fn blockfmt_advanced(
|
||||||
content: impl ToString,
|
content: impl ToString,
|
||||||
color: Option<Color>,
|
color: Color,
|
||||||
preset: &str,
|
preset: &str,
|
||||||
arrangement: ContentArrangement,
|
arrangement: ContentArrangement,
|
||||||
alignment: CellAlignment,
|
alignment: CellAlignment,
|
||||||
|
@ -98,8 +98,5 @@ pub fn blockfmt_advanced(
|
||||||
.add_row(vec![content.to_string()]);
|
.add_row(vec![content.to_string()]);
|
||||||
table.column_mut(0).unwrap().set_cell_alignment(alignment);
|
table.column_mut(0).unwrap().set_cell_alignment(alignment);
|
||||||
|
|
||||||
match color {
|
format!("{}", style(table).fg(color))
|
||||||
Some(c) => format!("{}", style(table).fg(c)),
|
|
||||||
None => table.to_string(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue