From 48afc51fafc7d4fd3e8dde867dbd95d4d54ddb30 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 14 Aug 2021 16:29:25 -0700 Subject: slack: menu options for browsing intra-item --- browse-slack/environment.mu | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'browse-slack') diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu index a802743a..1ec9d28b 100644 --- a/browse-slack/environment.mu +++ b/browse-slack/environment.mu @@ -352,19 +352,38 @@ fn render-menu screen: (addr screen), _env: (addr environment) { } fn render-main-menu screen: (addr screen), _env: (addr environment) { + var env/edi: (addr environment) <- copy _env var width/eax: int <- copy 0 var y/ecx: int <- copy 0 width, y <- screen-size screen y <- decrement set-cursor-position screen, 2/x, y { - var env/edi: (addr environment) <- copy _env var num-tabs/edi: (addr int) <- get env, current-tab-index compare *num-tabs, 0 break-if-<= draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg draw-text-rightward-from-cursor screen, " go back ", width, 0xf/fg, 0/bg } + $render-main-menu:enter: { + draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg + { + { + var current-tab-index-a/ecx: (addr int) <- get env, current-tab-index + var tabs-ah/eax: (addr handle array tab) <- get env, tabs + var tabs/eax: (addr array tab) <- lookup *tabs-ah + var current-tab-index/ecx: int <- copy *current-tab-index-a + var current-tab-offset/ecx: (offset tab) <- compute-offset tabs, current-tab-index + var current-tab/ecx: (addr tab) <- index tabs, current-tab-offset + var current-tab-intra-item-cursor-position/ecx: (addr int) <- get current-tab, intra-item-cursor-position + compare *current-tab-intra-item-cursor-position, 0/user + } + break-if-!= + draw-text-rightward-from-cursor screen, " go to user ", width, 0xf/fg, 0/bg + break $render-main-menu:enter + } + draw-text-rightward-from-cursor screen, " go to thread ", width, 0xf/fg, 0/bg + } draw-text-rightward-from-cursor screen, " / ", width, 0/fg 0xf/bg draw-text-rightward-from-cursor screen, " search ", width, 0xf/fg, 0/bg draw-text-rightward-from-cursor screen, " Tab ", width, 0/fg 0xf/bg -- cgit 1.4.1-2-gfad0