From c7a575d3fef907103a94ff444bb86c280e47148b Mon Sep 17 00:00:00 2001 From: Akshay Date: Fri, 2 Apr 2021 11:11:44 +0530 Subject: add day 17 of devlog --- posts/SDL2_devlog.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'posts') diff --git a/posts/SDL2_devlog.md b/posts/SDL2_devlog.md index 991a246..eb11de8 100644 --- a/posts/SDL2_devlog.md +++ b/posts/SDL2_devlog.md @@ -5,6 +5,37 @@ on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page. +### Day 17 + +I decided to give the text-only statusline a touch up, by +adding a active color and dither level preview. Aligning the +"widget" to the right of statusline involved a lot more than +I thought, so I created a ghetto CSS-like rectangle +placement system to position containers inside containers: + +```rust +// roughly something like this +let statusline = + Container::new(Offset::Left(0), Offset::Bottom(40)) + .width(Size::Max) + .height(Size::Absolute(20)); + +let mut primary = Container::uninit() + .width(Size::Absolute(16)) + .height(Size::Absolute(16)); + +container.place( + &mut padding_box, + HorAlign::Right, + VertAlign::Center +); +``` + +The result (brush preview on the bottom right): + +![Day 17](https://u.peppe.rs/OtU.mp4) + + ### Day 16 The embedded lisp is coming along nicely, users can load -- cgit v1.2.3