mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-13 02:28:53 +08:00
Time elapsed/remaining is hidden by default
This commit is contained in:
@@ -18,8 +18,6 @@ int main() {
|
||||
p.lead_bar_progress_with("■");
|
||||
p.fill_bar_remainder_with(" ");
|
||||
p.end_bar_with(" ]");
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
p.set_foreground_color(indicators::Color::YELLOW);
|
||||
|
||||
std::atomic<size_t> index{0};
|
||||
@@ -59,8 +57,6 @@ int main() {
|
||||
p.lead_bar_progress_with("");
|
||||
p.fill_bar_remainder_with("");
|
||||
p.end_bar_with("");
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
p.set_foreground_color(indicators::Color::WHITE);
|
||||
p.hide_percentage();
|
||||
auto job = [&p]() {
|
||||
@@ -91,8 +87,6 @@ int main() {
|
||||
p.fill_bar_remainder_with(" ");
|
||||
p.end_bar_with("]");
|
||||
p.set_postfix_text("Getting started");
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
p.set_foreground_color(indicators::Color::GREEN);
|
||||
auto job = [&p]() {
|
||||
while (true) {
|
||||
@@ -130,8 +124,6 @@ int main() {
|
||||
p4.set_foreground_color(indicators::Color::CYAN);
|
||||
p4.set_postfix_text("Restoring system state");
|
||||
p4.hide_percentage();
|
||||
p4.hide_elapsed_time();
|
||||
p4.hide_remaining_time();
|
||||
std::atomic<size_t> index4{0};
|
||||
auto job4 = [&p4, &index4, &lead_spinner]() {
|
||||
while (true) {
|
||||
@@ -175,8 +167,6 @@ int main() {
|
||||
p.set_progress(100);
|
||||
p.set_foreground_color(indicators::Color::WHITE);
|
||||
p.set_postfix_text("Reverting system restore");
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
std::atomic<size_t> progress{100};
|
||||
auto job = [&p, &progress]() {
|
||||
while (true) {
|
||||
@@ -204,8 +194,6 @@ int main() {
|
||||
p.set_postfix_text("Checking credentials");
|
||||
p.set_foreground_color(indicators::Color::YELLOW);
|
||||
p.set_spinner_states({"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"});
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
auto job = [&p]() {
|
||||
while (true) {
|
||||
if (p.is_completed()) {
|
||||
@@ -236,8 +224,6 @@ int main() {
|
||||
p.set_foreground_color(indicators::Color::WHITE);
|
||||
p.set_spinner_states({"▖", "▘", "▝", "▗"});
|
||||
p.hide_percentage();
|
||||
p.hide_elapsed_time();
|
||||
p.hide_remaining_time();
|
||||
auto job = [&p]() {
|
||||
while (true) {
|
||||
auto current = p.current();
|
||||
@@ -283,8 +269,6 @@ int main() {
|
||||
p2.end_bar_with("🌑");
|
||||
p2.set_postfix_text("Achieved low-Earth orbit");
|
||||
p2.set_foreground_color(indicators::Color::WHITE);
|
||||
p2.hide_elapsed_time();
|
||||
p2.hide_remaining_time();
|
||||
std::vector<std::string> ship_trail{"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"};
|
||||
std::atomic<int> ship_trail_index{0};
|
||||
auto job2 = [&p2, &ship_trail_index, &ship_trail]() {
|
||||
|
||||
@@ -125,8 +125,8 @@ private:
|
||||
std::atomic<size_t> _max_postfix_text_length{0};
|
||||
std::atomic<bool> _completed{false};
|
||||
std::atomic<bool> _show_percentage{true};
|
||||
std::atomic<bool> _show_elapsed_time{true};
|
||||
std::atomic<bool> _show_remaining_time{true};
|
||||
std::atomic<bool> _show_elapsed_time{false};
|
||||
std::atomic<bool> _show_remaining_time{false};
|
||||
std::atomic<bool> _saved_start_time{false};
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
|
||||
std::mutex _mutex;
|
||||
|
||||
@@ -139,8 +139,8 @@ private:
|
||||
std::atomic<size_t> _max_postfix_text_length{0};
|
||||
std::atomic<bool> _completed{false};
|
||||
std::atomic<bool> _show_percentage{true};
|
||||
std::atomic<bool> _show_elapsed_time{true};
|
||||
std::atomic<bool> _show_remaining_time{true};
|
||||
std::atomic<bool> _show_elapsed_time{false};
|
||||
std::atomic<bool> _show_remaining_time{false};
|
||||
std::atomic<bool> _saved_start_time{false};
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
|
||||
std::mutex _mutex;
|
||||
|
||||
@@ -115,8 +115,8 @@ private:
|
||||
std::atomic<size_t> _max_postfix_text_length{0};
|
||||
std::atomic<bool> _completed{false};
|
||||
std::atomic<bool> _show_percentage{true};
|
||||
std::atomic<bool> _show_elapsed_time{true};
|
||||
std::atomic<bool> _show_remaining_time{true};
|
||||
std::atomic<bool> _show_elapsed_time{false};
|
||||
std::atomic<bool> _show_remaining_time{false};
|
||||
std::atomic<bool> _saved_start_time{false};
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> _start_time_point;
|
||||
std::atomic<bool> _show_spinner{true};
|
||||
|
||||
@@ -14,8 +14,6 @@ int main() {
|
||||
bar.start_bar_with("[");
|
||||
bar.end_bar_with("]");
|
||||
bar.set_foreground_color(indicators::Color::WHITE);
|
||||
bar.hide_elapsed_time();
|
||||
bar.hide_remaining_time();
|
||||
|
||||
// Update bar state
|
||||
auto progress = 0.0f;
|
||||
|
||||
@@ -11,8 +11,6 @@ int main() {
|
||||
bar.fill_bar_remainder_with("-");
|
||||
bar.end_bar_with("]");
|
||||
bar.set_foreground_color(indicators::Color::YELLOW);
|
||||
bar.hide_elapsed_time();
|
||||
bar.hide_remaining_time();
|
||||
|
||||
// As configured, the bar will look like this:
|
||||
//
|
||||
|
||||
@@ -14,8 +14,6 @@ int main() {
|
||||
bar.end_bar_with("]");
|
||||
bar.set_postfix_text("Getting started");
|
||||
bar.set_foreground_color(indicators::Color::GREEN);
|
||||
bar.hide_elapsed_time();
|
||||
bar.hide_remaining_time();
|
||||
|
||||
// Update bar state
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ int main() {
|
||||
bar.end_bar_with("]");
|
||||
bar.set_postfix_text("Getting started");
|
||||
bar.set_foreground_color(indicators::Color::GREEN);
|
||||
bar.hide_elapsed_time();
|
||||
bar.hide_remaining_time();
|
||||
|
||||
// Update bar state
|
||||
while (true) {
|
||||
|
||||
@@ -11,8 +11,6 @@ int main() {
|
||||
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]() {
|
||||
|
||||
Reference in New Issue
Block a user