post review changes

This commit is contained in:
Dawid Pilarski
2020-02-11 08:57:38 +01:00
committed by pilarski
parent 186f1aafc7
commit 5c54b69e55
5 changed files with 16 additions and 16 deletions

View File

@@ -173,7 +173,7 @@ int main() {
option::Lead{"█"}, option::Lead{"█"},
option::Remainder{"-"}, option::Remainder{"-"},
option::End{"]"}, option::End{"]"},
option::PrefixText{"Training Gaze Network "👀}, option::PrefixText{"Training Gaze Network "},
option::ForegroundColor{Color::YELLOW} option::ForegroundColor{Color::YELLOW}
option::ShowElapsedTime{true}; option::ShowElapsedTime{true};
option::ShowRemainingTime{true}; option::ShowRemainingTime{true};
@@ -364,7 +364,7 @@ int main() {
indicators::ProgressSpinner spinner{ indicators::ProgressSpinner spinner{
option::PostfixText{"Checking credentials"}, option::PostfixText{"Checking credentials"},
option::ForegroundColor{Color::YELLOW}, option::ForegroundColor{Color::YELLOW},
option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"};} option::SpinnerStates{std::vector<std::string>{"⠈", "⠐", "⠠", "⢀", "⡀", "⠄", "⠂", "⠁"}}
}; };
// Update spinner state // Update spinner state
@@ -373,7 +373,7 @@ int main() {
if (spinner.is_completed()) { if (spinner.is_completed()) {
spinner.set_option(option::ForegroundColor{Color::GREEN}); spinner.set_option(option::ForegroundColor{Color::GREEN});
spinner.set_option(option::PrefixText{"✔"}); spinner.set_option(option::PrefixText{"✔"});
spinner.set_option(option::SpinnerShow{false}); spinner.set_option(option::ShowSpinner{false});
spinner.set_option(option::ShowPercentage{false}); spinner.set_option(option::ShowPercentage{false});
spinner.set_option(option::PostfixText{"Authenticated!"}); spinner.set_option(option::PostfixText{"Authenticated!"});
spinner.mark_as_completed(); spinner.mark_as_completed();

View File

@@ -12,7 +12,7 @@ int main() {
// PROGRESS BAR 1 // PROGRESS BAR 1
// //
indicators::ProgressBar p{option::BarWidth{50}, indicators::ProgressBar p{option::BarWidth{50},
option::Start{"{"}, option::Start{"["},
option::Fill{""}, option::Fill{""},
option::Lead{""}, option::Lead{""},
option::Remainder{" "}, option::Remainder{" "},
@@ -200,7 +200,7 @@ int main() {
if (p.is_completed()) { if (p.is_completed()) {
p.set_option(option::ForegroundColor{indicators::Color::GREEN}); p.set_option(option::ForegroundColor{indicators::Color::GREEN});
p.set_option(option::PrefixText{""}); p.set_option(option::PrefixText{""});
p.set_option(option::SpinnerShow{false}); p.set_option(option::ShowSpinner{false});
p.set_option(option::ShowPercentage{false}); p.set_option(option::ShowPercentage{false});
p.set_option(option::PostfixText{"Authenticated!"}); p.set_option(option::PostfixText{"Authenticated!"});
p.mark_as_completed(); p.mark_as_completed();
@@ -231,31 +231,31 @@ int main() {
auto current = p.current(); auto current = p.current();
if (current == 24) { if (current == 24) {
p.set_option(option::PrefixText{" - ✔"}); p.set_option(option::PrefixText{" - ✔"});
p.set_option(option::SpinnerShow{false}); p.set_option(option::ShowSpinner{false});
} else if (current == 25) { } else if (current == 25) {
std::cout << std::endl; std::cout << std::endl;
p.set_option(option::SpinnerShow{true}); p.set_option(option::ShowSpinner{true});
p.set_option(option::PrefixText{" - "}); p.set_option(option::PrefixText{" - "});
p.set_option(option::PostfixText{"Contacting Kerbal headquarters"}); p.set_option(option::PostfixText{"Contacting Kerbal headquarters"});
} else if (current == 49) { } else if (current == 49) {
p.set_option(option::PrefixText{" - ✔"}); p.set_option(option::PrefixText{" - ✔"});
p.set_option(option::SpinnerShow{false}); p.set_option(option::ShowSpinner{false});
} else if (current == 50) { } else if (current == 50) {
std::cout << std::endl; std::cout << std::endl;
p.set_option(option::SpinnerShow{true}); p.set_option(option::ShowSpinner{true});
p.set_option(option::PrefixText{" - "}); p.set_option(option::PrefixText{" - "});
p.set_option(option::PostfixText{"Designing spaceship"}); p.set_option(option::PostfixText{"Designing spaceship"});
} else if (current == 74) { } else if (current == 74) {
p.set_option(option::PrefixText{" - ✔"}); p.set_option(option::PrefixText{" - ✔"});
p.set_option(option::SpinnerShow{false}); p.set_option(option::ShowSpinner{false});
} else if (current == 75) { } else if (current == 75) {
std::cout << std::endl; std::cout << std::endl;
p.set_option(option::SpinnerShow{true}); p.set_option(option::ShowSpinner{true});
p.set_option(option::PrefixText{" - "}); p.set_option(option::PrefixText{" - "});
p.set_option(option::PostfixText{"Launching rocket"}); p.set_option(option::PostfixText{"Launching rocket"});
} else if (current == 95) { } else if (current == 95) {
p.set_option(option::PrefixText{" - ✔"}); p.set_option(option::PrefixText{" - ✔"});
p.set_option(option::SpinnerShow{false}); p.set_option(option::ShowSpinner{false});
} else if (current == 99) { } else if (current == 99) {
std::cout << std::endl; std::cout << std::endl;
// //

View File

@@ -53,7 +53,7 @@ class ProgressSpinner {
option::ShowPercentage, option::ShowPercentage,
option::ShowElapsedTime, option::ShowElapsedTime,
option::ShowRemainingTime, option::ShowRemainingTime,
option::SpinnerShow, option::ShowSpinner,
option::SavedStartTime, option::SavedStartTime,
option::Completed, option::Completed,
option::MaxPostfixTextLen, option::MaxPostfixTextLen,
@@ -68,7 +68,7 @@ public:
details::get<details::ProgressBarOption::show_percentage>(option::ShowPercentage{true}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::show_percentage>(option::ShowPercentage{true}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::show_elapsed_time>(option::ShowElapsedTime{false}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::show_elapsed_time>(option::ShowElapsedTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::show_remaining_time>(option::ShowRemainingTime{false}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::show_remaining_time>(option::ShowRemainingTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::spinner_show>(option::SpinnerShow{true}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::spinner_show>(option::ShowSpinner{true}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::saved_start_time>(option::SavedStartTime{false}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::saved_start_time>(option::SavedStartTime{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::completed>(option::Completed{false}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::completed>(option::Completed{false}, std::forward<Args>(args)...),
details::get<details::ProgressBarOption::max_postfix_text_len>(option::MaxPostfixTextLen{0}, std::forward<Args>(args)...), details::get<details::ProgressBarOption::max_postfix_text_len>(option::MaxPostfixTextLen{0}, std::forward<Args>(args)...),

View File

@@ -216,7 +216,7 @@ namespace option{
using ShowRemainingTime = details::BooleanSetting<details::ProgressBarOption::show_remaining_time>; using ShowRemainingTime = details::BooleanSetting<details::ProgressBarOption::show_remaining_time>;
using SavedStartTime = details::BooleanSetting<details::ProgressBarOption::saved_start_time>; using SavedStartTime = details::BooleanSetting<details::ProgressBarOption::saved_start_time>;
using ForegroundColor = details::Setting<Color, details::ProgressBarOption::foreground_color>; using ForegroundColor = details::Setting<Color, details::ProgressBarOption::foreground_color>;
using SpinnerShow = details::BooleanSetting<details::ProgressBarOption::spinner_show>; using ShowSpinner = details::BooleanSetting<details::ProgressBarOption::spinner_show>;
using SpinnerStates = details::Setting<std::vector<std::string>, details::ProgressBarOption::spinner_states>; using SpinnerStates = details::Setting<std::vector<std::string>, details::ProgressBarOption::spinner_states>;
} }
} }

View File

@@ -17,7 +17,7 @@ int main() {
if (spinner.is_completed()) { if (spinner.is_completed()) {
spinner.set_option(indicators::option::ForegroundColor{indicators::Color::GREEN}); spinner.set_option(indicators::option::ForegroundColor{indicators::Color::GREEN});
spinner.set_option(indicators::option::PrefixText{""}); spinner.set_option(indicators::option::PrefixText{""});
spinner.set_option(indicators::option::SpinnerShow{false}); spinner.set_option(indicators::option::ShowSpinner{false});
spinner.set_option(indicators::option::ShowPercentage{false}); spinner.set_option(indicators::option::ShowPercentage{false});
spinner.set_option(indicators::option::PostfixText{"Authenticated!"}); spinner.set_option(indicators::option::PostfixText{"Authenticated!"});
spinner.mark_as_completed(); spinner.mark_as_completed();