Skip to content

Commit

Permalink
add Text::with_style
Browse files Browse the repository at this point in the history
  • Loading branch information
msparkles committed Jul 3, 2024
1 parent 3377922 commit 1c380da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/yakui-widgets/src/widgets/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ impl Text {
}
}

pub fn with_style<S: Into<Cow<'static, str>>>(text: S, style: TextStyle) -> Self {
Self {
text: text.into(),
style,
padding: Pad::ZERO,
}
}

pub fn label(text: Cow<'static, str>) -> Self {
Self {
text,
Expand Down

0 comments on commit 1c380da

Please sign in to comment.