mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-12 17:58:55 +08:00
Updated samples/demos to show usage of hide/show time elapsed/remaining
This commit is contained in:
@@ -6,12 +6,14 @@ int main() {
|
||||
std::cout << "\e[?25l";
|
||||
|
||||
indicators::ProgressSpinner spinner;
|
||||
|
||||
|
||||
// Configure the spinner
|
||||
spinner.set_postfix_text("Checking credentials");
|
||||
spinner.set_foreground_color(indicators::Color::YELLOW);
|
||||
spinner.set_spinner_states({"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"});
|
||||
|
||||
spinner.hide_elapsed_time();
|
||||
spinner.hide_remaining_time();
|
||||
|
||||
// Update spinner state
|
||||
auto job = [&spinner]() {
|
||||
while (true) {
|
||||
@@ -32,7 +34,7 @@ int main() {
|
||||
thread.join();
|
||||
|
||||
// Show cursor
|
||||
std::cout << "\e[?25h";
|
||||
std::cout << "\e[?25h";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user