diff options
author | Akshay <[email protected]> | 2021-04-02 06:41:44 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-02 06:41:44 +0100 |
commit | c7a575d3fef907103a94ff444bb86c280e47148b (patch) | |
tree | e82b7fbebcb76002ac5122bc6e0d4092cf7eacd5 /posts | |
parent | fe9b5edea79dfc508066efca2156aeb02cf16cde (diff) |
add day 17 of devlog
Diffstat (limited to 'posts')
-rw-r--r-- | posts/SDL2_devlog.md | 31 |
1 files changed, 31 insertions, 0 deletions
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 | |||
5 | order, begin from the bottom, if this is your first time on | 5 | order, begin from the bottom, if this is your first time on |
6 | this page. | 6 | this page. |
7 | 7 | ||
8 | ### Day 17 | ||
9 | |||
10 | I decided to give the text-only statusline a touch up, by | ||
11 | adding a active color and dither level preview. Aligning the | ||
12 | "widget" to the right of statusline involved a lot more than | ||
13 | I thought, so I created a ghetto CSS-like rectangle | ||
14 | placement system to position containers inside containers: | ||
15 | |||
16 | ```rust | ||
17 | // roughly something like this | ||
18 | let statusline = | ||
19 | Container::new(Offset::Left(0), Offset::Bottom(40)) | ||
20 | .width(Size::Max) | ||
21 | .height(Size::Absolute(20)); | ||
22 | |||
23 | let mut primary = Container::uninit() | ||
24 | .width(Size::Absolute(16)) | ||
25 | .height(Size::Absolute(16)); | ||
26 | |||
27 | container.place( | ||
28 | &mut padding_box, | ||
29 | HorAlign::Right, | ||
30 | VertAlign::Center | ||
31 | ); | ||
32 | ``` | ||
33 | |||
34 | The result (brush preview on the bottom right): | ||
35 | |||
36 | ![Day 17](https://u.peppe.rs/OtU.mp4) | ||
37 | |||
38 | |||
8 | ### Day 16 | 39 | ### Day 16 |
9 | 40 | ||
10 | The embedded lisp is coming along nicely, users can load | 41 | The embedded lisp is coming along nicely, users can load |