mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
Add a MaxProgress option (default: 100).
The MaxProgress option allows you to set the maximum number of ticks that are within a progress bar. Each call to tick() increments the tick count. The progress bar percentage is the number of ticks divided by the MaxProgress option. The default MaxProgress is 100, so each tick would be 1%. If MaxProgress is set to 500, for example, then each tick would be 0.2%.
This commit is contained in:
@@ -89,7 +89,8 @@ enum class ProgressBarOption {
|
||||
spinner_show,
|
||||
spinner_states,
|
||||
font_styles,
|
||||
hide_bar_when_complete
|
||||
hide_bar_when_complete,
|
||||
max_progress
|
||||
};
|
||||
|
||||
template <typename T, ProgressBarOption Id> struct Setting {
|
||||
@@ -204,5 +205,6 @@ using HideBarWhenComplete =
|
||||
details::BooleanSetting<details::ProgressBarOption::hide_bar_when_complete>;
|
||||
using FontStyles =
|
||||
details::Setting<std::vector<FontStyle>, details::ProgressBarOption::font_styles>;
|
||||
using MaxProgress = details::IntegerSetting<details::ProgressBarOption::max_progress>;
|
||||
} // namespace option
|
||||
} // namespace indicators
|
||||
|
||||
Reference in New Issue
Block a user