initial text impl
This commit is contained in:
17
src/core/text.rs
Normal file
17
src/core/text.rs
Normal file
@@ -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