Minor bug fixes and updates:

* Removed progress bar sample that progresses in reverse direction - This needs a class of its own
* Fixed a casting error in progress_bar class when dealing with max_progress variable
* Minor update to the cursor movement functions in linux
* Updated single include to include these changes
This commit is contained in:
Pranav Srinivas Kumar
2020-05-08 15:14:52 -05:00
parent 66af25ab62
commit 296bde6088
10 changed files with 17 additions and 41 deletions

View File

@@ -158,38 +158,6 @@ int main() {
thread4.join();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
{
//
// GOING BACKWARDS
//
indicators::ProgressBar p{option::BarWidth{50},
option::Start{"["},
option::Fill{""},
option::Lead{""},
option::Remainder{"-"},
option::End{"]"},
option::ForegroundColor{indicators::Color::white},
option::PostfixText{"Reverting system restore"},
option::FontStyles{
std::vector<indicators::FontStyle>{indicators::FontStyle::bold}}};
p.set_progress(100); // TODO backwards as an option?
std::atomic<size_t> progress{100};
auto job = [&p, &progress]() {
while (true) {
progress -= 1;
p.set_progress(progress);
if (progress == 0) {
p.set_option(option::PostfixText{"Revert complete!"});
p.mark_as_completed();
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(60));
}
};
std::thread thread(job);
thread.join();
}
}
{