From 3b97e66c106807416f591e344044d98fcf19bb6f Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 16 Oct 2020 15:47:00 +0300 Subject: [PATCH] docs/meli.conf.5: add progress_spinner_sequence doc --- docs/meli.conf.5 | 44 +++++++++++++++++++++++++++++ src/components/utilities/widgets.rs | 6 ++++ 2 files changed, 50 insertions(+) diff --git a/docs/meli.conf.5 b/docs/meli.conf.5 index 3b5085c4..4296ca64 100644 --- a/docs/meli.conf.5 +++ b/docs/meli.conf.5 @@ -941,6 +941,50 @@ theme = "themeB" [terminal.themes.themeC] \&... .Ed +.It Ic progress_spinner_sequence Ar Either \&< Integer, [String] \&> +Choose between 30-something built in sequences (integers between 0-30) or define your own list of strings for the progress spinner animation. +Set to an empty array to disable the progress spinner. +.\" default value +.Pq Em 19 +Builtin sequences are: +.Bd -literal +0 ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"] +1 ["⣀", "⣄", "⣤", "⣦", "⣶", "⣷", "⣿"] +2 ["⣀", "⣄", "⣆", "⣇", "⣧", "⣷", "⣿"] +3 ["○", "◔", "◐", "◕", "⬤"] +4 ["□", "◱", "◧", "▣", "■"] +5 ["□", "◱", "▨", "▩", "■"] +6 ["□", "◱", "▥", "▦", "■"] +7 ["░", "▒", "▓", "█"] +8 ["░", "█"] +9 ["⬜", "⬛"] +10 ["▱", "▰"] +11 ["▭", "◼"] +12 ["▯", "▮"] +13 ["◯", "⬤"] +14 ["⚪", "⚫"] +15 ["▖", "▗", "▘", "▝", "▞", "▚", "▙", "▟", "▜", "▛"] +16 ["|", "/", "-", "\\"] +17 [".", "o", "O", "@", "*"] +18 ["◡◡", "⊙⊙", "◠◠", "⊙⊙"] +19 ["◜ ", " ◝", " ◞", "◟ "] +10 ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"] +11 ["▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃"] +22 ["▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"] +23 ["▖", "▘", "▝", "▗"] +24 ["▌", "▀", "▐", "▄"] +25 ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"] +26 ["◢", "◣", "◤", "◥"] +27 ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"] +28 ["⢎⡰", "⢎⡡", "⢎⡑", "⢎⠱", "⠎⡱", "⢊⡱", "⢌⡱", "⢆⡱"] +29 [".", "o", "O", "°", "O", "o", "."] +.Ed +Or, define an array of strings each consisting of a frame in the progress sequence indicator: +.Bd -literal +# 𝄈⡂″⡈߳܃⢂:߳̈⢁܄ː“⢐″„⠑։ ⡁⡈;ܹ⡂։𝂬̤⡂꞉⣀ܹ⢁⠊𝄈⠉⠑ܸ̈׃ ;⢐;߳⠡܉˸⠒߳꞉⁚𝂬⠑⠒܅⠊;⠔⠢܄ ”⠉ֵ”⢂⢁̈⁚⠊˸⠌ܸ̤⣀𝂬⠤⠨⠢‥¨ ⡠܉꞉꞉⠑׃⠑⡐⠨؛ܸ܆„ܹ⡈⢁;⢄܄؛ ܲ⢄⠡⡁‥؛ܲ⢂“⢈։⠔⢄”꞉܉⠔ +# Taken from @SmoothUnicode@botsin.space +progress_spinner_sequence = ["։","𝄈","⡂","″","⡈߳","܃","⢂",":߳̈","⢁","܄","ː","“","⢐","″","„","⠑","։"," ","⡁","⡈",";ܹ","⡂","։","𝂬̤","⡂","꞉","⣀ܹ","⢁","⠊","𝄈","⠉","⠑ܸ̈","׃"," ",";","⢐",";߳","⠡","܉","˸","⠒߳","꞉","⁚","𝂬","⠑","⠒","܅","⠊",";","⠔","⠢","܄"," ","”","⠉ֵ","”","⢂","⢁̈","⁚","⠊","˸","⠌ܸ̤","⣀","𝂬","⠤","⠨","⠢","‥","¨"," ","⡠","܉","꞉","꞉","⠑","׃","⠑","⡐","⠨","؛ܸ","܆","„ܹ","⡈","⢁",";","⢄܄","؛"," ܲ","⢄","⠡","⡁","‥","؛ܲ","⢂","“","⢈","։","⠔","⢄","”","꞉","܉","⠔"] +.Ed .El .Sh LOG .Bl -tag -width 36n diff --git a/src/components/utilities/widgets.rs b/src/components/utilities/widgets.rs index a46482dc..02dbf9af 100644 --- a/src/components/utilities/widgets.rs +++ b/src/components/utilities/widgets.rs @@ -1189,11 +1189,17 @@ impl ProgressSpinner { pub fn set_custom_kind(&mut self, custom: Vec) { self.stage = 0; self.width = custom.iter().map(|f| f.grapheme_len()).max().unwrap_or(0); + if self.width == 0 { + self.stop(); + } self.kind = Err(custom); self.dirty = true; } pub fn start(&mut self) { + if self.width == 0 { + return; + } self.active = true; self.timer .set_interval(Self::INTERVAL)