Fix circular progress crashing when value is out of range
fixes #682, fixes #854
This commit is contained in:
parent
44fa18367e
commit
d42bb08e84
1 changed files with 3 additions and 3 deletions
|
@ -999,9 +999,9 @@ fn build_circular_progress_bar(bargs: &mut BuilderArgs) -> Result<CircProg> {
|
||||||
let w = CircProg::new();
|
let w = CircProg::new();
|
||||||
def_widget!(bargs, _g, w, {
|
def_widget!(bargs, _g, w, {
|
||||||
// @prop value - the value, between 0 - 100
|
// @prop value - the value, between 0 - 100
|
||||||
prop(value: as_f64) { w.set_property("value", value); },
|
prop(value: as_f64) { w.set_property("value", value.clamp(0.0, 100.0)); },
|
||||||
// @prop start-at - the angle that the circle should start at
|
// @prop start-at - the percentage that the circle should start at
|
||||||
prop(start_at: as_f64) { w.set_property("start-at", start_at); },
|
prop(start_at: as_f64) { w.set_property("start-at", start_at.clamp(0.0, 100.0)); },
|
||||||
// @prop thickness - the thickness of the circle
|
// @prop thickness - the thickness of the circle
|
||||||
prop(thickness: as_f64) { w.set_property("thickness", thickness); },
|
prop(thickness: as_f64) { w.set_property("thickness", thickness); },
|
||||||
// @prop clockwise - wether the progress bar spins clockwise or counter clockwise
|
// @prop clockwise - wether the progress bar spins clockwise or counter clockwise
|
||||||
|
|
Loading…
Add table
Reference in a new issue