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
1a6d79b2fc
commit
45132db996
|
@ -57,6 +57,13 @@ impl Default for Text {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl 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 {
|
fn font(&self, f: FontHandle) -> FontHandle {
|
||||||
self.font.unwrap_or(f)
|
self.font.unwrap_or(f)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue