mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-25 16:38:42 -06:00
add Text::new
This commit is contained in:
parent
6064567433
commit
481fff7dee
|
@ -57,6 +57,13 @@ impl Default for Text {
|
|||
}
|
||||
|
||||
impl Text {
|
||||
pub fn new(text: impl Into<Cow<'static, str>>) -> Self {
|
||||
Self {
|
||||
text: text.into(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn font(&self, f: FontHandle) -> FontHandle {
|
||||
self.font.unwrap_or(f)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue