Make Row, Column, and Checkbox shrink by default

This commit is contained in:
Héctor Ramón Jiménez 2019-12-30 20:54:04 +01:00
parent 74d01a6957
commit 2ff0e48142
17 changed files with 42 additions and 54 deletions

View file

@ -54,7 +54,7 @@ impl<Message> Checkbox<Message> {
on_toggle: Box::new(f),
label: String::from(label),
label_color: None,
width: Length::Fill,
width: Length::Shrink,
}
}

View file

@ -33,7 +33,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> {
Column {
spacing: 0,
padding: 0,
width: Length::Fill,
width: Length::Shrink,
height: Length::Shrink,
max_width: u32::MAX,
max_height: u32::MAX,

View file

@ -95,6 +95,7 @@ where
let size = self::Renderer::default_size(renderer);
Row::<(), Renderer>::new()
.width(Length::Fill)
.spacing(15)
.align_items(Align::Center)
.push(

View file

@ -33,7 +33,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
Row {
spacing: 0,
padding: 0,
width: Length::Fill,
width: Length::Shrink,
height: Length::Shrink,
max_width: u32::MAX,
max_height: u32::MAX,

View file

@ -30,7 +30,7 @@ impl Svg {
Svg {
handle: handle.into(),
width: Length::Fill,
height: Length::Fill,
height: Length::Shrink,
}
}

View file

@ -41,7 +41,7 @@ impl Text {
size: None,
color: None,
font: Font::Default,
width: Length::Fill,
width: Length::Shrink,
height: Length::Shrink,
horizontal_alignment: HorizontalAlignment::Left,
vertical_alignment: VerticalAlignment::Top,

View file

@ -64,11 +64,11 @@ impl<'a, Message> TextInput<'a, Message> {
placeholder: &str,
value: &str,
on_change: F,
) -> Self
) -> TextInput<'a, Message>
where
F: 'static + Fn(String) -> Message,
{
Self {
TextInput {
state,
placeholder: String::from(placeholder),
value: Value::new(value),