mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
ProgressBar API change - make ProgressBar constructible with options
This commit is contained in:
@@ -3,17 +3,16 @@
|
||||
#include <thread>
|
||||
|
||||
int main() {
|
||||
indicators::ProgressBar bar;
|
||||
|
||||
// Configure the bar
|
||||
bar.set_bar_width(50);
|
||||
bar.start_bar_with("[");
|
||||
bar.fill_bar_progress_with("=");
|
||||
bar.lead_bar_progress_with(">");
|
||||
bar.fill_bar_remainder_with(" ");
|
||||
bar.end_bar_with("]");
|
||||
bar.set_postfix_text("Getting started");
|
||||
bar.set_foreground_color(indicators::Color::GREEN);
|
||||
indicators::ProgressBar bar{
|
||||
indicators::option::BarWidth{50},
|
||||
indicators::option::Start{"["},
|
||||
indicators::option::Fill{"="},
|
||||
indicators::option::Lead{">"},
|
||||
indicators::option::Remainder{" "},
|
||||
indicators::option::End{" ]"},
|
||||
indicators::option::PostfixText{"Getting started"},
|
||||
indicators::option::ForegroundColor{indicators::Color::GREEN},
|
||||
};
|
||||
|
||||
// Update bar state
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user