mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 15:18:43 -06:00
add Text::new
This commit is contained in:
parent
6064567433
commit
481fff7dee
|
@ -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