Add Length::FillPortion variant
It allows to specify the amount of available space an element should take relative to other elements.
This commit is contained in:
parent
4b86c2ff98
commit
aecc3ad195
4 changed files with 14 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ pub fn length(length: Length) -> String {
|
|||
match length {
|
||||
Length::Shrink => String::from("auto"),
|
||||
Length::Units(px) => format!("{}px", px),
|
||||
Length::Fill => String::from("100%"),
|
||||
Length::Fill | Length::FillPortion(_) => String::from("100%"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ impl<Message> Widget<Message> for Image {
|
|||
|
||||
match self.width {
|
||||
Length::Shrink => {}
|
||||
Length::Fill => {
|
||||
Length::Fill | Length::FillPortion(_) => {
|
||||
image = image.attr("width", "100%");
|
||||
}
|
||||
Length::Units(px) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue