From afc3d1618d994e616606c0a526ff2b745712ac8c Mon Sep 17 00:00:00 2001 From: Andinus Date: Mon, 16 Aug 2021 20:03:10 +0530 Subject: Remove progress frame We don't have to create a new frame to show progress, this instead prints it to pane0 and clears it when done. --- lib/Taurus/CLI.rakumod | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/Taurus/CLI.rakumod b/lib/Taurus/CLI.rakumod index 8aacc7a..560ef75 100644 --- a/lib/Taurus/CLI.rakumod +++ b/lib/Taurus/CLI.rakumod @@ -51,27 +51,18 @@ multi sub MAIN ( my $p0 = ui.panes[0]; my $p1 = ui.panes[1]; + until $initial.status { + $p0.splash: "Parsing logs" ~ (". ", ".. ", "...")[$++ % 3]; + sleep 1; + } + $p0.splash: "Parsed {@logs.elems} entries in {now - $timed}s."; + $p0.select-last; + ui.get-key; + $p0.clear; + $p0.put: t.bold ~ t.bg-cyan ~ t.black ~ t.underline ~ "Taurus v" ~ $?DISTRIBUTION.meta; $p0.put: ""; - with ui.screen.add-frame(:4height, :40width, :center) -> $f { - with $f.add-pane -> $p { - $f.draw; - until $initial.status { - $p.splash: "Parsing logs" ~ (". ", ".. ", "...")[$++ % 3]; - sleep 1; - } - $p.splash: "Parsed {@logs.elems} entries in {now - $timed}s."; - $p.put: " " x 18 ~ "Ok"; - $p.select-last; - ui.focus($f); - } - ui.get-key; - ui.screen.remove-frame($f); - ui.focus($f); - } - ui.refresh; - $p0.put: "- Show Records", :meta(:all); $p0.put: ""; $p0.put: "Yearly Records"; -- cgit 1.4.1-2-gfad0