Skip to content

Commit a67f939

Browse files
coolreader18NoraCodes
authored andcommitted
Improve documentation for progress bar value capping
1 parent 94d95a7 commit a67f939

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iui/src/controls/progressbar.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use ui_sys::{self, uiControl, uiProgressBar};
77
pub enum ProgressBarValue {
88
/// Represents a set, consistent percentage of the bar to be filled
99
///
10-
/// The value should be in the range 0..=100
10+
/// The value should be in the range 0..=100, and will be capped at 100
11+
/// by ProgressBar::set_value if it is larger
1112
Determinate(u32),
1213
/// Represents an indeterminate value of the progress bar, useful
1314
/// if you don't know how much of the task being represented is completed
@@ -40,6 +41,8 @@ impl ProgressBar {
4041
}
4142

4243
/// Set the value of the progress bar to a determinate value
44+
///
45+
/// If `value` is larger than 100, than the value will be set to 100.
4346
pub fn set_determinate(&mut self, value: u32) {
4447
self.set_value(ProgressBarValue::Determinate(value));
4548
}

0 commit comments

Comments
 (0)