From f7991707b48f6f503e18dbac31b9af80290d9991 Mon Sep 17 00:00:00 2001 From: Andinus Date: Mon, 16 Aug 2021 00:48:26 +0530 Subject: Focus bottom pane on selection --- lib/Taurus/CLI.rakumod | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Taurus/CLI.rakumod b/lib/Taurus/CLI.rakumod index a7759b0..7d80f51 100644 --- a/lib/Taurus/CLI.rakumod +++ b/lib/Taurus/CLI.rakumod @@ -77,11 +77,11 @@ multi sub MAIN ( $p0.select-first; $p0.select(2); $p0.on: select => -> :%meta { + my Int $fmt = 16; if %meta { + ui.focus(:pane(1)); $p1.clear; with @logs { - my Int $fmt = 16; - my $outgoing = .grep(*.[2] eqv "Outgoing Call").map(*.[4]).sum; my $incoming = .grep(*.[2] eqv "Incoming Call").map(*.[4]).sum; @@ -90,9 +90,9 @@ multi sub MAIN ( $p1.put: "%-*s %s".sprintf($fmt, "Total:", seconds-to-str($outgoing + $incoming)); $p1.put: ""; } + $p1.select-first; } elsif %meta -> $num { - my Int $fmt = 18; - + ui.focus(:pane(1)); $p1.clear; $p1.put: "Name: " ~ $_ with %contacts{$num}; $p1.put: "Number: " ~ $num; @@ -113,6 +113,7 @@ multi sub MAIN ( $p1.put: "%-*s %d".sprintf($fmt, "Missed Calls:", .grep(*.[2] eqv "Missed Call").elems); } + $p1.select-first; } } -- cgit 1.4.1-2-gfad0