diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-11 13:57:15 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-11 14:22:32 -0700 |
commit | 0aa315fa1e1e89e2c86776b364163483f4a10703 (patch) | |
tree | 22ef2fd2844139d9b72cbf0a754cd77b88120a2c /browse-slack | |
parent | eb1af965730583fac0b3ca342c31bb8c23407d23 (diff) | |
download | mu-0aa315fa1e1e89e2c86776b364163483f4a10703.tar.gz |
slack: space for a search bar
Diffstat (limited to 'browse-slack')
-rw-r--r-- | browse-slack/environment.mu | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu index 3808e2fe..93429d50 100644 --- a/browse-slack/environment.mu +++ b/browse-slack/environment.mu @@ -24,12 +24,14 @@ type tab { # item-padding-ver # in characters # avatar-side # in pixels # avatar-space-hor # in characters +# search-space-ver # in characters # author-name-padding-ver # in characters # post-right-coord # in characters # channel-offset-x # in characters fn render-environment screen: (addr screen), env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr array item) { clear-screen screen + render-search-input screen, env render-item-list screen, env, items, users } @@ -40,7 +42,8 @@ fn render-item-list screen: (addr screen), env: (addr environment), _items: (add var screen-height: int copy-to screen-height, tmp-height # - var y/ecx: int <- copy 1/item-padding-ver + var y/ecx: int <- copy 2/search-space-ver + y <- add 1/item-padding-ver var items/esi: (addr array item) <- copy _items var i/ebx: int <- copy 0 var max/edx: int <- length items @@ -57,6 +60,12 @@ fn render-item-list screen: (addr screen), env: (addr environment), _items: (add } } +fn render-search-input screen: (addr screen), env: (addr environment) { + set-cursor-position 0/screen, 2/x 1/y + draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "search ", 7/fg 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "________________________________", 0xf/fg 0/bg +} + fn render-item screen: (addr screen), _item: (addr item), _users: (addr array user), y: int, screen-height: int -> _/ecx: int { var item/esi: (addr item) <- copy _item var users/edi: (addr array user) <- copy _users |