initial text impl
This commit is contained in:
1 parent
abcbc267b5
commit
5ce6fca275
33 files changed
+530
-117
No files matched your search
@@ -0,0 +1,17 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct Text {
|
||||
content: String,
|
||||
}
|
||||
|
||||
impl<Ctx> Widget<Ctx> for Text {
|
||||
fn draw(&self, painter: &mut Painter<Ctx>) {
|
||||
painter.draw_text(&self.content);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn text(text: impl Into<String>) -> Text {
|
||||
Text {
|
||||
content: text.into(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user