mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-12-22 12:28:19 -06:00
add Text::new
This commit is contained in:
parent
1a6d79b2fc
commit
45132db996
|
@ -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