diff --git a/src/main.rs b/src/main.rs index 137de73..88749ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,9 @@ fn main() { } fn milestones(app: &mut Screen) { + app.draw(format!("My Project")) + .component(Transform::center().top(20)); + for i in 0..4 { let mut milestone = Div { style: DivStyle { diff --git a/src/style.rs b/src/style.rs index b42dc53..54a60b1 100644 --- a/src/style.rs +++ b/src/style.rs @@ -53,6 +53,11 @@ impl Transform { } } + pub fn top(mut self, m: usize) -> Self { + self.y = Position::Const(m); + self + } + pub fn bottom(mut self) -> Self { self.y = Position::End; self