Time elapsed/remaining is hidden by default

This commit is contained in:
Pranav Srinivas Kumar
2019-12-17 09:43:53 -06:00
parent 78b7abcfbd
commit aa5dffa4e2
9 changed files with 6 additions and 32 deletions

View File

@@ -18,8 +18,6 @@ int main() {
p.lead_bar_progress_with(""); p.lead_bar_progress_with("");
p.fill_bar_remainder_with(" "); p.fill_bar_remainder_with(" ");
p.end_bar_with(" ]"); p.end_bar_with(" ]");
p.hide_elapsed_time();
p.hide_remaining_time();
p.set_foreground_color(indicators::Color::YELLOW); p.set_foreground_color(indicators::Color::YELLOW);
std::atomic<size_t> index{0}; std::atomic<size_t> index{0};
@@ -59,8 +57,6 @@ int main() {
p.lead_bar_progress_with(""); p.lead_bar_progress_with("");
p.fill_bar_remainder_with(""); p.fill_bar_remainder_with("");
p.end_bar_with(""); p.end_bar_with("");
p.hide_elapsed_time();
p.hide_remaining_time();
p.set_foreground_color(indicators::Color::WHITE); p.set_foreground_color(indicators::Color::WHITE);
p.hide_percentage(); p.hide_percentage();
auto job = [&p]() { auto job = [&p]() {
@@ -91,8 +87,6 @@ int main() {
p.fill_bar_remainder_with(" "); p.fill_bar_remainder_with(" ");
p.end_bar_with("]"); p.end_bar_with("]");
p.set_postfix_text("Getting started"); p.set_postfix_text("Getting started");
p.hide_elapsed_time();
p.hide_remaining_time();
p.set_foreground_color(indicators::Color::GREEN); p.set_foreground_color(indicators::Color::GREEN);
auto job = [&p]() { auto job = [&p]() {
while (true) { while (true) {
@@ -130,8 +124,6 @@ int main() {
p4.set_foreground_color(indicators::Color::CYAN); p4.set_foreground_color(indicators::Color::CYAN);
p4.set_postfix_text("Restoring system state"); p4.set_postfix_text("Restoring system state");
p4.hide_percentage(); p4.hide_percentage();
p4.hide_elapsed_time();
p4.hide_remaining_time();
std::atomic<size_t> index4{0}; std::atomic<size_t> index4{0};
auto job4 = [&p4, &index4, &lead_spinner]() { auto job4 = [&p4, &index4, &lead_spinner]() {
while (true) { while (true) {
@@ -175,8 +167,6 @@ int main() {
p.set_progress(100); p.set_progress(100);
p.set_foreground_color(indicators::Color::WHITE); p.set_foreground_color(indicators::Color::WHITE);
p.set_postfix_text("Reverting system restore"); p.set_postfix_text("Reverting system restore");
p.hide_elapsed_time();
p.hide_remaining_time();
std::atomic<size_t> progress{100}; std::atomic<size_t> progress{100};
auto job = [&p, &progress]() { auto job = [&p, &progress]() {
while (true) { while (true) {
@@ -204,8 +194,6 @@ int main() {
p.set_postfix_text("Checking credentials"); p.set_postfix_text("Checking credentials");
p.set_foreground_color(indicators::Color::YELLOW); p.set_foreground_color(indicators::Color::YELLOW);
p.set_spinner_states({"", "", "", "", "", "", "", ""}); p.set_spinner_states({"", "", "", "", "", "", "", ""});
p.hide_elapsed_time();
p.hide_remaining_time();
auto job = [&p]() { auto job = [&p]() {
while (true) { while (true) {
if (p.is_completed()) { if (p.is_completed()) {
@@ -236,8 +224,6 @@ int main() {
p.set_foreground_color(indicators::Color::WHITE); p.set_foreground_color(indicators::Color::WHITE);
p.set_spinner_states({"", "", "", ""}); p.set_spinner_states({"", "", "", ""});
p.hide_percentage(); p.hide_percentage();
p.hide_elapsed_time();
p.hide_remaining_time();
auto job = [&p]() { auto job = [&p]() {
while (true) { while (true) {
auto current = p.current(); auto current = p.current();
@@ -283,8 +269,6 @@ int main() {
p2.end_bar_with("🌑"); p2.end_bar_with("🌑");
p2.set_postfix_text("Achieved low-Earth orbit"); p2.set_postfix_text("Achieved low-Earth orbit");
p2.set_foreground_color(indicators::Color::WHITE); p2.set_foreground_color(indicators::Color::WHITE);
p2.hide_elapsed_time();
p2.hide_remaining_time();
std::vector<std::string> ship_trail{"", "", "", "", "", "", "", ""}; std::vector<std::string> ship_trail{"", "", "", "", "", "", "", ""};
std::atomic<int> ship_trail_index{0}; std::atomic<int> ship_trail_index{0};
auto job2 = [&p2, &ship_trail_index, &ship_trail]() { auto job2 = [&p2, &ship_trail_index, &ship_trail]() {

View File

@@ -125,8 +125,8 @@ private:
std::atomic<size_t> _max_postfix_text_length{0}; std::atomic<size_t> _max_postfix_text_length{0};
std::atomic<bool> _completed{false}; std::atomic<bool> _completed{false};
std::atomic<bool> _show_percentage{true}; std::atomic<bool> _show_percentage{true};
std::atomic<bool> _show_elapsed_time{true}; std::atomic<bool> _show_elapsed_time{false};
std::atomic<bool> _show_remaining_time{true}; std::atomic<bool> _show_remaining_time{false};
std::atomic<bool> _saved_start_time{false}; std::atomic<bool> _saved_start_time{false};
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point; std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
std::mutex _mutex; std::mutex _mutex;

View File

@@ -139,8 +139,8 @@ private:
std::atomic<size_t> _max_postfix_text_length{0}; std::atomic<size_t> _max_postfix_text_length{0};
std::atomic<bool> _completed{false}; std::atomic<bool> _completed{false};
std::atomic<bool> _show_percentage{true}; std::atomic<bool> _show_percentage{true};
std::atomic<bool> _show_elapsed_time{true}; std::atomic<bool> _show_elapsed_time{false};
std::atomic<bool> _show_remaining_time{true}; std::atomic<bool> _show_remaining_time{false};
std::atomic<bool> _saved_start_time{false}; std::atomic<bool> _saved_start_time{false};
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point; std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
std::mutex _mutex; std::mutex _mutex;

View File

@@ -115,8 +115,8 @@ private:
std::atomic<size_t> _max_postfix_text_length{0}; std::atomic<size_t> _max_postfix_text_length{0};
std::atomic<bool> _completed{false}; std::atomic<bool> _completed{false};
std::atomic<bool> _show_percentage{true}; std::atomic<bool> _show_percentage{true};
std::atomic<bool> _show_elapsed_time{true}; std::atomic<bool> _show_elapsed_time{false};
std::atomic<bool> _show_remaining_time{true}; std::atomic<bool> _show_remaining_time{false};
std::atomic<bool> _saved_start_time{false}; std::atomic<bool> _saved_start_time{false};
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point; std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
std::atomic<bool> _show_spinner{true}; std::atomic<bool> _show_spinner{true};

View File

@@ -14,8 +14,6 @@ int main() {
bar.start_bar_with("["); bar.start_bar_with("[");
bar.end_bar_with("]"); bar.end_bar_with("]");
bar.set_foreground_color(indicators::Color::WHITE); bar.set_foreground_color(indicators::Color::WHITE);
bar.hide_elapsed_time();
bar.hide_remaining_time();
// Update bar state // Update bar state
auto progress = 0.0f; auto progress = 0.0f;

View File

@@ -11,8 +11,6 @@ int main() {
bar.fill_bar_remainder_with("-"); bar.fill_bar_remainder_with("-");
bar.end_bar_with("]"); bar.end_bar_with("]");
bar.set_foreground_color(indicators::Color::YELLOW); bar.set_foreground_color(indicators::Color::YELLOW);
bar.hide_elapsed_time();
bar.hide_remaining_time();
// As configured, the bar will look like this: // As configured, the bar will look like this:
// //

View File

@@ -14,8 +14,6 @@ int main() {
bar.end_bar_with("]"); bar.end_bar_with("]");
bar.set_postfix_text("Getting started"); bar.set_postfix_text("Getting started");
bar.set_foreground_color(indicators::Color::GREEN); bar.set_foreground_color(indicators::Color::GREEN);
bar.hide_elapsed_time();
bar.hide_remaining_time();
// Update bar state // Update bar state

View File

@@ -14,8 +14,6 @@ int main() {
bar.end_bar_with("]"); bar.end_bar_with("]");
bar.set_postfix_text("Getting started"); bar.set_postfix_text("Getting started");
bar.set_foreground_color(indicators::Color::GREEN); bar.set_foreground_color(indicators::Color::GREEN);
bar.hide_elapsed_time();
bar.hide_remaining_time();
// Update bar state // Update bar state
while (true) { while (true) {

View File

@@ -11,8 +11,6 @@ int main() {
spinner.set_postfix_text("Checking credentials"); spinner.set_postfix_text("Checking credentials");
spinner.set_foreground_color(indicators::Color::YELLOW); spinner.set_foreground_color(indicators::Color::YELLOW);
spinner.set_spinner_states({"", "", "", "", "", "", "", ""}); spinner.set_spinner_states({"", "", "", "", "", "", "", ""});
spinner.hide_elapsed_time();
spinner.hide_remaining_time();
// Update spinner state // Update spinner state
auto job = [&spinner]() { auto job = [&spinner]() {