|
@@ -27,6 +27,8 @@ Progressbar::Progressbar(Orientation orientation)
|
|
{ Format::ValueSlashMax, "ValueSlashMax" });
|
|
{ Format::ValueSlashMax, "ValueSlashMax" });
|
|
REGISTER_INT_PROPERTY("min", min, set_min);
|
|
REGISTER_INT_PROPERTY("min", min, set_min);
|
|
REGISTER_INT_PROPERTY("max", max, set_max);
|
|
REGISTER_INT_PROPERTY("max", max, set_max);
|
|
|
|
+
|
|
|
|
+ set_preferred_size(SpecialDimension::Fit);
|
|
}
|
|
}
|
|
|
|
|
|
void Progressbar::set_value(int value)
|
|
void Progressbar::set_value(int value)
|
|
@@ -81,4 +83,11 @@ void Progressbar::set_orientation(Orientation value)
|
|
update();
|
|
update();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Optional<UISize> Progressbar::calculated_preferred_size() const
|
|
|
|
+{
|
|
|
|
+ if (orientation() == Gfx::Orientation::Vertical)
|
|
|
|
+ return { { 22, SpecialDimension::OpportunisticGrow } };
|
|
|
|
+ return { { SpecialDimension::OpportunisticGrow, 22 } };
|
|
|
|
+}
|
|
|
|
+
|
|
}
|
|
}
|