Another small example where I'm unsure if this is intended behavior or a minor bug. It is about the usage of an exact size like .width(Px::new(100)) vs a lower bounded size like .width(Px::new(100)..). Consider the following example:
use cushy::animation::ZeroToOne;
use cushy::figures::units::Px;
use cushy::figures::Zero;
use cushy::value::Dynamic;
use cushy::widget::MakeWidget;
use cushy::widgets::progress::Progressable;
use cushy::Run;
fn content() -> impl MakeWidget {
let progress = Dynamic::new(ZeroToOne::ZERO);
progress
.clone()
.progress_bar()
.width(Px::new(100)..) // using just `Px::new(100)` works
.contain()
.centered()
.expand()
}
pub fn main() -> cushy::Result<()> {
content().run()
}
Using an exact size, the widget renders as:
Using a lower bounded size, the widget renders as:
For some reason, the progress bar got shrunken down to less then the 100 pixels in this case. Intuitively I would have expected that the range syntax would express 100 pixel or more, so I'm a bit surprised that it can shrink now. Interestingly, it still has a width of 100 to the outside (barely visible by the container size) -- only the inner widget seems to have lost its minimum width constraint?
Another small example where I'm unsure if this is intended behavior or a minor bug. It is about the usage of an exact size like
.width(Px::new(100))
vs a lower bounded size like.width(Px::new(100)..)
. Consider the following example:Using an exact size, the widget renders as:
Using a lower bounded size, the widget renders as:
For some reason, the progress bar got shrunken down to less then the 100 pixels in this case. Intuitively I would have expected that the range syntax would express 100 pixel or more, so I'm a bit surprised that it can shrink now. Interestingly, it still has a width of 100 to the outside (barely visible by the container size) -- only the inner widget seems to have lost its minimum width constraint?